Skip to content

Commit eea03f5

Browse files
committed
Fixes #35280 to update E0194 to support new error message format. Part of #35233.
1 parent f0bab98 commit eea03f5

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/librustc_typeck/check/wfcheck.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,9 @@ fn error_392<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>, span: Span, param_name: ast::N
658658
}
659659

660660
fn error_194(tcx: TyCtxt, span: Span, name: ast::Name) {
661-
span_err!(tcx.sess, span, E0194,
661+
struct_span_err!(tcx.sess, span, E0194,
662662
"type parameter `{}` shadows another type parameter of the same name",
663-
name);
663+
name)
664+
.span_label(span, &format!("`{}` shadows another type parameter", name))
665+
.emit();
664666
}

src/test/compile-fail/E0194.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010

1111
trait Foo<T> {
1212
fn do_something(&self) -> T;
13-
fn do_something_else<T: Clone>(&self, bar: T); //~ ERROR E0194
13+
fn do_something_else<T: Clone>(&self, bar: T);
14+
//~^ ERROR E0194
15+
//~| NOTE `T` shadows another type parameter
1416
}
1517

1618
fn main() {

0 commit comments

Comments
 (0)