Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use standard formatting for "rust-call" ABI message #80809

Merged
merged 1 commit into from
Jan 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/rustc_typeck/src/check/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ pub(super) fn check_fn<'a, 'tcx>(
};

if let Some(header) = item {
tcx.sess.span_err(header.span, "A function with the \"rust-call\" ABI must take a single non-self argument that is a tuple")
tcx.sess.span_err(header.span, "functions with the \"rust-call\" ABI must take a single non-self argument that is a tuple")
}
};

Expand Down
8 changes: 4 additions & 4 deletions src/test/ui/abi/issues/issue-22565-rust-call.rs
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
#![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
//~^ ERROR functions with the "rust-call" ABI must take a single non-self argument that is a tuple

trait Tr {
extern "rust-call" fn a();

extern "rust-call" fn b() {}
//~^ ERROR A function with the "rust-call" ABI must take a single non-self argument
//~^ ERROR functions with the "rust-call" ABI must take a single non-self argument
}

struct Foo;

impl Foo {
extern "rust-call" fn bar() {}
//~^ ERROR A function with the "rust-call" ABI must take a single non-self argument
//~^ ERROR functions with the "rust-call" ABI must take a single non-self argument
}

impl Tr for Foo {
extern "rust-call" fn a() {}
//~^ ERROR A function with the "rust-call" ABI must take a single non-self argument
//~^ ERROR functions with the "rust-call" ABI must take a single non-self argument
}

fn main () {
Expand Down
8 changes: 4 additions & 4 deletions src/test/ui/abi/issues/issue-22565-rust-call.stderr
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
error: A function with the "rust-call" ABI must take a single non-self argument that is a tuple
error: functions 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: A function with the "rust-call" ABI must take a single non-self argument that is a tuple
error: functions with the "rust-call" ABI must take a single non-self argument that is a tuple
--> $DIR/issue-22565-rust-call.rs:9:5
|
LL | extern "rust-call" fn b() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^

error: A function with the "rust-call" ABI must take a single non-self argument that is a tuple
error: functions with the "rust-call" ABI must take a single non-self argument that is a tuple
--> $DIR/issue-22565-rust-call.rs:16:5
|
LL | extern "rust-call" fn bar() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: A function with the "rust-call" ABI must take a single non-self argument that is a tuple
error: functions with the "rust-call" ABI must take a single non-self argument that is a tuple
--> $DIR/issue-22565-rust-call.rs:21:5
|
LL | extern "rust-call" fn a() {}
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/overloaded-calls-nontuple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ impl FnMut<isize> for S {
extern "rust-call" fn call_mut(&mut self, z: isize) -> isize {
self.x + self.y + z
}
//~^^^ ERROR A function with the "rust-call" ABI must take a single non-self argument
//~^^^ ERROR functions with the "rust-call" ABI must take a single non-self argument
}

impl FnOnce<isize> for S {
type Output = isize;
extern "rust-call" fn call_once(mut self, z: isize) -> isize { self.call_mut(z) }
//~^ ERROR A function with the "rust-call" ABI must take a single non-self argument
//~^ ERROR functions with the "rust-call" ABI must take a single non-self argument
}

fn main() {
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/overloaded-calls-nontuple.stderr
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
error: A function with the "rust-call" ABI must take a single non-self argument that is a tuple
error: functions 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
error: functions 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) }
Expand Down