Skip to content

Commit 1b324b0

Browse files
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 36335a1 + 1c37892 commit 1b324b0

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/librustc_typeck/astconv.rs

+7-4
Original file line numberDiff line numberDiff line change
@@ -1285,10 +1285,13 @@ impl<'o, 'gcx: 'tcx, 'tcx> AstConv<'gcx, 'tcx>+'o {
12851285
-> Result<ty::PolyTraitRef<'tcx>, ErrorReported>
12861286
{
12871287
if bounds.is_empty() {
1288-
span_err!(self.tcx().sess, span, E0220,
1289-
"associated type `{}` not found for `{}`",
1290-
assoc_name,
1291-
ty_param_name);
1288+
struct_span_err!(self.tcx().sess, span, E0220,
1289+
"associated type `{}` not found for `{}`",
1290+
assoc_name,
1291+
ty_param_name)
1292+
.span_label(span, &format!("associated type `{}` not found",
1293+
assoc_name))
1294+
.emit();
12921295
return Err(ErrorReported);
12931296
}
12941297

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

1819
fn main() {

0 commit comments

Comments
 (0)