Skip to content

Commit

Permalink
Rollup merge of rust-lang#36056 - birryree:E0194_new_error_format, r=…
Browse files Browse the repository at this point in the history
…jonathandturner

Update E0194 to new error format

Fixes rust-lang#35280 to update E0194 to support new error message format. Part of rust-lang#35233.

A separate Github issue rust-lang#36057 tracks the bonus portion of the original ticket.

r? @jonathandturner
  • Loading branch information
GuillaumeGomez authored Aug 30, 2016
2 parents 5185bd0 + eea03f5 commit 751e4db
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/librustc_typeck/check/wfcheck.rs
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,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

0 comments on commit 751e4db

Please sign in to comment.