From 3092ac40b617ec26dc03cd56558267be03c25cbd Mon Sep 17 00:00:00 2001 From: Cengiz Can Date: Tue, 18 Apr 2017 21:42:55 +0300 Subject: [PATCH] change note for patterns --- src/librustc/traits/error_reporting.rs | 2 +- src/test/compile-fail/issue-12187-1.rs | 2 +- src/test/compile-fail/issue-12187-2.rs | 2 +- .../ui/type-check/cannot_infer_local_or_vec_in_tuples.stderr | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/librustc/traits/error_reporting.rs b/src/librustc/traits/error_reporting.rs index 8a8a5ef3e3afb..71dff3b2bb94d 100644 --- a/src/librustc/traits/error_reporting.rs +++ b/src/librustc/traits/error_reporting.rs @@ -940,7 +940,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> { if let Some(simple_name) = pattern.simple_name() { labels.push((pattern.span, format!("consider giving `{}` a type", simple_name))); } else { - labels.push((pattern.span, format!("consider giving a type to pattern"))); + labels.push((pattern.span, format!("consider giving the pattern a type"))); } } diff --git a/src/test/compile-fail/issue-12187-1.rs b/src/test/compile-fail/issue-12187-1.rs index 6aeb9442c40ed..a79021d3cd5d2 100644 --- a/src/test/compile-fail/issue-12187-1.rs +++ b/src/test/compile-fail/issue-12187-1.rs @@ -16,5 +16,5 @@ fn main() { let &v = new(); //~^ ERROR type annotations needed [E0282] //~| NOTE cannot infer type for `_` - //~| NOTE consider giving a type to pattern + //~| NOTE consider giving the pattern a type } diff --git a/src/test/compile-fail/issue-12187-2.rs b/src/test/compile-fail/issue-12187-2.rs index d52ed06c4085d..38b3c5d4e9a64 100644 --- a/src/test/compile-fail/issue-12187-2.rs +++ b/src/test/compile-fail/issue-12187-2.rs @@ -16,5 +16,5 @@ fn main() { let &v = new(); //~^ ERROR type annotations needed [E0282] //~| NOTE cannot infer type for `_` - //~| NOTE consider giving a type to pattern + //~| NOTE consider giving the pattern a type } diff --git a/src/test/ui/type-check/cannot_infer_local_or_vec_in_tuples.stderr b/src/test/ui/type-check/cannot_infer_local_or_vec_in_tuples.stderr index 3431a1d5bb92a..ccffadebe9ee2 100644 --- a/src/test/ui/type-check/cannot_infer_local_or_vec_in_tuples.stderr +++ b/src/test/ui/type-check/cannot_infer_local_or_vec_in_tuples.stderr @@ -4,7 +4,7 @@ error[E0282]: type annotations needed 12 | let (x, ) = (vec![], ); | ----- ^^^^^^ cannot infer type for `T` | | - | consider giving a type to pattern + | consider giving the pattern a type | = note: this error originates in a macro outside of the current crate