Skip to content

Commit 77a2824

Browse files
committed
New format for E0221
Issue #35386
1 parent f013914 commit 77a2824

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/librustc_typeck/astconv.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1285,6 +1285,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> AstConv<'gcx, 'tcx>+'o {
12851285
"ambiguous associated type `{}` in bounds of `{}`",
12861286
assoc_name,
12871287
ty_param_name);
1288+
err.span_label(span, &format!("ambiguous associated type `{}`", assoc_name));
12881289

12891290
for bound in &bounds {
12901291
span_note!(&mut err, span,

src/test/compile-fail/E0221.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@ trait Foo {
1818
trait Bar : Foo {
1919
type A: T2;
2020
fn do_something() {
21-
let _: Self::A; //~ ERROR E0221
21+
let _: Self::A;
22+
//~^ ERROR E0221
23+
//~| NOTE ambiguous associated type `A`
24+
//~| NOTE associated type `Self` could derive from `Foo`
25+
//~| NOTE associated type `Self` could derive from `Bar`
2226
}
2327
}
2428

0 commit comments

Comments
 (0)