- 
                Notifications
    You must be signed in to change notification settings 
- Fork 13.9k
          Fix index out of bounds ICE in point_at_expr_source_of_inferred_type
          #108050
        
          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
      
      
    
  
     Merged
                    Changes from all commits
      Commits
    
    
  File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      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
    
  
  
    
              
  
    
      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
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| struct S<A, B>(Option<(A, B)>); | ||
|  | ||
| impl<A, B> S<A, B> { | ||
| fn infer(&self, a: A, b: B) {} | ||
| //~^ NOTE associated function defined here | ||
| //~| NOTE | ||
| //~| NOTE | ||
| } | ||
|  | ||
| fn main() { | ||
| let s = S(None); | ||
| s.infer(0i32); | ||
| //~^ ERROR this method takes 2 arguments but 1 argument was supplied | ||
| //~| NOTE an argument is missing | ||
| //~| HELP provide the argument | ||
| let t: S<u32, _> = s; | ||
| //~^ ERROR mismatched types | ||
| //~| NOTE expected `S<u32, _>`, found `S<i32, _>` | ||
| //~| NOTE expected due to this | ||
| //~| NOTE expected struct `S<u32, _>` | ||
| } | ||
  
    
      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
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| error[E0061]: this method takes 2 arguments but 1 argument was supplied | ||
| --> $DIR/point-at-inference-4.rs:12:7 | ||
| | | ||
| LL | s.infer(0i32); | ||
| | ^^^^^------ an argument is missing | ||
| | | ||
| note: associated function defined here | ||
| --> $DIR/point-at-inference-4.rs:4:8 | ||
| | | ||
| LL | fn infer(&self, a: A, b: B) {} | ||
| | ^^^^^ ---- ---- | ||
| help: provide the argument | ||
| | | ||
| LL | s.infer(0i32, /* b */); | ||
| | ~~~~~~~~~~~~~~~ | ||
|  | ||
| error[E0308]: mismatched types | ||
| --> $DIR/point-at-inference-4.rs:16:24 | ||
| | | ||
| LL | let t: S<u32, _> = s; | ||
| | --------- ^ expected `S<u32, _>`, found `S<i32, _>` | ||
| | | | ||
| | expected due to this | ||
| | | ||
| = note: expected struct `S<u32, _>` | ||
| found struct `S<i32, _>` | ||
|  | ||
| error: aborting due to 2 previous errors | ||
|  | ||
| Some errors have detailed explanations: E0061, E0308. | ||
| For more information about an error, try `rustc --explain E0061`. | 
  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.
  
    
  
    
Uh oh!
There was an error while loading. Please reload this page.