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
[NLL] Lifetimes errors in a function can mask later errors in same function #96331
When doing *x = *y; *x = *y; (the same thing twice), you only get the error once. It seems that in the new mode, that 'deduplicating' effect also applies to *x = *y; *z = *y;.
(*x = *y; *y = *z; (last assignment flipped) does produce two errors with and without nll.)
I think based on this, it should be okay to move forward without "fixing" this. Seems like only a diagnostics thing instead of accidently allowing more code.
changed the title [-][NLL] Investigate behavior difference with non-nll for `region-multiple-lifetime-bounds-on-fns-where-clause.rs` test[/-][+][NLL] Lifetimes errors in a function can mask later errors in same function[/+]on May 21, 2022
Activity
marmeladema commentedon Apr 23, 2022
@rustbot label +A-NLL +NLL-diagnostics
m-ou-se commentedon May 17, 2022
Reduced test case:
Rustc output:
Rustc output with
-Z borrowck=mir:It doesn't give an error about the
*z = *y;line.However, if you remove the
*x = *y;line, it doesn't succeed. It then produces the right error:So, this doesn't seem like a case where invalid code is accepted. Just a case where diagnostics are incomplete.
m-ou-se commentedon May 17, 2022
When using two unrelated variables/lifetimes, it does produce both errors:
m-ou-se commentedon May 17, 2022
When doing
*x = *y; *x = *y;(the same thing twice), you only get the error once. It seems that in the new mode, that 'deduplicating' effect also applies to*x = *y; *z = *y;.(
*x = *y; *y = *z;(last assignment flipped) does produce two errors with and without nll.)jackh726 commentedon May 17, 2022
Thanks @m-ou-se for looking at this!
I think based on this, it should be okay to move forward without "fixing" this. Seems like only a diagnostics thing instead of accidently allowing more code.
[-][NLL] Investigate behavior difference with non-nll for `region-multiple-lifetime-bounds-on-fns-where-clause.rs` test[/-][+][NLL] Lifetimes errors in a function can mask later errors in same function[/+]