- 
                Notifications
    You must be signed in to change notification settings 
- Fork 13.9k
          Remove kw::Empty uses from rustc_middle.
          #138926
        
          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
  
    Remove kw::Empty uses from rustc_middle.
  
  #138926
              Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That does stem from a confusion. I don't know why hir lifetimes can be empty and ty lifetimes cannot be 😅
I geuss r=me, but is there are way we can assert that there are no lifetimes in the Ty layer? 🤔 maybe in Lifetime::new_[early|late]_param
| 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.
| #138965 is the PR removing kw::Empty from HIR lifetimes. | 
Much like the ones in the previous commit.
01ec436    to
    5a6ed74      
    Compare
  
    | thank you for cleaning this up :3 @bors r+ rollup | 
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
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`
| BTW, this helped with #137978. | 
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