about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2023-01-06 01:11:50 +0000
committerEsteban Küber <esteban@kuber.com.ar>2023-01-30 20:12:21 +0000
commit252c43b42b33dc2bf341afd525d0041c5097d2b1 (patch)
tree859c1fae3c533f50deb8262a15df0dc125d7c054
parent81973a39e05bfc5ddad4b5a54903c2c8fbdfa273 (diff)
downloadrust-252c43b42b33dc2bf341afd525d0041c5097d2b1.tar.gz
rust-252c43b42b33dc2bf341afd525d0041c5097d2b1.zip
Do not mention lifetime names in force trimmed paths
-rw-r--r--compiler/rustc_middle/src/ty/print/pretty.rs4
-rw-r--r--tests/ui/associated-type-bounds/inside-adt.stderr4
-rw-r--r--tests/ui/associated-types/issue-43924.stderr4
-rw-r--r--tests/ui/async-await/issue-98634.rs6
-rw-r--r--tests/ui/async-await/issue-98634.stderr6
-rw-r--r--tests/ui/feature-gates/feature-gate-trivial_bounds.stderr2
-rw-r--r--tests/ui/function-pointer/unsized-ret.stderr2
-rw-r--r--tests/ui/higher-rank-trait-bounds/hang-on-deeply-nested-dyn.stderr4
-rw-r--r--tests/ui/higher-rank-trait-bounds/issue-30786.stderr2
-rw-r--r--tests/ui/impl-trait/dyn-trait-return-should-be-impl-trait.stderr4
-rw-r--r--tests/ui/issues/issue-102964.stderr2
-rw-r--r--tests/ui/issues/issue-19521.stderr4
-rw-r--r--tests/ui/issues/issue-24322.stderr2
-rw-r--r--tests/ui/issues/issue-57362-2.stderr4
-rw-r--r--tests/ui/kindck/kindck-send-object1.stderr2
-rw-r--r--tests/ui/nll/issue-57642-higher-ranked-subtype.stderr8
-rw-r--r--tests/ui/object-pointer-types.stderr4
-rw-r--r--tests/ui/suggestions/issue-101984.stderr2
-rw-r--r--tests/ui/suggestions/remove-as_str.stderr2
-rw-r--r--tests/ui/suggestions/suggest-using-chars.rs4
-rw-r--r--tests/ui/suggestions/suggest-using-chars.stderr8
-rw-r--r--tests/ui/type-alias-impl-trait/issue-98604.rs2
-rw-r--r--tests/ui/type-alias-impl-trait/issue-98604.stderr2
23 files changed, 44 insertions, 40 deletions
diff --git a/compiler/rustc_middle/src/ty/print/pretty.rs b/compiler/rustc_middle/src/ty/print/pretty.rs
index d9d6e65a97a..78f17c7783e 100644
--- a/compiler/rustc_middle/src/ty/print/pretty.rs
+++ b/compiler/rustc_middle/src/ty/print/pretty.rs
@@ -2070,6 +2070,10 @@ impl<'tcx> PrettyPrinter<'tcx> for FmtPrinter<'_, 'tcx> {
             return true;
         }
 
+        if FORCE_TRIMMED_PATH.with(|flag| flag.get()) {
+            return false;
+        }
+
         let identify_regions = self.tcx.sess.opts.unstable_opts.identify_regions;
 
         match *region {
diff --git a/tests/ui/associated-type-bounds/inside-adt.stderr b/tests/ui/associated-type-bounds/inside-adt.stderr
index dbfcfa58063..fa1390a5462 100644
--- a/tests/ui/associated-type-bounds/inside-adt.stderr
+++ b/tests/ui/associated-type-bounds/inside-adt.stderr
@@ -95,7 +95,7 @@ LL | union U1 { f: ManuallyDrop<dyn Iterator<Item: Copy>> }
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
    |
    = help: within `ManuallyDrop<(dyn Iterator<Item = impl Copy> + 'static)>`, the trait `Sized` is not implemented for `(dyn Iterator<Item = impl Copy> + 'static)`
-   = note: required because it appears within the type `ManuallyDrop<(dyn Iterator<Item = impl Copy> + 'static)>`
+   = note: required because it appears within the type `ManuallyDrop<dyn Iterator<Item = impl Copy>>`
    = note: no field of a union may have a dynamically sized type
    = help: change the field's type to have a statically known size
 help: borrowed types always have a statically known size
@@ -114,7 +114,7 @@ LL | union U3 { f: ManuallyDrop<dyn Iterator<Item: 'static>> }
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
    |
    = help: within `ManuallyDrop<(dyn Iterator<Item = impl Sized + 'static> + 'static)>`, the trait `Sized` is not implemented for `(dyn Iterator<Item = impl Sized + 'static> + 'static)`
-   = note: required because it appears within the type `ManuallyDrop<(dyn Iterator<Item = impl Sized + 'static> + 'static)>`
+   = note: required because it appears within the type `ManuallyDrop<dyn Iterator<Item = impl Sized + 'static>>`
    = note: no field of a union may have a dynamically sized type
    = help: change the field's type to have a statically known size
 help: borrowed types always have a statically known size
diff --git a/tests/ui/associated-types/issue-43924.stderr b/tests/ui/associated-types/issue-43924.stderr
index 526f425b21e..9046170d7c9 100644
--- a/tests/ui/associated-types/issue-43924.stderr
+++ b/tests/ui/associated-types/issue-43924.stderr
@@ -10,11 +10,11 @@ note: required by a bound in `Foo::Out`
 LL |     type Out: Default + ToString + ?Sized = dyn ToString;
    |               ^^^^^^^ required by this bound in `Foo::Out`
 
-error[E0599]: no function or associated item named `default` found for trait object `(dyn ToString + 'static)` in the current scope
+error[E0599]: no function or associated item named `default` found for trait object `dyn ToString` in the current scope
   --> $DIR/issue-43924.rs:14:39
    |
 LL |     assert_eq!(<() as Foo<u32>>::Out::default().to_string(), "false");
-   |                                       ^^^^^^^ function or associated item not found in `(dyn ToString + 'static)`
+   |                                       ^^^^^^^ function or associated item not found in `dyn ToString`
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/async-await/issue-98634.rs b/tests/ui/async-await/issue-98634.rs
index b0d38687f01..104b85baa63 100644
--- a/tests/ui/async-await/issue-98634.rs
+++ b/tests/ui/async-await/issue-98634.rs
@@ -43,8 +43,8 @@ impl Runtime {
 fn main() {
     Runtime.block_on(async {
         StructAsync { callback }.await;
-        //~^ ERROR expected `fn() -> impl Future<Output = ()> {callback}` to be a fn item that returns `Pin<Box<(dyn Future<Output = ()> + 'static)>>`, but it returns `impl Future<Output = ()>`
-        //~| ERROR expected `fn() -> impl Future<Output = ()> {callback}` to be a fn item that returns `Pin<Box<(dyn Future<Output = ()> + 'static)>>`, but it returns `impl Future<Output = ()>`
-        //~| ERROR expected `fn() -> impl Future<Output = ()> {callback}` to be a fn item that returns `Pin<Box<(dyn Future<Output = ()> + 'static)>>`, but it returns `impl Future<Output = ()>`
+        //~^ ERROR expected `fn() -> impl Future<Output = ()> {callback}` to be a fn item that returns `Pin<Box<dyn Future<Output = ()>>>`, but it returns `impl Future<Output = ()>`
+        //~| ERROR expected `fn() -> impl Future<Output = ()> {callback}` to be a fn item that returns `Pin<Box<dyn Future<Output = ()>>>`, but it returns `impl Future<Output = ()>`
+        //~| ERROR expected `fn() -> impl Future<Output = ()> {callback}` to be a fn item that returns `Pin<Box<dyn Future<Output = ()>>>`, but it returns `impl Future<Output = ()>`
     });
 }
diff --git a/tests/ui/async-await/issue-98634.stderr b/tests/ui/async-await/issue-98634.stderr
index 85fa04446cc..17e598508e5 100644
--- a/tests/ui/async-await/issue-98634.stderr
+++ b/tests/ui/async-await/issue-98634.stderr
@@ -1,4 +1,4 @@
-error[E0271]: expected `fn() -> impl Future<Output = ()> {callback}` to be a fn item that returns `Pin<Box<(dyn Future<Output = ()> + 'static)>>`, but it returns `impl Future<Output = ()>`
+error[E0271]: expected `fn() -> impl Future<Output = ()> {callback}` to be a fn item that returns `Pin<Box<dyn Future<Output = ()>>>`, but it returns `impl Future<Output = ()>`
   --> $DIR/issue-98634.rs:45:23
    |
 LL |         StructAsync { callback }.await;
@@ -17,7 +17,7 @@ note: required by a bound in `StructAsync`
 LL | pub struct StructAsync<F: Fn() -> Pin<Box<dyn Future<Output = ()>>>> {
    |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `StructAsync`
 
-error[E0271]: expected `fn() -> impl Future<Output = ()> {callback}` to be a fn item that returns `Pin<Box<(dyn Future<Output = ()> + 'static)>>`, but it returns `impl Future<Output = ()>`
+error[E0271]: expected `fn() -> impl Future<Output = ()> {callback}` to be a fn item that returns `Pin<Box<dyn Future<Output = ()>>>`, but it returns `impl Future<Output = ()>`
   --> $DIR/issue-98634.rs:45:9
    |
 LL |         StructAsync { callback }.await;
@@ -36,7 +36,7 @@ note: required by a bound in `StructAsync`
 LL | pub struct StructAsync<F: Fn() -> Pin<Box<dyn Future<Output = ()>>>> {
    |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `StructAsync`
 
-error[E0271]: expected `fn() -> impl Future<Output = ()> {callback}` to be a fn item that returns `Pin<Box<(dyn Future<Output = ()> + 'static)>>`, but it returns `impl Future<Output = ()>`
+error[E0271]: expected `fn() -> impl Future<Output = ()> {callback}` to be a fn item that returns `Pin<Box<dyn Future<Output = ()>>>`, but it returns `impl Future<Output = ()>`
   --> $DIR/issue-98634.rs:45:33
    |
 LL |         StructAsync { callback }.await;
diff --git a/tests/ui/feature-gates/feature-gate-trivial_bounds.stderr b/tests/ui/feature-gates/feature-gate-trivial_bounds.stderr
index 1b87ebd9f20..d2ad372dfbc 100644
--- a/tests/ui/feature-gates/feature-gate-trivial_bounds.stderr
+++ b/tests/ui/feature-gates/feature-gate-trivial_bounds.stderr
@@ -95,7 +95,7 @@ LL | fn unsized_local() where Dst<dyn A>: Sized {
    |                          ^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
    |
    = help: within `Dst<(dyn A + 'static)>`, the trait `Sized` is not implemented for `(dyn A + 'static)`
-note: required because it appears within the type `Dst<(dyn A + 'static)>`
+note: required because it appears within the type `Dst<dyn A>`
   --> $DIR/feature-gate-trivial_bounds.rs:48:8
    |
 LL | struct Dst<X: ?Sized> {
diff --git a/tests/ui/function-pointer/unsized-ret.stderr b/tests/ui/function-pointer/unsized-ret.stderr
index dd00ff103e7..870f1805b58 100644
--- a/tests/ui/function-pointer/unsized-ret.stderr
+++ b/tests/ui/function-pointer/unsized-ret.stderr
@@ -23,7 +23,7 @@ LL |     foo::<for<'a> fn(&'a ()) -> (dyn std::fmt::Display + 'a), _>(None, (&()
    |     required by a bound introduced by this call
    |
    = help: within `for<'a> fn(&'a ()) -> (dyn std::fmt::Display + 'a)`, the trait `for<'a> Sized` is not implemented for `(dyn std::fmt::Display + 'a)`
-   = note: required because it appears within the type `fn(&'a ()) -> (dyn Display + 'a)`
+   = note: required because it appears within the type `fn(&()) -> dyn Display`
 note: required by a bound in `foo`
   --> $DIR/unsized-ret.rs:5:11
    |
diff --git a/tests/ui/higher-rank-trait-bounds/hang-on-deeply-nested-dyn.stderr b/tests/ui/higher-rank-trait-bounds/hang-on-deeply-nested-dyn.stderr
index 173bc47b272..3662cbfb9ba 100644
--- a/tests/ui/higher-rank-trait-bounds/hang-on-deeply-nested-dyn.stderr
+++ b/tests/ui/higher-rank-trait-bounds/hang-on-deeply-nested-dyn.stderr
@@ -11,9 +11,9 @@ LL | |     ),
 LL | | ) {
    | |_- expected `&dyn for<'a> Fn(&'a (dyn for<'a> Fn(&'a (dyn for<'a> Fn(&'a (dyn for<'a> Fn(&'a (dyn for<'a> Fn(&'a (dyn for<'a> Fn(&'a (dyn for<'a> Fn(&'a (dyn for<'a> Fn(&'a (dyn for<'a> Fn(&'a (dyn for<'a> Fn(&'a (dyn for<'a> Fn(&'a (dyn Fn(u32) + 'a)) + 'a)) + 'a)) + 'a)) + 'a)) + 'a)) + 'a)) + 'a)) + 'a)) + 'a)) + 'a))` because of return type
 LL |       f
-   |       ^ expected `&dyn Fn(&'a (dyn Fn(&'a ...) + 'a))`, found `&dyn Fn(u32)`
+   |       ^ expected `&dyn Fn(&dyn Fn(&dyn Fn(&...)))`, found `&dyn Fn(u32)`
    |
-   = note: expected reference `&dyn Fn(&'a (dyn Fn(&'a (dyn Fn(&'a (dyn Fn(&'a (dyn Fn(&'a (dyn Fn(...) + 'a)) + 'a)) + 'a)) + 'a)) + 'a))`
+   = note: expected reference `&dyn Fn(&dyn Fn(&dyn Fn(&dyn Fn(&dyn Fn(&dyn Fn(&dyn Fn(&dyn Fn(&dyn Fn(&dyn Fn(&dyn Fn(&...)))))))))))`
            the full type name has been written to '$TEST_BUILD_DIR/higher-rank-trait-bounds/hang-on-deeply-nested-dyn/hang-on-deeply-nested-dyn.long-type-hash.txt'
               found reference `&dyn Fn(u32)`
 
diff --git a/tests/ui/higher-rank-trait-bounds/issue-30786.stderr b/tests/ui/higher-rank-trait-bounds/issue-30786.stderr
index 67105510573..2ded5ae56cd 100644
--- a/tests/ui/higher-rank-trait-bounds/issue-30786.stderr
+++ b/tests/ui/higher-rank-trait-bounds/issue-30786.stderr
@@ -19,7 +19,7 @@ note: the following trait bounds were not satisfied:
 LL | impl<T> StreamExt for T where for<'a> &'a mut T: Stream {}
    |         ---------     -                          ^^^^^^ unsatisfied trait bound introduced here
 
-error[E0599]: the method `countx` exists for struct `Filter<Map<Repeat, fn(&'a u64) -> &'a u64 {identity::<u64>}>, [closure@issue-30786.rs:129:30]>`, but its trait bounds were not satisfied
+error[E0599]: the method `countx` exists for struct `Filter<Map<Repeat, fn(&u64) -> &u64 {identity::<u64>}>, [closure@issue-30786.rs:129:30]>`, but its trait bounds were not satisfied
   --> $DIR/issue-30786.rs:130:24
    |
 LL | pub struct Filter<S, F> {
diff --git a/tests/ui/impl-trait/dyn-trait-return-should-be-impl-trait.stderr b/tests/ui/impl-trait/dyn-trait-return-should-be-impl-trait.stderr
index f64ba3bf1c4..dc1e40ea560 100644
--- a/tests/ui/impl-trait/dyn-trait-return-should-be-impl-trait.stderr
+++ b/tests/ui/impl-trait/dyn-trait-return-should-be-impl-trait.stderr
@@ -16,7 +16,7 @@ LL | fn fuz() -> (usize, Trait) { (42, Struct) }
    |             doesn't have a size known at compile-time
    |
    = help: within `(usize, (dyn Trait + 'static))`, the trait `Sized` is not implemented for `(dyn Trait + 'static)`
-   = note: required because it appears within the type `(usize, (dyn Trait + 'static))`
+   = note: required because it appears within the type `(usize, dyn Trait)`
    = note: the return type of a function must have a statically known size
 
 error[E0308]: mismatched types
@@ -37,7 +37,7 @@ LL | fn bar() -> (usize, dyn Trait) { (42, Struct) }
    |             doesn't have a size known at compile-time
    |
    = help: within `(usize, (dyn Trait + 'static))`, the trait `Sized` is not implemented for `(dyn Trait + 'static)`
-   = note: required because it appears within the type `(usize, (dyn Trait + 'static))`
+   = note: required because it appears within the type `(usize, dyn Trait)`
    = note: the return type of a function must have a statically known size
 
 error[E0746]: return type cannot have an unboxed trait object
diff --git a/tests/ui/issues/issue-102964.stderr b/tests/ui/issues/issue-102964.stderr
index 0cec4751fb8..c0766480a41 100644
--- a/tests/ui/issues/issue-102964.stderr
+++ b/tests/ui/issues/issue-102964.stderr
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-102964.rs:5:41
    |
 LL | fn bar_function<T>(function: Foo<T>) -> RcFoo<T> {
-   |    ------------                         ^^^^^^^^ expected `Rc<&dyn Fn(&'a T)>`, found `()`
+   |    ------------                         ^^^^^^^^ expected `Rc<&dyn Fn(&T)>`, found `()`
    |    |
    |    implicitly returns `()` as its body has no tail or `return` expression
    |
diff --git a/tests/ui/issues/issue-19521.stderr b/tests/ui/issues/issue-19521.stderr
index b6847cd755c..89936374085 100644
--- a/tests/ui/issues/issue-19521.stderr
+++ b/tests/ui/issues/issue-19521.stderr
@@ -1,8 +1,8 @@
-error[E0599]: no method named `homura` found for reference `&'static str` in the current scope
+error[E0599]: no method named `homura` found for reference `&str` in the current scope
   --> $DIR/issue-19521.rs:2:8
    |
 LL |     "".homura()();
-   |        ^^^^^^ method not found in `&'static str`
+   |        ^^^^^^ method not found in `&str`
 
 error: aborting due to previous error
 
diff --git a/tests/ui/issues/issue-24322.stderr b/tests/ui/issues/issue-24322.stderr
index 583afaead2d..954fd492812 100644
--- a/tests/ui/issues/issue-24322.stderr
+++ b/tests/ui/issues/issue-24322.stderr
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-24322.rs:8:29
    |
 LL |     let x: &fn(&B) -> u32 = &B::func;
-   |            --------------   ^^^^^^^^ expected `&fn(&'a B) -> u32`, found `&fn(&'a B) -> u32 {B::func}`
+   |            --------------   ^^^^^^^^ expected `&fn(&B) -> u32`, found `&fn(&B) -> u32 {B::func}`
    |            |
    |            expected due to this
    |
diff --git a/tests/ui/issues/issue-57362-2.stderr b/tests/ui/issues/issue-57362-2.stderr
index 8dcf7911baf..37beb587d27 100644
--- a/tests/ui/issues/issue-57362-2.stderr
+++ b/tests/ui/issues/issue-57362-2.stderr
@@ -1,8 +1,8 @@
-error[E0599]: the function or associated item `make_g` exists for fn pointer `fn(&'a ())`, but its trait bounds were not satisfied
+error[E0599]: the function or associated item `make_g` exists for fn pointer `fn(&())`, but its trait bounds were not satisfied
   --> $DIR/issue-57362-2.rs:22:25
    |
 LL |     let x = <fn (&())>::make_g();
-   |                         ^^^^^^ function or associated item cannot be called on `fn(&'a ())` due to unsatisfied trait bounds
+   |                         ^^^^^^ function or associated item cannot be called on `fn(&())` due to unsatisfied trait bounds
    |
    = note: the following trait bounds were not satisfied:
            `for<'a> fn(&'a ()): X`
diff --git a/tests/ui/kindck/kindck-send-object1.stderr b/tests/ui/kindck/kindck-send-object1.stderr
index 11f597fee91..19ef4f6fc68 100644
--- a/tests/ui/kindck/kindck-send-object1.stderr
+++ b/tests/ui/kindck/kindck-send-object1.stderr
@@ -20,7 +20,7 @@ LL |     assert_send::<Box<dyn Dummy + 'a>>();
    |
    = help: the trait `Send` is not implemented for `(dyn Dummy + 'a)`
    = note: required for `Unique<(dyn Dummy + 'a)>` to implement `Send`
-   = note: required because it appears within the type `Box<(dyn Dummy + 'a)>`
+   = note: required because it appears within the type `Box<dyn Dummy>`
 note: required by a bound in `assert_send`
   --> $DIR/kindck-send-object1.rs:5:18
    |
diff --git a/tests/ui/nll/issue-57642-higher-ranked-subtype.stderr b/tests/ui/nll/issue-57642-higher-ranked-subtype.stderr
index ceef6e34d02..cab5898259f 100644
--- a/tests/ui/nll/issue-57642-higher-ranked-subtype.stderr
+++ b/tests/ui/nll/issue-57642-higher-ranked-subtype.stderr
@@ -1,8 +1,8 @@
-error[E0599]: the function or associated item `make_g` exists for fn pointer `fn(&'a ())`, but its trait bounds were not satisfied
+error[E0599]: the function or associated item `make_g` exists for fn pointer `fn(&())`, but its trait bounds were not satisfied
   --> $DIR/issue-57642-higher-ranked-subtype.rs:31:25
    |
 LL |     let x = <fn (&())>::make_g();
-   |                         ^^^^^^ function or associated item cannot be called on `fn(&'a ())` due to unsatisfied trait bounds
+   |                         ^^^^^^ function or associated item cannot be called on `fn(&())` due to unsatisfied trait bounds
    |
    = note: the following trait bounds were not satisfied:
            `for<'a> fn(&'a ()): X`
@@ -13,11 +13,11 @@ note: `X` defines an item `make_g`, perhaps you need to implement it
 LL | trait X {
    | ^^^^^^^
 
-error[E0599]: no function or associated item named `make_f` found for fn pointer `fn(&'a ())` in the current scope
+error[E0599]: no function or associated item named `make_f` found for fn pointer `fn(&())` in the current scope
   --> $DIR/issue-57642-higher-ranked-subtype.rs:35:25
    |
 LL |     let x = <fn (&())>::make_f();
-   |                         ^^^^^^ function or associated item not found in `fn(&'a ())`
+   |                         ^^^^^^ function or associated item not found in `fn(&())`
    |
    = help: items from traits can only be used if the trait is implemented and in scope
 note: `Y` defines an item `make_f`, perhaps you need to implement it
diff --git a/tests/ui/object-pointer-types.stderr b/tests/ui/object-pointer-types.stderr
index a477425edc8..7133f8ae194 100644
--- a/tests/ui/object-pointer-types.stderr
+++ b/tests/ui/object-pointer-types.stderr
@@ -16,11 +16,11 @@ LL |     fn owned(self: Box<Self>);
 LL |     x.owned();
    |       ^^^^^ method not found in `&mut dyn Foo`
 
-error[E0599]: no method named `managed` found for struct `Box<(dyn Foo + 'static)>` in the current scope
+error[E0599]: no method named `managed` found for struct `Box<dyn Foo>` in the current scope
   --> $DIR/object-pointer-types.rs:23:7
    |
 LL |     x.managed();
-   |       ^^^^^^^ method not found in `Box<(dyn Foo + 'static)>`
+   |       ^^^^^^^ method not found in `Box<dyn Foo>`
 
 error: aborting due to 3 previous errors
 
diff --git a/tests/ui/suggestions/issue-101984.stderr b/tests/ui/suggestions/issue-101984.stderr
index 3492f4ea0f1..151587d4222 100644
--- a/tests/ui/suggestions/issue-101984.stderr
+++ b/tests/ui/suggestions/issue-101984.stderr
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL |         let (cmp, router) = self.router.at()?;
    |             ^^^^^^^^^^^^^   ----------------- this expression has type `Match<&(for<'a> fn(&'a ()), Box<Wrapper>)>`
    |             |
-   |             expected `Match<&(fn(&'a ()), Box<Wrapper>)>`, found `(_, _)`
+   |             expected `Match<&(fn(&()), Box<Wrapper>)>`, found `(_, _)`
    |
    = note: expected struct `Match<&(for<'a> fn(&'a ()), Box<Wrapper>)>`
                found tuple `(_, _)`
diff --git a/tests/ui/suggestions/remove-as_str.stderr b/tests/ui/suggestions/remove-as_str.stderr
index 534c497780a..cb618db704d 100644
--- a/tests/ui/suggestions/remove-as_str.stderr
+++ b/tests/ui/suggestions/remove-as_str.stderr
@@ -4,7 +4,7 @@ error[E0599]: no method named `as_str` found for reference `&str` in the current
 LL |     s.as_str();
    |      -^^^^^^-- help: remove this method call
 
-error[E0599]: no method named `as_str` found for reference `&'a str` in the current scope
+error[E0599]: no method named `as_str` found for reference `&str` in the current scope
   --> $DIR/remove-as_str.rs:7:7
    |
 LL |     s.as_str();
diff --git a/tests/ui/suggestions/suggest-using-chars.rs b/tests/ui/suggestions/suggest-using-chars.rs
index 95732881baf..29750a20199 100644
--- a/tests/ui/suggestions/suggest-using-chars.rs
+++ b/tests/ui/suggestions/suggest-using-chars.rs
@@ -1,6 +1,6 @@
 pub fn main() {
-    let _ = "foo".iter(); //~ ERROR no method named `iter` found for reference `&'static str` in the current scope
-    let _ = "foo".foo(); //~ ERROR no method named `foo` found for reference `&'static str` in the current scope
+    let _ = "foo".iter(); //~ ERROR no method named `iter` found for reference `&str` in the current scope
+    let _ = "foo".foo(); //~ ERROR no method named `foo` found for reference `&str` in the current scope
     let _ = String::from("bar").iter(); //~ ERROR no method named `iter` found for struct `String` in the current scope
     let _ = (&String::from("bar")).iter(); //~ ERROR no method named `iter` found for reference `&String` in the current scope
     let _ = 0.iter(); //~ ERROR no method named `iter` found for type `{integer}` in the current scope
diff --git a/tests/ui/suggestions/suggest-using-chars.stderr b/tests/ui/suggestions/suggest-using-chars.stderr
index 99bcfb08a08..57b0e866f84 100644
--- a/tests/ui/suggestions/suggest-using-chars.stderr
+++ b/tests/ui/suggestions/suggest-using-chars.stderr
@@ -1,19 +1,19 @@
-error[E0599]: no method named `iter` found for reference `&'static str` in the current scope
+error[E0599]: no method named `iter` found for reference `&str` in the current scope
   --> $DIR/suggest-using-chars.rs:2:19
    |
 LL |     let _ = "foo".iter();
-   |                   ^^^^ method not found in `&'static str`
+   |                   ^^^^ method not found in `&str`
    |
 help: because of the in-memory representation of `&str`, to obtain an `Iterator` over each of its codepoint use method `chars`
    |
 LL |     let _ = "foo".chars();
    |                   ~~~~~
 
-error[E0599]: no method named `foo` found for reference `&'static str` in the current scope
+error[E0599]: no method named `foo` found for reference `&str` in the current scope
   --> $DIR/suggest-using-chars.rs:3:19
    |
 LL |     let _ = "foo".foo();
-   |                   ^^^ method not found in `&'static str`
+   |                   ^^^ method not found in `&str`
 
 error[E0599]: no method named `iter` found for struct `String` in the current scope
   --> $DIR/suggest-using-chars.rs:4:33
diff --git a/tests/ui/type-alias-impl-trait/issue-98604.rs b/tests/ui/type-alias-impl-trait/issue-98604.rs
index 32c2f9ed51e..35f0bbfac93 100644
--- a/tests/ui/type-alias-impl-trait/issue-98604.rs
+++ b/tests/ui/type-alias-impl-trait/issue-98604.rs
@@ -7,5 +7,5 @@ async fn test() {}
 #[allow(unused_must_use)]
 fn main() {
     Box::new(test) as AsyncFnPtr;
-    //~^ ERROR expected `fn() -> impl Future<Output = ()> {test}` to be a fn item that returns `Pin<Box<(dyn Future<Output = ()> + 'static)>>`, but it returns `impl Future<Output = ()>`
+    //~^ ERROR expected `fn() -> impl Future<Output = ()> {test}` to be a fn item that returns `Pin<Box<dyn Future<Output = ()>>>`, but it returns `impl Future<Output = ()>
 }
diff --git a/tests/ui/type-alias-impl-trait/issue-98604.stderr b/tests/ui/type-alias-impl-trait/issue-98604.stderr
index 64fe15c19f4..650376f8c6b 100644
--- a/tests/ui/type-alias-impl-trait/issue-98604.stderr
+++ b/tests/ui/type-alias-impl-trait/issue-98604.stderr
@@ -1,4 +1,4 @@
-error[E0271]: expected `fn() -> impl Future<Output = ()> {test}` to be a fn item that returns `Pin<Box<(dyn Future<Output = ()> + 'static)>>`, but it returns `impl Future<Output = ()>`
+error[E0271]: expected `fn() -> impl Future<Output = ()> {test}` to be a fn item that returns `Pin<Box<dyn Future<Output = ()>>>`, but it returns `impl Future<Output = ()>`
   --> $DIR/issue-98604.rs:9:5
    |
 LL |     Box::new(test) as AsyncFnPtr;