Skip to content

Commit dcd46bf

Browse files
authored
Rollup merge of #80809 - camelid:rust-call-abi-msg, r=lcnr
Use standard formatting for "rust-call" ABI message Nearly all error messages start with a lowercase letter and don't use articles - instead they refer to the plural case.
2 parents 26d451f + 6488aec commit dcd46bf

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

compiler/rustc_typeck/src/check/check.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ pub(super) fn check_fn<'a, 'tcx>(
113113
};
114114

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

src/test/ui/abi/issues/issue-22565-rust-call.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
#![feature(unboxed_closures)]
22

33
extern "rust-call" fn b(_i: i32) {}
4-
//~^ ERROR A function with the "rust-call" ABI must take a single non-self argument that is a tuple
4+
//~^ ERROR functions with the "rust-call" ABI must take a single non-self argument that is a tuple
55

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

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

1313
struct Foo;
1414

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

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

2525
fn main () {

src/test/ui/abi/issues/issue-22565-rust-call.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
error: A function with the "rust-call" ABI must take a single non-self argument that is a tuple
1+
error: functions with the "rust-call" ABI must take a single non-self argument that is a tuple
22
--> $DIR/issue-22565-rust-call.rs:3:1
33
|
44
LL | extern "rust-call" fn b(_i: i32) {}
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66

7-
error: A function with the "rust-call" ABI must take a single non-self argument that is a tuple
7+
error: functions with the "rust-call" ABI must take a single non-self argument that is a tuple
88
--> $DIR/issue-22565-rust-call.rs:9:5
99
|
1010
LL | extern "rust-call" fn b() {}
1111
| ^^^^^^^^^^^^^^^^^^^^^^^^^
1212

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

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

src/test/ui/overloaded-calls-nontuple.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ impl FnMut<isize> for S {
1111
extern "rust-call" fn call_mut(&mut self, z: isize) -> isize {
1212
self.x + self.y + z
1313
}
14-
//~^^^ ERROR A function with the "rust-call" ABI must take a single non-self argument
14+
//~^^^ ERROR functions with the "rust-call" ABI must take a single non-self argument
1515
}
1616

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

2323
fn main() {

src/test/ui/overloaded-calls-nontuple.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
error: A function with the "rust-call" ABI must take a single non-self argument that is a tuple
1+
error: functions with the "rust-call" ABI must take a single non-self argument that is a tuple
22
--> $DIR/overloaded-calls-nontuple.rs:11:5
33
|
44
LL | extern "rust-call" fn call_mut(&mut self, z: isize) -> isize {
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66

7-
error: A function with the "rust-call" ABI must take a single non-self argument that is a tuple
7+
error: functions with the "rust-call" ABI must take a single non-self argument that is a tuple
88
--> $DIR/overloaded-calls-nontuple.rs:19:5
99
|
1010
LL | extern "rust-call" fn call_once(mut self, z: isize) -> isize { self.call_mut(z) }

0 commit comments

Comments
 (0)