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
This piece of code in release mode has weird behavior when comparing 2 pointers twice. This behavior happens only in release mode and does appear on stable.
It looks like a LLVM optimization to me, @eddyb thinks it "might be an accidental optimization"
fnfoo(_:i32) -> i32{1}fnbar(_:i32) -> i32{1}fnmain(){let x:fn(i32) -> i32 = foo;let y:fn(i32) -> i32 = bar;if x == y {println!("true")}else{println!("false {:?}", x);}if x == y {println!("true")}else{println!("false {:?}", x);}}
As per the discussion on twitter
This piece of code in release mode has weird behavior when comparing 2 pointers twice. This behavior happens only in release mode and does appear on stable.
It looks like a LLVM optimization to me, @eddyb thinks it "might be an accidental optimization"
play.rust-lang.org link
The text was updated successfully, but these errors were encountered: