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#78961 - CraftSpider:22565, r=oli-obk
Make bad "rust-call" arguments no longer ICE The simplest of bad rust-call definitions will no longer cause an ICE. There is a FIXME added for future work, as I wanted to get this easy fix in before trying to either add a hack or mess with the whole obligation system fixes rust-lang#22565
- Loading branch information
Showing
9 changed files
with
85 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#![feature(unboxed_closures)] | ||
|
||
extern "rust-call" fn b(_i: i32) {} | ||
//~^ ERROR A function with the "rust-call" ABI must take a single non-self argument that is a tuple | ||
|
||
fn main () { | ||
b(10); | ||
} |
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,8 @@ | ||
error: A function with the "rust-call" ABI must take a single non-self argument that is a tuple | ||
--> $DIR/issue-22565-rust-call.rs:3:1 | ||
| | ||
LL | extern "rust-call" fn b(_i: i32) {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to previous error | ||
|
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,9 @@ | ||
// check-pass | ||
#![feature(unboxed_closures)] | ||
|
||
extern "rust-call" fn foo<T>(_: T) {} | ||
|
||
fn main() { | ||
foo(()); | ||
foo((1, 2)); | ||
} |
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 |
---|---|---|
@@ -1,9 +1,21 @@ | ||
error: A function with the "rust-call" ABI must take a single non-self argument that is a tuple | ||
--> $DIR/overloaded-calls-nontuple.rs:11:5 | ||
| | ||
LL | extern "rust-call" fn call_mut(&mut self, z: isize) -> isize { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: A function with the "rust-call" ABI must take a single non-self argument that is a tuple | ||
--> $DIR/overloaded-calls-nontuple.rs:19:5 | ||
| | ||
LL | extern "rust-call" fn call_once(mut self, z: isize) -> isize { self.call_mut(z) } | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error[E0059]: cannot use call notation; the first type parameter for the function trait is neither a tuple nor unit | ||
--> $DIR/overloaded-calls-nontuple.rs:26:10 | ||
--> $DIR/overloaded-calls-nontuple.rs:28:10 | ||
| | ||
LL | drop(s(3)) | ||
| ^^^^ | ||
|
||
error: aborting due to previous error | ||
error: aborting due to 3 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0059`. |