Remove kw::Empty uses from rustc_middle.#138926
Merged
bors merged 2 commits intorust-lang:masterfrom Mar 27, 2025
Merged
Conversation
lcnr
reviewed
Mar 25, 2025
Contributor
Author
|
I am in the process of disallowing empty lifetime names in HIR (in favour of Asserting non-emptiness is a slippery slope. There are quite a lot of places where you could insert assertions. In general I am removing |
There are several places in `rustc_middle` that check for an empty lifetime name. These checks appear to be totally unnecessary, because empty lifetime names aren't produced here. (Empty lifetime names *are* possible in `hir::Lifetime`. Perhaps there was some confusion between it and the `rustc_middle` types?) This commit removes the `kw::Empty` checks.
Contributor
Author
|
#138965 is the PR removing kw::Empty from HIR lifetimes. |
Much like the ones in the previous commit.
01ec436 to
5a6ed74
Compare
Contributor
|
thank you for cleaning this up :3 @bors r+ rollup |
Collaborator
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Mar 27, 2025
Rollup of 7 pull requests Successful merges: - rust-lang#138844 (expand: Leave traces when expanding `cfg` attributes) - rust-lang#138926 (Remove `kw::Empty` uses from `rustc_middle`.) - rust-lang#138989 (Clean up a few things in rustc_hir_analysis::check::region) - rust-lang#138999 (Report compiletest pass mode if forced) - rust-lang#139014 (Improve suggest construct with literal syntax instead of calling) - rust-lang#139015 (Remove unneeded LLVM CI test assertions) - rust-lang#139016 (Add job duration changes to post-merge analysis report) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Mar 27, 2025
Rollup merge of rust-lang#138926 - nnethercote:less-kw-Empty-rustc_middle, r=lcnr Remove `kw::Empty` uses from `rustc_middle`. There are several places in `rustc_middle` that check for an empty lifetime name. These checks appear to be totally unnecessary, because empty lifetime names aren't produced here. (Empty lifetime names *are* possible in `hir::Lifetime`. Perhaps there was some confusion between it and the `rustc_middle` types?) This commit removes the `kw::Empty` checks. r? `@lcnr`
Contributor
Author
|
BTW, this helped with #137978. |
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.
There are several places in
rustc_middlethat check for an empty lifetime name. These checks appear to be totally unnecessary, because empty lifetime names aren't produced here. (Empty lifetime names are possible inhir::Lifetime. Perhaps there was some confusion between it and therustc_middletypes?)This commit removes the
kw::Emptychecks.r? @lcnr