change note for patterns
This commit is contained in:
parent
8b45a21bd1
commit
3092ac40b6
@ -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")));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user