Skip to content

Commit

Permalink
change note for patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
Cengiz Can committed Apr 18, 2017
1 parent 8b45a21 commit 3092ac4
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/librustc/traits/error_reporting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")));
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail/issue-12187-1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
2 changes: 1 addition & 1 deletion src/test/compile-fail/issue-12187-2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 3092ac4

Please sign in to comment.