forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#99646 - compiler-errors:arg-mismatch-single…
…-arg-label, r=estebank Only point out a single function parameter if we have a single arg incompatibility Fixes rust-lang#99635
- Loading branch information
Showing
18 changed files
with
148 additions
and
61 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
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,41 @@ | ||
struct Qux; | ||
|
||
impl Qux { | ||
fn foo( | ||
&self, | ||
a: i32, | ||
b: i32, | ||
c: i32, | ||
d: i32, | ||
e: i32, | ||
f: i32, | ||
g: i32, | ||
h: i32, | ||
i: i32, | ||
j: i32, | ||
k: i32, | ||
l: i32, | ||
) { | ||
} | ||
} | ||
|
||
fn what( | ||
qux: &Qux, | ||
a: i32, | ||
b: i32, | ||
c: i32, | ||
d: i32, | ||
e: i32, | ||
f: &i32, | ||
g: i32, | ||
h: i32, | ||
i: i32, | ||
j: i32, | ||
k: i32, | ||
l: i32, | ||
) { | ||
qux.foo(a, b, c, d, e, f, g, h, i, j, k, l); | ||
//~^ ERROR mismatched types | ||
} | ||
|
||
fn main() {} |
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,24 @@ | ||
error[E0308]: mismatched types | ||
--> $DIR/too-long.rs:37:28 | ||
| | ||
LL | qux.foo(a, b, c, d, e, f, g, h, i, j, k, l); | ||
| --- ^ expected `i32`, found `&i32` | ||
| | | ||
| arguments to this function are incorrect | ||
| | ||
note: associated function defined here | ||
--> $DIR/too-long.rs:4:8 | ||
| | ||
LL | fn foo( | ||
| ^^^ | ||
... | ||
LL | f: i32, | ||
| ------ | ||
help: consider dereferencing the borrow | ||
| | ||
LL | qux.foo(a, b, c, d, e, *f, g, h, i, j, k, l); | ||
| + | ||
|
||
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
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
Oops, something went wrong.