-
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
Compute lifetimes in scope at diagnostic time #97312
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
9a1f481
to
413e606
Compare
☔ The latest upstream changes (presumably #97694) made this pull request unmergeable. Please resolve the merge conflicts. |
413e606
to
2ee829d
Compare
I wonder if we shouldn't just remove this query and always suggest named lifetimes. |
2ee829d
to
373ffd2
Compare
I added 2 commits to remove the |
373ffd2
to
f71ad2f
Compare
This looks good. @bors r+ |
📌 Commit f71ad2f has been approved by |
Rollup of 5 pull requests Successful merges: - rust-lang#97312 (Compute lifetimes in scope at diagnostic time) - rust-lang#97495 (Add E0788 for improper #[no_coverage] usage) - rust-lang#97579 (Avoid creating `SmallVec`s in `global_llvm_features`) - rust-lang#97767 (interpret: do not claim UB until we looked more into variadic functions) - rust-lang#97787 (E0432: rust 2018 -> rust 2018 or later in --explain message) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
The set of available lifetimes is currently computed during lifetime resolution on HIR. It is only used for one diagnostic.
In this PR, HIR lifetime resolution just reports whether elided lifetimes are well-defined at the place of use. The diagnostic code is responsible for building a list of lifetime names if elision is not allowed.
This will allow to remove lifetime resolution on HIR eventually.