change note for patterns

This commit is contained in:
Cengiz Can 2017-04-18 21:42:55 +03:00
parent 8b45a21bd1
commit 3092ac40b6
4 changed files with 4 additions and 4 deletions

View File

@ -940,7 +940,7 @@ pub fn need_type_info(&self, body_id: hir::BodyId, span: Span, ty: Ty<'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")));
}
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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