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
fntest<F>(f:F) -> usizewhereF:FnOnce(usize) -> usize{returnf(22);}pubfnmain(){let y = test(|x| 4* x);assert_eq!(y,88);}
error: Undefined Behavior: constructing invalid value: encountered uninitialized memory, but expected an integer
--> src/main.rs:2:12
|
2 | return f(22);
| ^^^^^ constructing invalid value: encountered uninitialized memory, but expected an integer
|
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
= note: BACKTRACE:
= note: inside `main` error: Undefined Behavior: constructing invalid value: encountered uninitialized memory, but expected an integer
I tried this code:
When I run miri on this with mir-opt-level=3, miri reports UB, maybe some of the mir-opts is a bit broken?
MIRIFLAGS="-Zmir-opt-level=3 -Zmiri-backtrace=full" cargo miri run
The text was updated successfully, but these errors were encountered: