-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #124227 - compiler-errors:hack-check-method-res, r=este…
…bank Make sure that the method resolution matches in `note_source_of_type_mismatch_constraint` `note_source_of_type_mismatch_constraint` is a pile of hacks that I implemented to cover up another pile of hacks. It does a bunch of re-confirming methods, but it wasn't previously checking that the methods it was looking (back) up were equal to the methods we previously had. This PR adds those checks. Fixes #118185
- Loading branch information
Showing
4 changed files
with
46 additions
and
35 deletions.
There are no files selected for viewing
This file contains 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 was deleted.
Oops, something went wrong.
5 changes: 2 additions & 3 deletions
5
tests/crashes/118185-2.rs → ...hod-lookup-returns-sig-with-fewer-args.rs
This file contains 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
17 changes: 17 additions & 0 deletions
17
tests/ui/mismatched_types/diagnostic-method-lookup-returns-sig-with-fewer-args.stderr
This file contains 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,17 @@ | ||
error[E0308]: mismatched types | ||
--> $DIR/diagnostic-method-lookup-returns-sig-with-fewer-args.rs:4:16 | ||
| | ||
LL | target.get(10.0); // (used to crash here) | ||
| --- ^^^^ expected `i32`, found floating-point number | ||
| | | ||
| arguments to this method are incorrect | ||
| | ||
note: method defined here | ||
--> $DIR/diagnostic-method-lookup-returns-sig-with-fewer-args.rs:22:12 | ||
| | ||
LL | pub fn get(&self, data: i32) { | ||
| ^^^ --------- | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0308`. |