-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not inline non-simple argument type errors into labels
- Loading branch information
1 parent
b0cd1e1
commit aa1a07f
Showing
6 changed files
with
67 additions
and
16 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 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,11 @@ | ||
#[derive(Copy, Clone)] | ||
struct Wrapper<T>(T); | ||
|
||
fn foo(_: fn(i32), _: Wrapper<i32>) {} | ||
|
||
fn f(_: u32) {} | ||
|
||
fn main() { | ||
let w = Wrapper::<isize>(1isize); | ||
foo(f, w); //~ ERROR arguments to this function are incorrect | ||
} |
29 changes: 29 additions & 0 deletions
29
src/test/ui/argument-suggestions/two-mismatch-notes.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,29 @@ | ||
error[E0308]: arguments to this function are incorrect | ||
--> $DIR/two-mismatch-notes.rs:10:5 | ||
| | ||
LL | foo(f, w); | ||
| ^^^ | ||
| | ||
note: expected `i32`, found `u32` | ||
--> $DIR/two-mismatch-notes.rs:10:9 | ||
| | ||
LL | foo(f, w); | ||
| ^ | ||
= note: expected fn pointer `fn(i32)` | ||
found fn item `fn(u32) {f}` | ||
note: expected `i32`, found `isize` | ||
--> $DIR/two-mismatch-notes.rs:10:12 | ||
| | ||
LL | foo(f, w); | ||
| ^ | ||
= note: expected struct `Wrapper<i32>` | ||
found struct `Wrapper<isize>` | ||
note: function defined here | ||
--> $DIR/two-mismatch-notes.rs:4:4 | ||
| | ||
LL | fn foo(_: fn(i32), _: Wrapper<i32>) {} | ||
| ^^^ ---------- --------------- | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0308`. |
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 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 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