From 4e3be7caff44c171fc0503715a62ab3a8100db53 Mon Sep 17 00:00:00 2001 From: Camelid Date: Thu, 7 Jan 2021 21:21:21 -0800 Subject: [PATCH] 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. --- compiler/rustc_typeck/src/check/check.rs | 2 +- src/test/ui/abi/issues/issue-22565-rust-call.rs | 2 +- src/test/ui/abi/issues/issue-22565-rust-call.stderr | 2 +- src/test/ui/overloaded-calls-nontuple.rs | 4 ++-- src/test/ui/overloaded-calls-nontuple.stderr | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/compiler/rustc_typeck/src/check/check.rs b/compiler/rustc_typeck/src/check/check.rs index 9c60e8933d4db..cdab4e8e38e46 100644 --- a/compiler/rustc_typeck/src/check/check.rs +++ b/compiler/rustc_typeck/src/check/check.rs @@ -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") } }; diff --git a/src/test/ui/abi/issues/issue-22565-rust-call.rs b/src/test/ui/abi/issues/issue-22565-rust-call.rs index 055d959b46e10..78e4f99408c27 100644 --- a/src/test/ui/abi/issues/issue-22565-rust-call.rs +++ b/src/test/ui/abi/issues/issue-22565-rust-call.rs @@ -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); diff --git a/src/test/ui/abi/issues/issue-22565-rust-call.stderr b/src/test/ui/abi/issues/issue-22565-rust-call.stderr index 31fb035eb99af..f1bfe73c57d49 100644 --- a/src/test/ui/abi/issues/issue-22565-rust-call.stderr +++ b/src/test/ui/abi/issues/issue-22565-rust-call.stderr @@ -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) {} diff --git a/src/test/ui/overloaded-calls-nontuple.rs b/src/test/ui/overloaded-calls-nontuple.rs index 76b114c55925b..07d44ff82b133 100644 --- a/src/test/ui/overloaded-calls-nontuple.rs +++ b/src/test/ui/overloaded-calls-nontuple.rs @@ -11,13 +11,13 @@ impl FnMut 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 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() { diff --git a/src/test/ui/overloaded-calls-nontuple.stderr b/src/test/ui/overloaded-calls-nontuple.stderr index bdadb95db2947..8f299bc9434f3 100644 --- a/src/test/ui/overloaded-calls-nontuple.stderr +++ b/src/test/ui/overloaded-calls-nontuple.stderr @@ -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) }