Closed
Description
Compiling with -Zborrowck-mir does not reveal the problem, but compiling with -Znll does:
error[E0597]: borrowed value does not live long enough (Mir)
--> /home/keith/Workspace/rust/src/test/mir-opt/nll/region-liveness-drop-no-may-dangle.rs:26:51
|
25 | let mut v = [1, 2, 3];
| ----- temporary value created here
26 | let p: Wrap<& /* R1 */ usize> = Wrap { value: &v[0] };
| ^^^^^ temporary value dropped here while still borrowed
|
= note: consider using a `let` binding to increase its lifetime
@arielb1 said that this is due to us having an incorrect MIR borrowck before, and this should really throw a compilation error as seen.
Temporarily disabling this test in order to land my patch at #46100.