Compute lifetimes in scope at diagnostic time#97312
Merged
bors merged 3 commits intorust-lang:masterfrom Jun 6, 2022
Merged
Conversation
Contributor
|
(rust-highfive has picked a reviewer for you, use r? to override) |
9a1f481 to
413e606
Compare
Collaborator
|
☔ The latest upstream changes (presumably #97694) made this pull request unmergeable. Please resolve the merge conflicts. |
413e606 to
2ee829d
Compare
Contributor
Author
|
I wonder if we shouldn't just remove this query and always suggest named lifetimes. |
2ee829d to
373ffd2
Compare
Contributor
Author
|
I added 2 commits to remove the |
373ffd2 to
f71ad2f
Compare
Contributor
|
This looks good. @bors r+ |
Collaborator
|
📌 Commit f71ad2f has been approved by |
klensy
reviewed
Jun 5, 2022
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jun 6, 2022
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.