-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Label mismatched parameters at the def site for foreign functions.
- Loading branch information
Showing
8 changed files
with
48 additions
and
12 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
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 @@ | ||
extern "C" { | ||
fn foo(x: i32, y: u32, z: i32); | ||
//~^ NOTE function defined here | ||
} | ||
|
||
fn main() { | ||
foo(1i32, 2i32); | ||
//~^ ERROR this function takes 3 arguments but 2 arguments were supplied | ||
//~| NOTE argument #2 of type `u32` is missing | ||
//~| HELP provide the argument | ||
} |
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,19 @@ | ||
error[E0061]: this function takes 3 arguments but 2 arguments were supplied | ||
--> $DIR/param-mismatch-foreign.rs:7:5 | ||
| | ||
LL | foo(1i32, 2i32); | ||
| ^^^ ---- argument #2 of type `u32` is missing | ||
| | ||
note: function defined here | ||
--> $DIR/param-mismatch-foreign.rs:2:8 | ||
| | ||
LL | fn foo(x: i32, y: u32, z: i32); | ||
| ^^^ - | ||
help: provide the argument | ||
| | ||
LL | foo(1i32, /* u32 */, 2i32); | ||
| ~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0061`. |
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