-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[NLL] Lifetimes errors in a function can mask later errors in same function #96331
Comments
@rustbot label +A-NLL +NLL-diagnostics |
Reduced test case: fn b<'a, 'b, 'c>(x: &mut &'a isize, y: &mut &'b isize, z: &mut &'c isize) {
*x = *y;
*z = *y;
} Rustc output:
Rustc output with
It doesn't give an error about the However, if you remove the
So, this doesn't seem like a case where invalid code is accepted. Just a case where diagnostics are incomplete. |
When using two unrelated variables/lifetimes, it does produce both errors:
|
When doing ( |
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. |
region-multiple-lifetime-bounds-on-fns-where-clause.rs
test
For test src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.rs, under NLL, a
lifetime may not live long enough
error is missing.This is a behavior change which should be investigated.
See comment posted by @jackh726 in #96212 (comment)
The text was updated successfully, but these errors were encountered: