Skip to content

Commit

Permalink
Use standard formatting for "rust-call" ABI message
Browse files Browse the repository at this point in the history
Nearly all error messages start with a lowercase letter and don't use
articles - instead they refer to the plural case.
  • Loading branch information
camelid committed Jan 8, 2021
1 parent c8915ee commit 4e3be7c
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
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 @@ -109,7 +109,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
2 changes: 1 addition & 1 deletion src/test/ui/abi/issues/issue-22565-rust-call.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#![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

fn main () {
b(10);
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/abi/issues/issue-22565-rust-call.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
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) {}
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

0 comments on commit 4e3be7c

Please sign in to comment.