]> git.lizzy.rs Git - rust.git/commitdiff
Remove primary label for more readable output
authorEsteban Küber <esteban@kuber.com.ar>
Fri, 8 Jun 2018 23:27:07 +0000 (16:27 -0700)
committerEsteban Küber <esteban@kuber.com.ar>
Fri, 8 Jun 2018 23:27:07 +0000 (16:27 -0700)
src/librustc/infer/error_reporting/nice_region_error/static_impl_trait.rs
src/test/ui/impl-trait/static-return-lifetime-infered.rs
src/test/ui/impl-trait/static-return-lifetime-infered.stderr

index dd25edfa31e933216284bb77e2a9defcb4d7fea6..bc6b7453c96e644c2c710e69413ee30a588e72ca 100644 (file)
@@ -35,9 +35,8 @@ pub(super) fn try_report_static_impl_trait(&self) -> Option<ErrorReported> {
                         let return_sp = sub_origin.span();
                         let mut err = self.tcx.sess.struct_span_err(
                             sp,
-                            "can't infer an appropriate lifetime",
+                            "cannot infer an appropriate lifetime",
                         );
-                        err.span_label(sp, "can't infer an appropriate lifetime");
                         err.span_label(
                             return_sp,
                             "this return type evaluates to the `'static` lifetime...",
index 412950d9671a03785d41a69cf13c51ee7937e531..a05c88952828020582ed3eea00bc4ddacc2d5f54 100644 (file)
@@ -16,11 +16,11 @@ impl A {
     fn iter_values_anon(&self) -> impl Iterator<Item=u32> {
         self.x.iter().map(|a| a.0)
     }
-    //~^^^ ERROR can't infer an appropriate lifetime
+    //~^^ ERROR cannot infer an appropriate lifetime
     fn iter_values<'a>(&'a self) -> impl Iterator<Item=u32> {
         self.x.iter().map(|a| a.0)
     }
-    //~^^^ ERROR can't infer an appropriate lifetime
+    //~^^ ERROR cannot infer an appropriate lifetime
 }
 
 fn main() {}
index d115e88453b5545aa5bda23169025ec992134970..06459ef66195b061bf551b239199a65e0391bdea 100644 (file)
@@ -1,10 +1,10 @@
-error: can't infer an appropriate lifetime
+error: cannot infer an appropriate lifetime
   --> $DIR/static-return-lifetime-infered.rs:17:16
    |
 LL |     fn iter_values_anon(&self) -> impl Iterator<Item=u32> {
    |                                   ----------------------- this return type evaluates to the `'static` lifetime...
 LL |         self.x.iter().map(|a| a.0)
-   |         ------ ^^^^ can't infer an appropriate lifetime
+   |         ------ ^^^^
    |         |
    |         ...but this borrow...
    |
@@ -20,13 +20,13 @@ help: you can add a constraint to the return type to make it last less than `'st
 LL |     fn iter_values_anon(&self) -> impl Iterator<Item=u32> + '_ {
    |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-error: can't infer an appropriate lifetime
+error: cannot infer an appropriate lifetime
   --> $DIR/static-return-lifetime-infered.rs:21:16
    |
 LL |     fn iter_values<'a>(&'a self) -> impl Iterator<Item=u32> {
    |                                     ----------------------- this return type evaluates to the `'static` lifetime...
 LL |         self.x.iter().map(|a| a.0)
-   |         ------ ^^^^ can't infer an appropriate lifetime
+   |         ------ ^^^^
    |         |
    |         ...but this borrow...
    |