diff options
| author | William Lee <wlee@mochify.com> | 2016-08-27 12:23:19 -0400 |
|---|---|---|
| committer | William Lee <wlee@mochify.com> | 2016-08-27 12:23:19 -0400 |
| commit | eea03f5caab3ca6aa6789cce3d8e699fb7ac1404 (patch) | |
| tree | cfcbb923f6e08da79b1fb43d1ba3bf6e4824f717 /src | |
| parent | f0bab98695f0a4877daabad9a5b0ba3e66121392 (diff) | |
| download | rust-eea03f5caab3ca6aa6789cce3d8e699fb7ac1404.tar.gz rust-eea03f5caab3ca6aa6789cce3d8e699fb7ac1404.zip | |
Fixes #35280 to update E0194 to support new error message format. Part of #35233.
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc_typeck/check/wfcheck.rs | 6 | ||||
| -rw-r--r-- | src/test/compile-fail/E0194.rs | 4 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/librustc_typeck/check/wfcheck.rs b/src/librustc_typeck/check/wfcheck.rs index e2080906ca2..0073506a112 100644 --- a/src/librustc_typeck/check/wfcheck.rs +++ b/src/librustc_typeck/check/wfcheck.rs @@ -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(); } diff --git a/src/test/compile-fail/E0194.rs b/src/test/compile-fail/E0194.rs index 96b3062cacb..fa94c88328a 100644 --- a/src/test/compile-fail/E0194.rs +++ b/src/test/compile-fail/E0194.rs @@ -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() { |
