diff options
| author | Rahul Sharma <rsconceptx@gmail.com> | 2016-08-10 16:04:11 +0530 |
|---|---|---|
| committer | Rahul Sharma <rsconceptx@gmail.com> | 2016-08-23 22:07:27 +0530 |
| commit | 5ec6f39a657771447786ef43a79b5b8e6bc329b4 (patch) | |
| tree | 943b9b4d97c45f49a08c567ad9db962dcf6f2596 | |
| parent | f0139140f6a2d1207cb21336b0faca69b5a337b2 (diff) | |
| download | rust-5ec6f39a657771447786ef43a79b5b8e6bc329b4.tar.gz rust-5ec6f39a657771447786ef43a79b5b8e6bc329b4.zip | |
Update E0195 to new error format
| -rw-r--r-- | src/librustc_typeck/check/compare_method.rs | 7 | ||||
| -rw-r--r-- | src/test/compile-fail/E0195.rs | 1 | ||||
| -rw-r--r-- | src/test/compile-fail/issue-16048.rs | 1 |
3 files changed, 6 insertions, 3 deletions
diff --git a/src/librustc_typeck/check/compare_method.rs b/src/librustc_typeck/check/compare_method.rs index b971ae02cd0..d5cf45051af 100644 --- a/src/librustc_typeck/check/compare_method.rs +++ b/src/librustc_typeck/check/compare_method.rs @@ -411,10 +411,11 @@ pub fn compare_impl_method<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>, // are zero. Since I don't quite know how to phrase things at // the moment, give a kind of vague error message. if trait_params.len() != impl_params.len() { - span_err!(ccx.tcx.sess, span, E0195, + struct_span_err!(ccx.tcx.sess, span, E0195, "lifetime parameters or bounds on method `{}` do \ - not match the trait declaration", - impl_m.name); + not match the trait declaration",impl_m.name) + .span_label(span, &format!("lifetimes do not match trait")) + .emit(); return false; } diff --git a/src/test/compile-fail/E0195.rs b/src/test/compile-fail/E0195.rs index 0630dfea5e6..06dd903b23d 100644 --- a/src/test/compile-fail/E0195.rs +++ b/src/test/compile-fail/E0195.rs @@ -16,6 +16,7 @@ struct Foo; impl Trait for Foo { fn bar<'a,'b>(x: &'a str, y: &'b str) { //~ ERROR E0195 + //~^ lifetimes do not match trait } } diff --git a/src/test/compile-fail/issue-16048.rs b/src/test/compile-fail/issue-16048.rs index ceac7e968f6..5012556dedd 100644 --- a/src/test/compile-fail/issue-16048.rs +++ b/src/test/compile-fail/issue-16048.rs @@ -29,6 +29,7 @@ impl<'a> Test<'a> for Foo<'a> { impl<'a> NoLifetime for Foo<'a> { fn get<'p, T : Test<'a>>(&self) -> T { //~^ ERROR E0195 +//~| lifetimes do not match trait return *self as T; } } |
