Skip to content

Commit 1c37892

Browse files
committed
Update E0220 message to new format
1 parent b30eff7 commit 1c37892

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/librustc_typeck/astconv.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1267,10 +1267,13 @@ impl<'o, 'gcx: 'tcx, 'tcx> AstConv<'gcx, 'tcx>+'o {
12671267
-> Result<ty::PolyTraitRef<'tcx>, ErrorReported>
12681268
{
12691269
if bounds.is_empty() {
1270-
span_err!(self.tcx().sess, span, E0220,
1271-
"associated type `{}` not found for `{}`",
1272-
assoc_name,
1273-
ty_param_name);
1270+
struct_span_err!(self.tcx().sess, span, E0220,
1271+
"associated type `{}` not found for `{}`",
1272+
assoc_name,
1273+
ty_param_name)
1274+
.span_label(span, &format!("associated type `{}` not found",
1275+
assoc_name))
1276+
.emit();
12741277
return Err(ErrorReported);
12751278
}
12761279

src/test/compile-fail/E0220.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ trait Trait {
1313
}
1414

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

1819
fn main() {

0 commit comments

Comments
 (0)