Skip to content

Commit eb9db9f

Browse files
author
Jonathan Turner
authored
Rollup merge of rust-lang#35412 - chamoysvoice:e0220, r=jonathandturner
Update E0220 message to new format Part of rust-lang#35233 . Fixes rust-lang#35385. r? @jonathandturner Should it keep E0191?
2 parents f40b2ff + 0e13b63 commit eb9db9f

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/librustc_typeck/astconv.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1273,10 +1273,14 @@ impl<'o, 'gcx: 'tcx, 'tcx> AstConv<'gcx, 'tcx>+'o {
12731273
-> Result<ty::PolyTraitRef<'tcx>, ErrorReported>
12741274
{
12751275
if bounds.is_empty() {
1276-
span_err!(self.tcx().sess, span, E0220,
1277-
"associated type `{}` not found for `{}`",
1278-
assoc_name,
1279-
ty_param_name);
1276+
struct_span_err!(self.tcx().sess, span, E0220,
1277+
"associated type `{}` not found for `{}`",
1278+
assoc_name,
1279+
ty_param_name)
1280+
.span_label(span, &format!("associated `{}` not found in `{}`",
1281+
assoc_name,
1282+
ty_param_name))
1283+
.emit();
12801284
return Err(ErrorReported);
12811285
}
12821286

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

1819
fn main() {

0 commit comments

Comments
 (0)