Skip to content

Commit 0e13b63

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

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/librustc_typeck/astconv.rs

+8-4
Original file line numberDiff line numberDiff line change
@@ -1267,10 +1267,14 @@ 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 `{}` not found in `{}`",
1275+
assoc_name,
1276+
ty_param_name))
1277+
.emit();
12741278
return Err(ErrorReported);
12751279
}
12761280

src/test/compile-fail/E0220.rs

+1
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 `F` not found in `Trait`
1617
//~^ ERROR E0191
1718

1819
fn main() {

0 commit comments

Comments
 (0)