Skip to content

Commit

Permalink
Update E0191 to the new error format
Browse files Browse the repository at this point in the history
  • Loading branch information
munyari committed Aug 6, 2016
1 parent 4c02363 commit b79e15d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/librustc_typeck/astconv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1194,10 +1194,13 @@ impl<'o, 'gcx: 'tcx, 'tcx> AstConv<'gcx, 'tcx>+'o {
}

for (trait_def_id, name) in associated_types {
span_err!(tcx.sess, span, E0191,
struct_span_err!(tcx.sess, span, E0191,
"the value of the associated type `{}` (from the trait `{}`) must be specified",
name,
tcx.item_path_str(trait_def_id));
tcx.item_path_str(trait_def_id))
.span_label(span, &format!(
"missing associated type `{}` value", name))
.emit();
}

tcx.mk_trait(object.principal, object.bounds)
Expand Down
1 change: 1 addition & 0 deletions src/test/compile-fail/E0191.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ trait Trait {
}

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

fn main() {
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ fn dent_object<COLOR>(c: BoxCar<Color=COLOR>) {
//~| ERROR the value of the associated type `Color` (from the trait `Vehicle`) must be specified
//~| NOTE could derive from `Vehicle`
//~| NOTE could derive from `Box`
//~| NOTE missing associated type `Color` value
}

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

0 comments on commit b79e15d

Please sign in to comment.