- 
                Notifications
    You must be signed in to change notification settings 
- Fork 13.9k
Perform lifetime resolution on the AST for lowering #91557
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
Conversation
| Some changes occurred in src/tools/rustfmt. | 
cf0a7cf    to
    7a82c55      
    Compare
  
    | Blocked on #91403. | 
7a82c55    to
    fbaff1a      
    Compare
  
    
      
        
              This comment has been minimized.
        
        
      
    
  This comment has been minimized.
312028b    to
    1aed8ce      
    Compare
  
    
      
        
              This comment has been minimized.
        
        
      
    
  This comment has been minimized.
1aed8ce    to
    815a52e      
    Compare
  
    
      
        
              This comment has been minimized.
        
        
      
    
  This comment has been minimized.
      
        
              This comment was marked as resolved.
        
        
      
    
  This comment was marked as resolved.
815a52e    to
    89e9723      
    Compare
  
    
      
        
              This comment has been minimized.
        
        
      
    
  This comment has been minimized.
89e9723    to
    80435dc      
    Compare
  
    
      
        
              This comment has been minimized.
        
        
      
    
  This comment has been minimized.
80435dc    to
    a9e0018      
    Compare
  
    
      
        
              This comment has been minimized.
        
        
      
    
  This comment has been minimized.
a9e0018    to
    ab6b005      
    Compare
  
    
      
        
              This comment has been minimized.
        
        
      
    
  This comment has been minimized.
      
        
              This comment was marked as resolved.
        
        
      
    
  This comment was marked as resolved.
ab6b005    to
    5f1723b      
    Compare
  
    
      
        
              This comment has been minimized.
        
        
      
    
  This comment has been minimized.
      
        
              This comment was marked as resolved.
        
        
      
    
  This comment was marked as resolved.
5f1723b    to
    ac45362      
    Compare
  
    
      
        
              This comment has been minimized.
        
        
      
    
  This comment has been minimized.
cdcc78b    to
    21b6d23      
    Compare
  
    | @bors r=petrochenkov | 
| 📌 Commit 21b6d23 has been approved by  | 
| ☀️ Test successful - checks-actions | 
| Finished benchmarking commit (c95346b): comparison url. Summary: 
 
 If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression Footnotes | 
| This caused a regression on nightly. The beta cutoff is somewhat soonish, so if we can't land a fix by next week we should revert and try again in a new pr | 
| Regression issue: #96540 | 
Lifetime resolution is currently implemented several times. Once during lowering in order to introduce in-band lifetimes, and once in the resolve_lifetimes query. However, due to the global nature of lifetime resolution and how it interferes with hygiene, it is better suited on the AST.
This PR implements a first draft of lifetime resolution on the AST. For now, we specifically target named lifetimes and everything we need to remove lifetime resolution from lowering. Some diagnostics have already been ported, and sometimes made more precise using available hygiene information. Follow-up PRs will address in particular the resolution of anonymous lifetimes on the AST.
We reuse the rib design of the current resolution framework. Specific
LifetimeRibandLifetimeRibKindtypes are introduced. The most important variant isLifetimeRibKind::Generics, which happens each time we encounter something which may introduce generic lifetime parameters. It can be an item or afor<...>binder. TheLifetimeBinderKindspecifies how this rib behaves with respect to in-band lifetimes.r? @petrochenkov