Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update E0101 and E0102 to new format #35443

Merged
merged 1 commit into from
Aug 7, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions src/librustc_typeck/check/writeback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -441,13 +441,19 @@ impl<'cx, 'gcx, 'tcx> Resolver<'cx, 'gcx, 'tcx> {
if !self.tcx.sess.has_errors() {
match self.reason {
ResolvingExpr(span) => {
span_err!(self.tcx.sess, span, E0101,
"cannot determine a type for this expression: {}", e);
struct_span_err!(
self.tcx.sess, span, E0101,
"cannot determine a type for this expression: {}", e)
.span_label(span, &format!("cannot resolve type of expression"))
.emit();
}

ResolvingLocal(span) => {
span_err!(self.tcx.sess, span, E0102,
"cannot determine a type for this local variable: {}", e);
struct_span_err!(
self.tcx.sess, span, E0102,
"cannot determine a type for this local variable: {}", e)
.span_label(span, &format!("cannot resolve type of variable"))
.emit();
}

ResolvingPattern(span) => {
Expand Down
4 changes: 3 additions & 1 deletion src/test/compile-fail/E0101.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@
// except according to those terms.

fn main() {
let x = |_| {}; //~ ERROR E0101
let x = |_| {};
//~^ ERROR E0101
//~| NOTE cannot resolve type of expression
}
4 changes: 3 additions & 1 deletion src/test/compile-fail/E0102.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@
// except according to those terms.

fn main() {
let x = []; //~ ERROR E0102
let x = [];
//~^ ERROR E0102
//~| NOTE cannot resolve type of variable
}