Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Remove/justify all &T to &mut T transmutes #13933

Closed

Description

@huonw

This is undefined behaviour, and so would preferably be avoided by using Unsafe etc.

#13934 removed the transmute_mut function, replacing it with (closer to) correct code where possible & transmute::<&_, &mut where not possible (that code snippet is the longest sequence that means grep will find all of the calls I inserted). There's fixmes pointing to this issue too.

Activity

  1. added a commit that references this issue on May 5, 2014
  2. added a commit that references this issue on May 29, 2014
  3. added a commit that references this issue on Jun 11, 2014
  4. steveklabnik commented on Feb 10, 2015

    @steveklabnik
    Contributor

    I believe these are all now basically gone:

    $ git grep "transmute::<&"
    src/libstd/sys/unix/process.rs:            mem::transmute::<&ProcessConfig<K,V>,&'static ProcessConfig<K,V>>(cfg)
    src/libsyntax/ast.rs:            ::std::mem::transmute::<&str,&str>(&token::get_name(*self))
    src/libsyntax/parse/token.rs:            mem::transmute::<&[u8],&[u8]>(this.container_as_bytes())
    src/test/run-make/mixing-deps/prog.rs:    assert_eq!(unsafe { mem::transmute::<&int, uint>(&both::foo) },
    
    
  5. added a commit that references this issue on Feb 13, 2023
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions