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
{{ message }}
Repository navigation
region-liveness-drop-no-may-dangle.rs compilation failure on MIR borrowck #46267
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.
Activity
KiChjang commentedon Nov 26, 2017
Possibly related to #45537.
nikomatsakis commentedon Nov 28, 2017
@arielb1 can you elaborate on why you think that this test ought to report a compilation error? I don't understand why that is true.
(Among other things, the code does compile today -- i.e., without NLL etc.)
arielb1 commentedon Nov 28, 2017
@nikomatsakis
The test is not supposed to cause a compilation error. The bug is that the test fails to compile with
-Z nll.nikomatsakis commentedon Dec 12, 2017
Fixed
pnkfelix commentedon Jul 28, 2018
Wait a minute: does this test work or not? Has it been reenabled on master yet? Is there a latent bug in NLL still?
matthewjasper commentedon Aug 3, 2018
The test was reenabled in #46320.
pnkfelix commentedon Aug 4, 2018
Thanks @matthewjasper sorry for the noise,