Skip to content

Ban Vec<Rooted<T>> and Vec<Temporary<T>> #4336

Closed

Description

@jdm

These constructs are unsafe, since the inner types rely on being stack-allocated to provide safety guarantees, and vectors are heap-allocated. We should write lints to prevent any further instances of these.

Activity

  1. added
    I-safety
    on Dec 11, 2014
  2. jdm commented on Dec 11, 2014

    @jdm
    MemberAuthor

    Also banning raw *mut JSObject, jsval, *mut JSString, *mut JSFunction, etc. would be extremely useful. It will certainly make them easier to find for #4337.

  3. pcwalton commented on Dec 11, 2014

    @pcwalton
    Contributor

    Can we whitelist the types that a Rooted/Temporary are allowed to be contained within?

  4. jdm commented on Dec 11, 2014

    @jdm
    MemberAuthor

    That's not a bad idea.

  5. Manishearth commented on Dec 19, 2014

    @Manishearth
    Member

    Also ban Cell<JS<T>> and Cell<JSVal> after #4401 lands, use match_unwrap_ty from #4173.

  6. added a commit that references this issue on Feb 4, 2015
  7. nox commented on Sep 30, 2017

    @nox
    Contributor

    Both Rooted<T> and Temporary<T> are dead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-pluginsI-safety

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions