diff --git a/src/librustc/infer/error_reporting/nice_region_error/static_impl_trait.rs b/src/librustc/infer/error_reporting/nice_region_error/static_impl_trait.rs index dd25edfa31e..bc6b7453c96 100644 --- a/src/librustc/infer/error_reporting/nice_region_error/static_impl_trait.rs +++ b/src/librustc/infer/error_reporting/nice_region_error/static_impl_trait.rs @@ -35,9 +35,8 @@ impl<'a, 'gcx, 'tcx> NiceRegionError<'a, 'gcx, 'tcx> { 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...", diff --git a/src/test/ui/impl-trait/static-return-lifetime-infered.rs b/src/test/ui/impl-trait/static-return-lifetime-infered.rs index 412950d9671..a05c8895282 100644 --- a/src/test/ui/impl-trait/static-return-lifetime-infered.rs +++ b/src/test/ui/impl-trait/static-return-lifetime-infered.rs @@ -16,11 +16,11 @@ impl A { fn iter_values_anon(&self) -> impl Iterator { 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 { self.x.iter().map(|a| a.0) } - //~^^^ ERROR can't infer an appropriate lifetime + //~^^ ERROR cannot infer an appropriate lifetime } fn main() {} diff --git a/src/test/ui/impl-trait/static-return-lifetime-infered.stderr b/src/test/ui/impl-trait/static-return-lifetime-infered.stderr index d115e88453b..06459ef6619 100644 --- a/src/test/ui/impl-trait/static-return-lifetime-infered.stderr +++ b/src/test/ui/impl-trait/static-return-lifetime-infered.stderr @@ -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 { | ----------------------- 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 + '_ { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -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 { | ----------------------- 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... |