-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Diagnose lifetime/label shadowing during late resolution #95781
Conversation
Some changes occurred in src/tools/rustfmt. |
This comment has been minimized.
This comment has been minimized.
5530621
to
2f870a2
Compare
This comment was marked as resolved.
This comment was marked as resolved.
71f7aef
to
895f2c8
Compare
This comment was marked as resolved.
This comment was marked as resolved.
895f2c8
to
b8ce429
Compare
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit b8ce429 with merge fe38d6b31dddd83fb3fab1d2f1b764ffeadaffd8... |
☀️ Try build successful - checks-actions |
Queued fe38d6b31dddd83fb3fab1d2f1b764ffeadaffd8 with parent 1ec2c13, future comparison URL. |
Finished benchmarking commit (fe38d6b31dddd83fb3fab1d2f1b764ffeadaffd8): comparison url. Summary:
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never Footnotes |
I think we should remove these silly checks entirely. They were introduced long time ago in case some new language features appear and require this space. Could you prepare a PR that simply removes these conflicts so we can redirect it to the lang team? |
Blocked on #96296. |
…trochenkov Remove label/lifetime shadowing warnings This PR removes some pre-1.0 shadowing warnings for labels and lifetimes. The current behaviour of the compiler is to warn * labels that shadow unrelated labels in the same function --> removed ```rust 'a: loop {} 'a: loop {} // STOP WARNING ``` * labels that shadow enclosing labels --> kept, but only if shadowing is hygienic ```rust 'a: loop { 'a: loop {} // KEEP WARNING } ``` * labels that shadow lifetime --> removed ```rust fn foo<'a>() { 'a: loop {} // STOP WARNING } ``` * lifetimes that shadow labels --> removed ```rust 'a: loop { let b = Box::new(|x: &i8| *x) as Box<dyn for <'a> Fn(&'a i8) -> i8>; // STOP WARNING } ``` * lifetimes that shadow lifetimes --> kept ```rust fn foo<'a>() { let b = Box::new(|x: &i8| *x) as Box<dyn for <'a> Fn(&'a i8) -> i8>; // KEEP WARNING } ``` Closes rust-lang#31745. ----- From `@petrochenkov` in rust-lang#95781 (comment) > I think we should remove these silly checks entirely. > They were introduced long time ago in case some new language features appear and require this space. > Now we have another mechanism for such language changes - editions, and if "lifetimes in expressions" or something like that needs to be introduced it could be introduced as an edition change. > However, there was no plans to introduce anything like for years, so it's unlikely that even the edition mechanism will be necessary. r? rust-lang/lang
Superseded by #96296. |
The current diagnostic is not hygienic. This PR proposes to make it hygienic.
Please advise on the right choice of normalization for it to make sense.
r? @petrochenkov