]>
Commit | Line | Data |
---|---|---|
a1dfa0c6 | 1 | error[E0080]: it is undefined behavior to use this value |
f035d41b | 2 | --> $DIR/ub-upvars.rs:5:1 |
0bf4aa26 | 3 | | |
dc9dc135 | 4 | LL | / const BAD_UPVAR: &dyn FnOnce() = &{ |
0bf4aa26 XL |
5 | LL | | let bad_ref: &'static u16 = unsafe { mem::transmute(0usize) }; |
6 | LL | | let another_var = 13; | |
7 | LL | | move || { let _ = bad_ref; let _ = another_var; } | |
8 | LL | | }; | |
74b04a01 | 9 | | |__^ type validation failed: encountered a NULL reference at .<deref>.<dyn-downcast>.<captured-var(bad_ref)> |
0bf4aa26 | 10 | | |
e1599b0c | 11 | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. |
0bf4aa26 XL |
12 | |
13 | error: aborting due to previous error | |
14 | ||
15 | For more information about this error, try `rustc --explain E0080`. |