-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Path remapping ICE from unnecessary_transmutes
suggestion
#140277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
wait whats the repro? |
@Wyvern can you provide a more self-contained / complete reproducer? It's hard to determine how to reproduce this ICE, since based on the backtrace we can only guess it involves zerocopy's macro + path remapping. |
Nvm I synthesized a repro based on // transmute.rs
#[macro_export]
macro_rules! transmute {
($e:expr) => {{
let e = $e;
if false {
todo!()
} else {
let u = unsafe {
#[allow(clippy::missing_transmute_annotations)]
unsafe { std::mem::transmute(e) }
};
u
}
}}
} // foo.rs
#![crate_type = "rlib"]
fn bytes_at_home(x: [u8; 4]) -> u32 {
unsafe { transmute::transmute!(x) }
} $ rustc +nightly -Zunstable-options -Z remap-path-scope=all transmute.rs --crate-type=rlib --remap-path-prefix=/home/=/x
$ rustc +nightly foo.rs --extern transmute=libtransmute.rlib
|
d7ea436a0 2025-04-24
unnecessary_transmutes
suggestion
Rollup merge of rust-lang#140284 - bend-n:fix-expectation-unmet, r=jieyouxu remove expect() in `unnecessary_transmutes` removes expect() from rust-lang#136083 and fixes rust-lang#140277 includes regression test r? lcnr
The text was updated successfully, but these errors were encountered: