Skip to content

Commit bbbac59

Browse files
author
Jonathan Turner
authored
Rollup merge of rust-lang#35475 - shyaamsundhar:patch-1, r=jonathandturner
E0248 New Format
2 parents 0e4e8e9 + a848f11 commit bbbac59

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/librustc_typeck/astconv.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -1590,9 +1590,11 @@ impl<'o, 'gcx: 'tcx, 'tcx> AstConv<'gcx, 'tcx>+'o {
15901590
return self.tcx().types.err;
15911591
}
15921592
_ => {
1593-
span_err!(tcx.sess, span, E0248,
1594-
"found value `{}` used as a type",
1595-
tcx.item_path_str(def.def_id()));
1593+
struct_span_err!(tcx.sess, span, E0248,
1594+
"found value `{}` used as a type",
1595+
tcx.item_path_str(def.def_id()))
1596+
.span_label(span, &format!("value used as a type"))
1597+
.emit();
15961598
return self.tcx().types.err;
15971599
}
15981600
}

src/test/compile-fail/E0248.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ enum Foo {
1313
}
1414

1515
fn do_something(x: Foo::Bar) { } //~ ERROR E0248
16-
16+
//~| NOTE value used as a type
1717
fn main() {
1818
}

0 commit comments

Comments
 (0)