Skip to content

Commit a6cf011

Browse files
author
Jonathan Turner
authored
Rollup merge of rust-lang#35443 - franleplant:master, r=jonathandturner
Update E0101 and E0102 to new format Part of rust-lang#35233 Fixes rust-lang#35243 Fixes rust-lang#35244 r? @jonathandturner PS: My first contribution
2 parents 7d9ea8b + da86ae2 commit a6cf011

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

src/librustc_typeck/check/writeback.rs

+10-4
Original file line numberDiff line numberDiff line change
@@ -441,13 +441,19 @@ impl<'cx, 'gcx, 'tcx> Resolver<'cx, 'gcx, 'tcx> {
441441
if !self.tcx.sess.has_errors() {
442442
match self.reason {
443443
ResolvingExpr(span) => {
444-
span_err!(self.tcx.sess, span, E0101,
445-
"cannot determine a type for this expression: {}", e);
444+
struct_span_err!(
445+
self.tcx.sess, span, E0101,
446+
"cannot determine a type for this expression: {}", e)
447+
.span_label(span, &format!("cannot resolve type of expression"))
448+
.emit();
446449
}
447450

448451
ResolvingLocal(span) => {
449-
span_err!(self.tcx.sess, span, E0102,
450-
"cannot determine a type for this local variable: {}", e);
452+
struct_span_err!(
453+
self.tcx.sess, span, E0102,
454+
"cannot determine a type for this local variable: {}", e)
455+
.span_label(span, &format!("cannot resolve type of variable"))
456+
.emit();
451457
}
452458

453459
ResolvingPattern(span) => {

src/test/compile-fail/E0101.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,7 @@
99
// except according to those terms.
1010

1111
fn main() {
12-
let x = |_| {}; //~ ERROR E0101
12+
let x = |_| {};
13+
//~^ ERROR E0101
14+
//~| NOTE cannot resolve type of expression
1315
}

src/test/compile-fail/E0102.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,7 @@
99
// except according to those terms.
1010

1111
fn main() {
12-
let x = []; //~ ERROR E0102
12+
let x = [];
13+
//~^ ERROR E0102
14+
//~| NOTE cannot resolve type of variable
1315
}

0 commit comments

Comments
 (0)