]> git.lizzy.rs Git - rust.git/commitdiff
Update E0195 to new error format
authorRahul Sharma <rsconceptx@gmail.com>
Wed, 10 Aug 2016 10:34:11 +0000 (16:04 +0530)
committerRahul Sharma <rsconceptx@gmail.com>
Tue, 23 Aug 2016 16:37:27 +0000 (22:07 +0530)
src/librustc_typeck/check/compare_method.rs
src/test/compile-fail/E0195.rs
src/test/compile-fail/issue-16048.rs

index b971ae02cd0bd27a87905137df7540a80142257b..d5cf45051af5a2405651447f52e2233ad7750f09 100644 (file)
@@ -411,10 +411,11 @@ fn check_region_bounds_on_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;
         }
 
index 0630dfea5e64b4e09d007147be9c4b500d2b9a3b..06dd903b23db83925187cd1b49838c15f8468884 100644 (file)
@@ -16,6 +16,7 @@ trait Trait {
 
 impl Trait for Foo {
     fn bar<'a,'b>(x: &'a str, y: &'b str) { //~ ERROR E0195
+                                            //~^ lifetimes do not match trait
     }
 }
 
index ceac7e968f65c1bceaa43574b75712d3ccd8e7ec..5012556dedddc3c98c3fc1e0a912243f97568a89 100644 (file)
@@ -29,6 +29,7 @@ fn new(buf: &'a mut [u8]) -> 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;
     }
 }