Skip to content
Closed
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
11 changes: 7 additions & 4 deletions src/librustc_typeck/astconv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1267,10 +1267,13 @@ impl<'o, 'gcx: 'tcx, 'tcx> AstConv<'gcx, 'tcx>+'o {
-> Result<ty::PolyTraitRef<'tcx>, ErrorReported>
{
if bounds.is_empty() {
span_err!(self.tcx().sess, span, E0220,
"associated type `{}` not found for `{}`",
assoc_name,
ty_param_name);
struct_span_err!(self.tcx().sess, span, E0220,
"associated type `{}` not found for `{}`",
assoc_name,
ty_param_name)
.span_label(span, &format!("associated type `{}` not found",
assoc_name))
.emit();
return Err(ErrorReported);
}

Expand Down
1 change: 1 addition & 0 deletions src/test/compile-fail/E0220.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ trait Trait {
}

type Foo = Trait<F=i32>; //~ ERROR E0220
//~| NOTE associated type `F` not found
//~^ ERROR E0191

fn main() {
Expand Down