- 
                Notifications
    You must be signed in to change notification settings 
- Fork 13.9k
          Make sure that args are compatible in resolve_associated_item
          #128171
        
          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
          
     Merged
      
      
    Conversation
  
    
      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
    
  
  
    
    | r? @oli-obk | 
    
  bors 
      added a commit
        to rust-lang-ci/rust
      that referenced
      this pull request
    
      Jul 25, 2024 
    
    
      
  
    
      
    
  
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#121364 (Implement lint against ambiguous negative literals) - rust-lang#127300 (Fix connect timeout for non-linux targets, read readiness of socket connection, Read readiness to detect errors. `Fixes rust-lang#127018`) - rust-lang#128138 (`#[naked]`: use an allowlist for allowed options on `asm!` in naked functions) - rust-lang#128158 (std: unsafe-wrap personality::gcc) - rust-lang#128171 (Make sure that args are compatible in `resolve_associated_item`) - rust-lang#128172 (Don't ICE if HIR and middle types disagree in borrowck error reporting) - rust-lang#128173 (Remove crashes for misuses of intrinsics) r? `@ghost` `@rustbot` modify labels: rollup
    
  matthiaskrgr 
      added a commit
        to matthiaskrgr/rust
      that referenced
      this pull request
    
      Aug 8, 2024 
    
    
      
  
    
      
    
  
…ir, r=davidtwco Make `validate_mir` ensure the final MIR for all bodies A lot of the crashes tests use `-Zpolymorphize` or `-Zdump-mir` for their side effect of computing the `optimized_mir` for all bodies, which will uncover bugs with late MIR passes like the inliner. I don't like having all these tests depend on `-Zpolymorphize` (or other hacky ways) for no reason, so this PR extends the `-Zvalidate-mir` flag to ensure `optimized_mir`/`mir_for_ctfe` for all body owners during the analysis phase. Two thoughts: 1. This could be moved later in the compilation pipeline I guess? I don't really think it matters, though. 1. This could alternatively be expressed using a new flag, though I don't necessarily see much value in separating these. For example, rust-lang#128171 could have used this flag, in the `tests/ui/polymorphization/inline-incorrect-early-bound.rs`. r? mir
    
  matthiaskrgr 
      added a commit
        to matthiaskrgr/rust
      that referenced
      this pull request
    
      Aug 8, 2024 
    
    
      
  
    
      
    
  
…ir, r=davidtwco Make `validate_mir` ensure the final MIR for all bodies A lot of the crashes tests use `-Zpolymorphize` or `-Zdump-mir` for their side effect of computing the `optimized_mir` for all bodies, which will uncover bugs with late MIR passes like the inliner. I don't like having all these tests depend on `-Zpolymorphize` (or other hacky ways) for no reason, so this PR extends the `-Zvalidate-mir` flag to ensure `optimized_mir`/`mir_for_ctfe` for all body owners during the analysis phase. Two thoughts: 1. This could be moved later in the compilation pipeline I guess? I don't really think it matters, though. 1. This could alternatively be expressed using a new flag, though I don't necessarily see much value in separating these. For example, rust-lang#128171 could have used this flag, in the `tests/ui/polymorphization/inline-incorrect-early-bound.rs`. r? mir
    
  rust-timer 
      added a commit
        to rust-lang-ci/rust
      that referenced
      this pull request
    
      Aug 8, 2024 
    
    
      
  
    
      
    
  
Rollup merge of rust-lang#128612 - compiler-errors:validate-mir-opt-mir, r=davidtwco Make `validate_mir` ensure the final MIR for all bodies A lot of the crashes tests use `-Zpolymorphize` or `-Zdump-mir` for their side effect of computing the `optimized_mir` for all bodies, which will uncover bugs with late MIR passes like the inliner. I don't like having all these tests depend on `-Zpolymorphize` (or other hacky ways) for no reason, so this PR extends the `-Zvalidate-mir` flag to ensure `optimized_mir`/`mir_for_ctfe` for all body owners during the analysis phase. Two thoughts: 1. This could be moved later in the compilation pipeline I guess? I don't really think it matters, though. 1. This could alternatively be expressed using a new flag, though I don't necessarily see much value in separating these. For example, rust-lang#128171 could have used this flag, in the `tests/ui/polymorphization/inline-incorrect-early-bound.rs`. r? mir
    
  matthiaskrgr 
      added a commit
        to matthiaskrgr/rust
      that referenced
      this pull request
    
      May 9, 2025 
    
    
      
  
    
      
    
  
…nkov Add regression test for 125877 close: rust-lang#125877 rust-lang#125877 (comment) has been resolved rust-lang#128171
    
  GuillaumeGomez 
      added a commit
        to GuillaumeGomez/rust
      that referenced
      this pull request
    
      May 9, 2025 
    
    
      
  
    
      
    
  
…nkov Add regression test for 125877 close: rust-lang#125877 rust-lang#125877 (comment) has been resolved rust-lang#128171
    
  rust-timer 
      added a commit
        to rust-lang-ci/rust
      that referenced
      this pull request
    
      May 10, 2025 
    
    
      
  
    
      
    
  
Rollup merge of rust-lang#140819 - reddevilmidzy:add-test, r=petrochenkov Add regression test for 125877 close: rust-lang#125877 rust-lang#125877 (comment) has been resolved rust-lang#128171
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
      Labels
      
    S-waiting-on-bors
  Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 
  
    T-compiler
  Relevant to the compiler team, which will review and decide on the PR/issue. 
  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.
  
    
  
    
Implements a similar check to the one that we have in projection for GATs (#102488, #123240), where we check that the args of an impl item are compatible before returning it. This is done in
resolve_assoc_item, which is backingInstance::resolve, so this is conceptually generalizing the check from GATs to methods/assoc consts. This is important to make sure that the inliner will only visit and substitute MIR bodies that are compatible w/ their trait definitions.This shouldn't happen in codegen, but there are a few ways to get the inliner to be invoked (via calls to
optimized_mir) before codegen, namely polymorphization and CTFE.Fixes #121957
Fixes #120792
Fixes #120793
Fixes #121063