Skip to content

Commit b79e15d

Browse files
committed
Update E0191 to the new error format
1 parent 4c02363 commit b79e15d

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

src/librustc_typeck/astconv.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -1194,10 +1194,13 @@ impl<'o, 'gcx: 'tcx, 'tcx> AstConv<'gcx, 'tcx>+'o {
11941194
}
11951195

11961196
for (trait_def_id, name) in associated_types {
1197-
span_err!(tcx.sess, span, E0191,
1197+
struct_span_err!(tcx.sess, span, E0191,
11981198
"the value of the associated type `{}` (from the trait `{}`) must be specified",
11991199
name,
1200-
tcx.item_path_str(trait_def_id));
1200+
tcx.item_path_str(trait_def_id))
1201+
.span_label(span, &format!(
1202+
"missing associated type `{}` value", name))
1203+
.emit();
12011204
}
12021205

12031206
tcx.mk_trait(object.principal, object.bounds)

src/test/compile-fail/E0191.rs

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ trait Trait {
1313
}
1414

1515
type Foo = Trait; //~ ERROR E0191
16+
//~| NOTE missing associated type `Bar` value
1617

1718
fn main() {
1819
}

src/test/compile-fail/associated-type-projection-from-multiple-supertraits.rs

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ fn dent_object<COLOR>(c: BoxCar<Color=COLOR>) {
3737
//~| ERROR the value of the associated type `Color` (from the trait `Vehicle`) must be specified
3838
//~| NOTE could derive from `Vehicle`
3939
//~| NOTE could derive from `Box`
40+
//~| NOTE missing associated type `Color` value
4041
}
4142

4243
fn paint<C:BoxCar>(c: C, d: C::Color) {

0 commit comments

Comments
 (0)