You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So, I've been fuzz testing rustc nightly using a range of generated programs and am digesting the findings. This one stood out to me:
fn main() {
let mut x = 1;
{
let mut y = &mut x;
y = y;
y;
}
x;
}
This currently reports an E0505 on the playground and Rust nightly. However, removing the nop y=y; and its fine. This feels like a bug to me ... thoughts?
The text was updated successfully, but these errors were encountered:
I think this is technically a reborrow (y = &mut *y) rather than a no-op, because the lhs and rhs are both known to be &mut _. Though this might be the first time I've ever seen a reborrow cause fewer programs to compile versus a move!
(amusingly, though, the MIR is simply _2 = _2)
Edit: nope, there's more to it than that. If you explicitly write y = &mut *y, it compiles!
estebank
added
I-nominated
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
T-lang
Relevant to the language team, which will review and decide on the PR/issue.
labels
Aug 20, 2019
Hey Folks,
So, I've been fuzz testing
rustc
nightly using a range of generated programs and am digesting the findings. This one stood out to me:This currently reports an E0505 on the playground and Rust nightly. However, removing the nop
y=y;
and its fine. This feels like a bug to me ... thoughts?The text was updated successfully, but these errors were encountered: