Skip to content

Update E0220 error format #36862

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 2, 2016
Merged
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
6 changes: 4 additions & 2 deletions src/librustc_typeck/astconv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1241,10 +1241,12 @@ 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,
struct_span_err!(self.tcx().sess, span, E0220,
"associated type `{}` not found for `{}`",
assoc_name,
ty_param_name);
ty_param_name)
.span_label(span, &format!("associated type `{}` not found", assoc_name))
.emit();
return Err(ErrorReported);
}

Expand Down
5 changes: 3 additions & 2 deletions src/test/compile-fail/E0220.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ trait Trait {
}

type Foo = Trait<F=i32>; //~ ERROR E0220
//~^ ERROR E0191

//~| NOTE associated type `F` not found
//~| ERROR E0191
//~| NOTE missing associated type `Bar` value
fn main() {
}
3 changes: 2 additions & 1 deletion src/test/compile-fail/unboxed-closure-sugar-wrong-trait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ trait Trait {}
fn f<F:Trait(isize) -> isize>(x: F) {}
//~^ ERROR E0244
//~| NOTE expected no type arguments, found 1
//~| ERROR associated type `Output` not found
//~| ERROR E0220
//~| NOTE associated type `Output` not found

fn main() {}
2 changes: 1 addition & 1 deletion src/test/ui/span/type-binding.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ error[E0220]: associated type `Trget` not found for `std::ops::Deref`
--> $DIR/type-binding.rs:16:20
|
16 | fn homura<T: Deref<Trget = i32>>(_: T) {}
| ^^^^^^^^^^^
| ^^^^^^^^^^^ associated type `Trget` not found

error: aborting due to previous error