-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
ConstProp miscompilation around references #73609
Comments
This comment has been minimized.
This comment has been minimized.
In fact even level 2 is broken. |
... and level 1, for the union issue (so let's treat the other one separately). |
This doesn't require nightly after all, we have a stable-to-nightly regression when just running this code: fn main() {
#[allow(dead_code)]
union U {
f1: u32,
f2: f32,
}
let mut u = U { f1: 1 };
unsafe {
let b1 = &mut u.f1;
*b1 = 5;
}
assert_eq!(unsafe { u.f1 }, 5);
} gives
|
In fact we don't even need a union, nor an unsafe block: fn main() {
#[allow(dead_code)]
struct U {
f1: u32,
f2: f32,
}
let mut u = U { f1: 1, f2: 1.0 };
let b1 = &mut u.f1;
*b1 = 5;
assert_eq!( { u.f1 }, 5);
} |
Minimized: fn main() {
let mut u = (1,);
*&mut u.0 = 5;
assert_eq!( { u.0 }, 5);
} |
on it |
giving this p-critical based on our discussion |
Why is this |
@RalfJung: Why didn't the assertion failure cause a Miri toolstate change? |
I think this is stable-to-nightly only... @oli-obk why did you change that? @Aaron1011 rustc's CI currently only tests Miri with mir-opt-level=0. |
I tested it in the playground and I thought it also happened on beta? |
Hmm... not sure what happened, must have mis-clicked on the playground |
#71911 introduced a (nightly-to-nightly) regression in mir-opt-level=3: since that landed, this assertion fails when running the test in Miri.
The text was updated successfully, but these errors were encountered: