diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2016-08-30 10:39:07 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-08-30 10:39:07 +0200 |
| commit | 751e4db2f4269ade642bb40aab3a4e92327d7558 (patch) | |
| tree | f0748f718b3a248320e5a320d2e251577eea8bdf /src | |
| parent | 5185bd05c9ef4615e89d63ed1874e00edc2e95ca (diff) | |
| parent | eea03f5caab3ca6aa6789cce3d8e699fb7ac1404 (diff) | |
| download | rust-751e4db2f4269ade642bb40aab3a4e92327d7558.tar.gz rust-751e4db2f4269ade642bb40aab3a4e92327d7558.zip | |
Rollup merge of #36056 - birryree:E0194_new_error_format, r=jonathandturner
Update E0194 to new error format Fixes #35280 to update E0194 to support new error message format. Part of #35233. A separate Github issue #36057 tracks the bonus portion of the original ticket. r? @jonathandturner
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 6b6a688bf1d..a236c8baa9f 100644 --- a/src/librustc_typeck/check/wfcheck.rs +++ b/src/librustc_typeck/check/wfcheck.rs @@ -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(); } 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() { |
