Skip to content

Update E0194 to new error format #36056

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 30, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/librustc_typeck/check/wfcheck.rs
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,9 @@ fn error_392<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>, span: Span, param_name: ast::N
}

fn error_194(tcx: TyCtxt, span: Span, name: ast::Name) {
span_err!(tcx.sess, span, E0194,
struct_span_err!(tcx.sess, span, E0194,
"type parameter `{}` shadows another type parameter of the same name",
name);
name)
.span_label(span, &format!("`{}` shadows another type parameter", name))
.emit();
}
4 changes: 3 additions & 1 deletion src/test/compile-fail/E0194.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@

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

fn main() {
Expand Down