about summary refs log tree commit diff
path: root/tests/ui/impl-trait
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/impl-trait')
-rw-r--r--tests/ui/impl-trait/auto-trait-leak2.rs2
-rw-r--r--tests/ui/impl-trait/auto-trait-leak2.stderr8
-rw-r--r--tests/ui/impl-trait/in-trait/check-wf-on-non-defaulted-rpitit.stderr1
-rw-r--r--tests/ui/impl-trait/in-trait/deep-match.current.stderr15
-rw-r--r--tests/ui/impl-trait/in-trait/deep-match.next.stderr15
-rw-r--r--tests/ui/impl-trait/in-trait/default-body-type-err-2.current.stderr11
-rw-r--r--tests/ui/impl-trait/in-trait/default-body-type-err-2.next.stderr11
-rw-r--r--tests/ui/impl-trait/in-trait/default-body-type-err.current.stderr12
-rw-r--r--tests/ui/impl-trait/in-trait/default-body-type-err.next.stderr12
-rw-r--r--tests/ui/impl-trait/in-trait/default-body-with-rpit.current.stderr24
-rw-r--r--tests/ui/impl-trait/in-trait/default-body-with-rpit.next.stderr24
-rw-r--r--tests/ui/impl-trait/in-trait/doesnt-satisfy.current.stderr17
-rw-r--r--tests/ui/impl-trait/in-trait/doesnt-satisfy.next.stderr17
-rw-r--r--tests/ui/impl-trait/in-trait/dont-project-to-rpitit-with-no-value.current.stderr12
-rw-r--r--tests/ui/impl-trait/in-trait/dont-project-to-rpitit-with-no-value.next.stderr12
-rw-r--r--tests/ui/impl-trait/in-trait/generics-mismatch.current.stderr12
-rw-r--r--tests/ui/impl-trait/in-trait/generics-mismatch.next.stderr12
-rw-r--r--tests/ui/impl-trait/in-trait/issue-102140.current.stderr33
-rw-r--r--tests/ui/impl-trait/in-trait/issue-102140.next.stderr29
-rw-r--r--tests/ui/impl-trait/in-trait/issue-102571.current.stderr14
-rw-r--r--tests/ui/impl-trait/in-trait/issue-102571.next.stderr14
-rw-r--r--tests/ui/impl-trait/in-trait/object-safety.current.stderr49
-rw-r--r--tests/ui/impl-trait/in-trait/object-safety.next.stderr49
-rw-r--r--tests/ui/impl-trait/in-trait/opaque-in-impl-is-opaque.current.stderr17
-rw-r--r--tests/ui/impl-trait/in-trait/opaque-in-impl-is-opaque.next.stderr17
-rw-r--r--tests/ui/impl-trait/in-trait/outlives-in-nested-rpit.rs11
-rw-r--r--tests/ui/impl-trait/in-trait/return-dont-satisfy-bounds.current.stderr16
-rw-r--r--tests/ui/impl-trait/in-trait/return-dont-satisfy-bounds.next.stderr16
-rw-r--r--tests/ui/impl-trait/in-trait/signature-mismatch.current.stderr61
-rw-r--r--tests/ui/impl-trait/in-trait/signature-mismatch.next.stderr61
-rw-r--r--tests/ui/impl-trait/in-trait/specialization-broken.current.stderr31
-rw-r--r--tests/ui/impl-trait/in-trait/specialization-broken.next.stderr31
-rw-r--r--tests/ui/impl-trait/in-trait/trait-more-generics-than-impl.current.stderr12
-rw-r--r--tests/ui/impl-trait/in-trait/trait-more-generics-than-impl.next.stderr12
-rw-r--r--tests/ui/impl-trait/in-trait/unconstrained-lt.current.stderr9
-rw-r--r--tests/ui/impl-trait/in-trait/unconstrained-lt.next.stderr9
-rw-r--r--tests/ui/impl-trait/in-trait/wf-bounds.current.stderr57
-rw-r--r--tests/ui/impl-trait/in-trait/wf-bounds.next.stderr57
-rw-r--r--tests/ui/impl-trait/mapping-duplicated-lifetimes-issue-114597.rs15
39 files changed, 34 insertions, 803 deletions
diff --git a/tests/ui/impl-trait/auto-trait-leak2.rs b/tests/ui/impl-trait/auto-trait-leak2.rs
index 09450089ada..bbad0df1f66 100644
--- a/tests/ui/impl-trait/auto-trait-leak2.rs
+++ b/tests/ui/impl-trait/auto-trait-leak2.rs
@@ -21,11 +21,13 @@ fn main() {
     //~^ ERROR `Rc<Cell<i32>>` cannot be sent between threads safely
     //~| NOTE `Rc<Cell<i32>>` cannot be sent between threads safely
     //~| NOTE required by a bound
+    //~| NOTE use `std::sync::Arc` instead
 
     send(after());
     //~^ ERROR `Rc<Cell<i32>>` cannot be sent between threads safely
     //~| NOTE `Rc<Cell<i32>>` cannot be sent between threads safely
     //~| NOTE required by a bound
+    //~| NOTE use `std::sync::Arc` instead
 }
 
 // Deferred path, main has to wait until typeck finishes,
diff --git a/tests/ui/impl-trait/auto-trait-leak2.stderr b/tests/ui/impl-trait/auto-trait-leak2.stderr
index 52fa28145d6..f2f88215a39 100644
--- a/tests/ui/impl-trait/auto-trait-leak2.stderr
+++ b/tests/ui/impl-trait/auto-trait-leak2.stderr
@@ -10,6 +10,7 @@ LL |     send(before());
    |     required by a bound introduced by this call
    |
    = help: within `impl Fn(i32)`, the trait `Send` is not implemented for `Rc<Cell<i32>>`
+   = note: use `std::sync::Arc` instead of `std::rc::Rc`
 note: required because it's used within this closure
   --> $DIR/auto-trait-leak2.rs:10:5
    |
@@ -27,7 +28,7 @@ LL | fn send<T: Send>(_: T) {}
    |            ^^^^ required by this bound in `send`
 
 error[E0277]: `Rc<Cell<i32>>` cannot be sent between threads safely
-  --> $DIR/auto-trait-leak2.rs:25:10
+  --> $DIR/auto-trait-leak2.rs:26:10
    |
 LL |     send(after());
    |     ---- ^^^^^^^ `Rc<Cell<i32>>` cannot be sent between threads safely
@@ -38,13 +39,14 @@ LL | fn after() -> impl Fn(i32) {
    |               ------------ within this `impl Fn(i32)`
    |
    = help: within `impl Fn(i32)`, the trait `Send` is not implemented for `Rc<Cell<i32>>`
+   = note: use `std::sync::Arc` instead of `std::rc::Rc`
 note: required because it's used within this closure
-  --> $DIR/auto-trait-leak2.rs:38:5
+  --> $DIR/auto-trait-leak2.rs:40:5
    |
 LL |     move |x| p.set(x)
    |     ^^^^^^^^
 note: required because it appears within the type `impl Fn(i32)`
-  --> $DIR/auto-trait-leak2.rs:33:15
+  --> $DIR/auto-trait-leak2.rs:35:15
    |
 LL | fn after() -> impl Fn(i32) {
    |               ^^^^^^^^^^^^
diff --git a/tests/ui/impl-trait/in-trait/check-wf-on-non-defaulted-rpitit.stderr b/tests/ui/impl-trait/in-trait/check-wf-on-non-defaulted-rpitit.stderr
index dee87d08238..687c811a5d5 100644
--- a/tests/ui/impl-trait/in-trait/check-wf-on-non-defaulted-rpitit.stderr
+++ b/tests/ui/impl-trait/in-trait/check-wf-on-non-defaulted-rpitit.stderr
@@ -5,6 +5,7 @@ LL |     fn bar() -> Wrapper<impl Sized>;
    |                 ^^^^^^^^^^^^^^^^^^^ `impl Sized` cannot be sent between threads safely
    |
    = help: the trait `Send` is not implemented for `impl Sized`
+   = note: consider using `std::sync::Arc<impl Sized>`; for more information visit <https://doc.rust-lang.org/book/ch16-03-shared-state.html>
 note: required by a bound in `Wrapper`
   --> $DIR/check-wf-on-non-defaulted-rpitit.rs:3:19
    |
diff --git a/tests/ui/impl-trait/in-trait/deep-match.current.stderr b/tests/ui/impl-trait/in-trait/deep-match.current.stderr
deleted file mode 100644
index 400db20c79c..00000000000
--- a/tests/ui/impl-trait/in-trait/deep-match.current.stderr
+++ /dev/null
@@ -1,15 +0,0 @@
-error[E0053]: method `bar` has an incompatible return type for trait
-  --> $DIR/deep-match.rs:14:17
-   |
-LL |     fn bar() -> i32 {
-   |                 ^^^
-   |                 |
-   |                 expected `Wrapper<_>`, found `i32`
-   |                 return type in trait
-   |
-   = note: expected struct `Wrapper<_>`
-                found type `i32`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0053`.
diff --git a/tests/ui/impl-trait/in-trait/deep-match.next.stderr b/tests/ui/impl-trait/in-trait/deep-match.next.stderr
deleted file mode 100644
index 400db20c79c..00000000000
--- a/tests/ui/impl-trait/in-trait/deep-match.next.stderr
+++ /dev/null
@@ -1,15 +0,0 @@
-error[E0053]: method `bar` has an incompatible return type for trait
-  --> $DIR/deep-match.rs:14:17
-   |
-LL |     fn bar() -> i32 {
-   |                 ^^^
-   |                 |
-   |                 expected `Wrapper<_>`, found `i32`
-   |                 return type in trait
-   |
-   = note: expected struct `Wrapper<_>`
-                found type `i32`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0053`.
diff --git a/tests/ui/impl-trait/in-trait/default-body-type-err-2.current.stderr b/tests/ui/impl-trait/in-trait/default-body-type-err-2.current.stderr
deleted file mode 100644
index 85450e3b0a0..00000000000
--- a/tests/ui/impl-trait/in-trait/default-body-type-err-2.current.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error[E0308]: mismatched types
-  --> $DIR/default-body-type-err-2.rs:10:9
-   |
-LL |         42
-   |         ^^- help: try using a conversion method: `.to_string()`
-   |         |
-   |         expected `String`, found integer
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/impl-trait/in-trait/default-body-type-err-2.next.stderr b/tests/ui/impl-trait/in-trait/default-body-type-err-2.next.stderr
deleted file mode 100644
index 85450e3b0a0..00000000000
--- a/tests/ui/impl-trait/in-trait/default-body-type-err-2.next.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error[E0308]: mismatched types
-  --> $DIR/default-body-type-err-2.rs:10:9
-   |
-LL |         42
-   |         ^^- help: try using a conversion method: `.to_string()`
-   |         |
-   |         expected `String`, found integer
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/impl-trait/in-trait/default-body-type-err.current.stderr b/tests/ui/impl-trait/in-trait/default-body-type-err.current.stderr
deleted file mode 100644
index c949168a377..00000000000
--- a/tests/ui/impl-trait/in-trait/default-body-type-err.current.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-error[E0271]: type mismatch resolving `<&i32 as Deref>::Target == String`
-  --> $DIR/default-body-type-err.rs:10:22
-   |
-LL |     fn lol(&self) -> impl Deref<Target = String> {
-   |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `String`
-LL |
-LL |         &1i32
-   |         ----- return type was inferred to be `&i32` here
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0271`.
diff --git a/tests/ui/impl-trait/in-trait/default-body-type-err.next.stderr b/tests/ui/impl-trait/in-trait/default-body-type-err.next.stderr
deleted file mode 100644
index c949168a377..00000000000
--- a/tests/ui/impl-trait/in-trait/default-body-type-err.next.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-error[E0271]: type mismatch resolving `<&i32 as Deref>::Target == String`
-  --> $DIR/default-body-type-err.rs:10:22
-   |
-LL |     fn lol(&self) -> impl Deref<Target = String> {
-   |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `String`
-LL |
-LL |         &1i32
-   |         ----- return type was inferred to be `&i32` here
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0271`.
diff --git a/tests/ui/impl-trait/in-trait/default-body-with-rpit.current.stderr b/tests/ui/impl-trait/in-trait/default-body-with-rpit.current.stderr
deleted file mode 100644
index 3c24eff9ae3..00000000000
--- a/tests/ui/impl-trait/in-trait/default-body-with-rpit.current.stderr
+++ /dev/null
@@ -1,24 +0,0 @@
-error: concrete type differs from previous defining opaque type use
-  --> $DIR/default-body-with-rpit.rs:13:9
-   |
-LL |         ""
-   |         ^^ expected `impl Debug`, got `&'static str`
-   |
-note: previous use here
-  --> $DIR/default-body-with-rpit.rs:12:39
-   |
-LL |       async fn baz(&self) -> impl Debug {
-   |  _______________________________________^
-LL | |         ""
-LL | |     }
-   | |_____^
-
-error[E0720]: cannot resolve opaque type
-  --> $DIR/default-body-with-rpit.rs:12:28
-   |
-LL |     async fn baz(&self) -> impl Debug {
-   |                            ^^^^^^^^^^ cannot resolve opaque type
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0720`.
diff --git a/tests/ui/impl-trait/in-trait/default-body-with-rpit.next.stderr b/tests/ui/impl-trait/in-trait/default-body-with-rpit.next.stderr
deleted file mode 100644
index 3c24eff9ae3..00000000000
--- a/tests/ui/impl-trait/in-trait/default-body-with-rpit.next.stderr
+++ /dev/null
@@ -1,24 +0,0 @@
-error: concrete type differs from previous defining opaque type use
-  --> $DIR/default-body-with-rpit.rs:13:9
-   |
-LL |         ""
-   |         ^^ expected `impl Debug`, got `&'static str`
-   |
-note: previous use here
-  --> $DIR/default-body-with-rpit.rs:12:39
-   |
-LL |       async fn baz(&self) -> impl Debug {
-   |  _______________________________________^
-LL | |         ""
-LL | |     }
-   | |_____^
-
-error[E0720]: cannot resolve opaque type
-  --> $DIR/default-body-with-rpit.rs:12:28
-   |
-LL |     async fn baz(&self) -> impl Debug {
-   |                            ^^^^^^^^^^ cannot resolve opaque type
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0720`.
diff --git a/tests/ui/impl-trait/in-trait/doesnt-satisfy.current.stderr b/tests/ui/impl-trait/in-trait/doesnt-satisfy.current.stderr
deleted file mode 100644
index 653016cf009..00000000000
--- a/tests/ui/impl-trait/in-trait/doesnt-satisfy.current.stderr
+++ /dev/null
@@ -1,17 +0,0 @@
-error[E0277]: `()` doesn't implement `std::fmt::Display`
-  --> $DIR/doesnt-satisfy.rs:12:17
-   |
-LL |     fn bar() -> () {}
-   |                 ^^ `()` cannot be formatted with the default formatter
-   |
-   = help: the trait `std::fmt::Display` is not implemented for `()`
-   = note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
-note: required by a bound in `Foo::bar::{opaque#0}`
-  --> $DIR/doesnt-satisfy.rs:8:22
-   |
-LL |     fn bar() -> impl std::fmt::Display;
-   |                      ^^^^^^^^^^^^^^^^^ required by this bound in `Foo::bar::{opaque#0}`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/impl-trait/in-trait/doesnt-satisfy.next.stderr b/tests/ui/impl-trait/in-trait/doesnt-satisfy.next.stderr
deleted file mode 100644
index f0cd43bcf92..00000000000
--- a/tests/ui/impl-trait/in-trait/doesnt-satisfy.next.stderr
+++ /dev/null
@@ -1,17 +0,0 @@
-error[E0277]: `()` doesn't implement `std::fmt::Display`
-  --> $DIR/doesnt-satisfy.rs:12:17
-   |
-LL |     fn bar() -> () {}
-   |                 ^^ `()` cannot be formatted with the default formatter
-   |
-   = help: the trait `std::fmt::Display` is not implemented for `()`
-   = note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
-note: required by a bound in `Foo::{opaque#0}`
-  --> $DIR/doesnt-satisfy.rs:8:22
-   |
-LL |     fn bar() -> impl std::fmt::Display;
-   |                      ^^^^^^^^^^^^^^^^^ required by this bound in `Foo::{opaque#0}`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/impl-trait/in-trait/dont-project-to-rpitit-with-no-value.current.stderr b/tests/ui/impl-trait/in-trait/dont-project-to-rpitit-with-no-value.current.stderr
deleted file mode 100644
index d4d0124a659..00000000000
--- a/tests/ui/impl-trait/in-trait/dont-project-to-rpitit-with-no-value.current.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-error[E0046]: not all trait items implemented, missing: `foo`
-  --> $DIR/dont-project-to-rpitit-with-no-value.rs:11:1
-   |
-LL |     fn foo(&self) -> impl Sized;
-   |     ---------------------------- `foo` from trait
-...
-LL | impl MyTrait for i32 {
-   | ^^^^^^^^^^^^^^^^^^^^ missing `foo` in implementation
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0046`.
diff --git a/tests/ui/impl-trait/in-trait/dont-project-to-rpitit-with-no-value.next.stderr b/tests/ui/impl-trait/in-trait/dont-project-to-rpitit-with-no-value.next.stderr
deleted file mode 100644
index d4d0124a659..00000000000
--- a/tests/ui/impl-trait/in-trait/dont-project-to-rpitit-with-no-value.next.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-error[E0046]: not all trait items implemented, missing: `foo`
-  --> $DIR/dont-project-to-rpitit-with-no-value.rs:11:1
-   |
-LL |     fn foo(&self) -> impl Sized;
-   |     ---------------------------- `foo` from trait
-...
-LL | impl MyTrait for i32 {
-   | ^^^^^^^^^^^^^^^^^^^^ missing `foo` in implementation
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0046`.
diff --git a/tests/ui/impl-trait/in-trait/generics-mismatch.current.stderr b/tests/ui/impl-trait/in-trait/generics-mismatch.current.stderr
deleted file mode 100644
index 310edbcb6cd..00000000000
--- a/tests/ui/impl-trait/in-trait/generics-mismatch.current.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-error[E0049]: method `bar` has 1 type parameter but its trait declaration has 0 type parameters
-  --> $DIR/generics-mismatch.rs:14:12
-   |
-LL |     fn bar(&self) -> impl Sized;
-   |           - expected 0 type parameters
-...
-LL |     fn bar<T>(&self) {}
-   |            ^ found 1 type parameter
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0049`.
diff --git a/tests/ui/impl-trait/in-trait/generics-mismatch.next.stderr b/tests/ui/impl-trait/in-trait/generics-mismatch.next.stderr
deleted file mode 100644
index 310edbcb6cd..00000000000
--- a/tests/ui/impl-trait/in-trait/generics-mismatch.next.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-error[E0049]: method `bar` has 1 type parameter but its trait declaration has 0 type parameters
-  --> $DIR/generics-mismatch.rs:14:12
-   |
-LL |     fn bar(&self) -> impl Sized;
-   |           - expected 0 type parameters
-...
-LL |     fn bar<T>(&self) {}
-   |            ^ found 1 type parameter
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0049`.
diff --git a/tests/ui/impl-trait/in-trait/issue-102140.current.stderr b/tests/ui/impl-trait/in-trait/issue-102140.current.stderr
deleted file mode 100644
index 7aa7880e258..00000000000
--- a/tests/ui/impl-trait/in-trait/issue-102140.current.stderr
+++ /dev/null
@@ -1,33 +0,0 @@
-error[E0277]: the trait bound `&dyn MyTrait: MyTrait` is not satisfied
-  --> $DIR/issue-102140.rs:26:22
-   |
-LL |         MyTrait::foo(&self)
-   |         ------------ ^^^^^ the trait `MyTrait` is not implemented for `&dyn MyTrait`
-   |         |
-   |         required by a bound introduced by this call
-   |
-help: consider removing the leading `&`-reference
-   |
-LL -         MyTrait::foo(&self)
-LL +         MyTrait::foo(self)
-   |
-
-error[E0277]: the trait bound `&dyn MyTrait: MyTrait` is not satisfied
-  --> $DIR/issue-102140.rs:26:9
-   |
-LL |         MyTrait::foo(&self)
-   |         ^^^^^^^^^^^^^^^^^^^ the trait `MyTrait` is not implemented for `&dyn MyTrait`
-   |
-   = help: the trait `MyTrait` is implemented for `Outer`
-
-error[E0277]: the trait bound `&dyn MyTrait: MyTrait` is not satisfied
-  --> $DIR/issue-102140.rs:26:9
-   |
-LL |         MyTrait::foo(&self)
-   |         ^^^^^^^^^^^^ the trait `MyTrait` is not implemented for `&dyn MyTrait`
-   |
-   = help: the trait `MyTrait` is implemented for `Outer`
-
-error: aborting due to 3 previous errors
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/impl-trait/in-trait/issue-102140.next.stderr b/tests/ui/impl-trait/in-trait/issue-102140.next.stderr
deleted file mode 100644
index 94893c9e7b4..00000000000
--- a/tests/ui/impl-trait/in-trait/issue-102140.next.stderr
+++ /dev/null
@@ -1,29 +0,0 @@
-error[E0277]: the trait bound `&dyn MyTrait: MyTrait` is not satisfied
-  --> $DIR/issue-102140.rs:26:22
-   |
-LL |         MyTrait::foo(&self)
-   |         ------------ ^^^^^ the trait `MyTrait` is not implemented for `&dyn MyTrait`
-   |         |
-   |         required by a bound introduced by this call
-   |
-   = help: the trait `MyTrait` is implemented for `Outer`
-
-error[E0277]: the trait bound `&dyn MyTrait: MyTrait` is not satisfied
-  --> $DIR/issue-102140.rs:26:9
-   |
-LL |         MyTrait::foo(&self)
-   |         ^^^^^^^^^^^^^^^^^^^ the trait `MyTrait` is not implemented for `&dyn MyTrait`
-   |
-   = help: the trait `MyTrait` is implemented for `Outer`
-
-error[E0277]: the trait bound `&dyn MyTrait: MyTrait` is not satisfied
-  --> $DIR/issue-102140.rs:26:9
-   |
-LL |         MyTrait::foo(&self)
-   |         ^^^^^^^^^^^^ the trait `MyTrait` is not implemented for `&dyn MyTrait`
-   |
-   = help: the trait `MyTrait` is implemented for `Outer`
-
-error: aborting due to 3 previous errors
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/impl-trait/in-trait/issue-102571.current.stderr b/tests/ui/impl-trait/in-trait/issue-102571.current.stderr
deleted file mode 100644
index cac9a29f644..00000000000
--- a/tests/ui/impl-trait/in-trait/issue-102571.current.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error[E0308]: mismatched types
-  --> $DIR/issue-102571.rs:23:9
-   |
-LL |     let () = t.bar();
-   |         ^^   ------- this expression has type `impl Deref<Target = impl std::fmt::Display + ?Sized>`
-   |         |
-   |         expected associated type, found `()`
-   |
-   = note: expected associated type `impl Deref<Target = impl std::fmt::Display + ?Sized>`
-                    found unit type `()`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/impl-trait/in-trait/issue-102571.next.stderr b/tests/ui/impl-trait/in-trait/issue-102571.next.stderr
deleted file mode 100644
index cac9a29f644..00000000000
--- a/tests/ui/impl-trait/in-trait/issue-102571.next.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error[E0308]: mismatched types
-  --> $DIR/issue-102571.rs:23:9
-   |
-LL |     let () = t.bar();
-   |         ^^   ------- this expression has type `impl Deref<Target = impl std::fmt::Display + ?Sized>`
-   |         |
-   |         expected associated type, found `()`
-   |
-   = note: expected associated type `impl Deref<Target = impl std::fmt::Display + ?Sized>`
-                    found unit type `()`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/impl-trait/in-trait/object-safety.current.stderr b/tests/ui/impl-trait/in-trait/object-safety.current.stderr
deleted file mode 100644
index 2c340a02319..00000000000
--- a/tests/ui/impl-trait/in-trait/object-safety.current.stderr
+++ /dev/null
@@ -1,49 +0,0 @@
-error[E0038]: the trait `Foo` cannot be made into an object
-  --> $DIR/object-safety.rs:20:33
-   |
-LL |     let i = Box::new(42_u32) as Box<dyn Foo>;
-   |                                 ^^^^^^^^^^^^ `Foo` cannot be made into an object
-   |
-note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
-  --> $DIR/object-safety.rs:10:22
-   |
-LL | trait Foo {
-   |       --- this trait cannot be made into an object...
-LL |     fn baz(&self) -> impl Debug;
-   |                      ^^^^^^^^^^ ...because method `baz` references an `impl Trait` type in its return type
-   = help: consider moving `baz` to another trait
-
-error[E0038]: the trait `Foo` cannot be made into an object
-  --> $DIR/object-safety.rs:23:13
-   |
-LL |     let s = i.baz();
-   |             ^^^^^^^ `Foo` cannot be made into an object
-   |
-note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
-  --> $DIR/object-safety.rs:10:22
-   |
-LL | trait Foo {
-   |       --- this trait cannot be made into an object...
-LL |     fn baz(&self) -> impl Debug;
-   |                      ^^^^^^^^^^ ...because method `baz` references an `impl Trait` type in its return type
-   = help: consider moving `baz` to another trait
-
-error[E0038]: the trait `Foo` cannot be made into an object
-  --> $DIR/object-safety.rs:20:13
-   |
-LL |     let i = Box::new(42_u32) as Box<dyn Foo>;
-   |             ^^^^^^^^^^^^^^^^ `Foo` cannot be made into an object
-   |
-note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
-  --> $DIR/object-safety.rs:10:22
-   |
-LL | trait Foo {
-   |       --- this trait cannot be made into an object...
-LL |     fn baz(&self) -> impl Debug;
-   |                      ^^^^^^^^^^ ...because method `baz` references an `impl Trait` type in its return type
-   = help: consider moving `baz` to another trait
-   = note: required for the cast from `Box<u32>` to `Box<dyn Foo>`
-
-error: aborting due to 3 previous errors
-
-For more information about this error, try `rustc --explain E0038`.
diff --git a/tests/ui/impl-trait/in-trait/object-safety.next.stderr b/tests/ui/impl-trait/in-trait/object-safety.next.stderr
deleted file mode 100644
index 2c340a02319..00000000000
--- a/tests/ui/impl-trait/in-trait/object-safety.next.stderr
+++ /dev/null
@@ -1,49 +0,0 @@
-error[E0038]: the trait `Foo` cannot be made into an object
-  --> $DIR/object-safety.rs:20:33
-   |
-LL |     let i = Box::new(42_u32) as Box<dyn Foo>;
-   |                                 ^^^^^^^^^^^^ `Foo` cannot be made into an object
-   |
-note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
-  --> $DIR/object-safety.rs:10:22
-   |
-LL | trait Foo {
-   |       --- this trait cannot be made into an object...
-LL |     fn baz(&self) -> impl Debug;
-   |                      ^^^^^^^^^^ ...because method `baz` references an `impl Trait` type in its return type
-   = help: consider moving `baz` to another trait
-
-error[E0038]: the trait `Foo` cannot be made into an object
-  --> $DIR/object-safety.rs:23:13
-   |
-LL |     let s = i.baz();
-   |             ^^^^^^^ `Foo` cannot be made into an object
-   |
-note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
-  --> $DIR/object-safety.rs:10:22
-   |
-LL | trait Foo {
-   |       --- this trait cannot be made into an object...
-LL |     fn baz(&self) -> impl Debug;
-   |                      ^^^^^^^^^^ ...because method `baz` references an `impl Trait` type in its return type
-   = help: consider moving `baz` to another trait
-
-error[E0038]: the trait `Foo` cannot be made into an object
-  --> $DIR/object-safety.rs:20:13
-   |
-LL |     let i = Box::new(42_u32) as Box<dyn Foo>;
-   |             ^^^^^^^^^^^^^^^^ `Foo` cannot be made into an object
-   |
-note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
-  --> $DIR/object-safety.rs:10:22
-   |
-LL | trait Foo {
-   |       --- this trait cannot be made into an object...
-LL |     fn baz(&self) -> impl Debug;
-   |                      ^^^^^^^^^^ ...because method `baz` references an `impl Trait` type in its return type
-   = help: consider moving `baz` to another trait
-   = note: required for the cast from `Box<u32>` to `Box<dyn Foo>`
-
-error: aborting due to 3 previous errors
-
-For more information about this error, try `rustc --explain E0038`.
diff --git a/tests/ui/impl-trait/in-trait/opaque-in-impl-is-opaque.current.stderr b/tests/ui/impl-trait/in-trait/opaque-in-impl-is-opaque.current.stderr
deleted file mode 100644
index a57653b2c9e..00000000000
--- a/tests/ui/impl-trait/in-trait/opaque-in-impl-is-opaque.current.stderr
+++ /dev/null
@@ -1,17 +0,0 @@
-error[E0308]: mismatched types
-  --> $DIR/opaque-in-impl-is-opaque.rs:20:19
-   |
-LL |     fn bar(&self) -> impl Display {
-   |                      ------------ the found opaque type
-...
-LL |     let x: &str = ().bar();
-   |            ----   ^^^^^^^^ expected `&str`, found opaque type
-   |            |
-   |            expected due to this
-   |
-   = note: expected reference `&str`
-            found opaque type `impl std::fmt::Display`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/impl-trait/in-trait/opaque-in-impl-is-opaque.next.stderr b/tests/ui/impl-trait/in-trait/opaque-in-impl-is-opaque.next.stderr
deleted file mode 100644
index a57653b2c9e..00000000000
--- a/tests/ui/impl-trait/in-trait/opaque-in-impl-is-opaque.next.stderr
+++ /dev/null
@@ -1,17 +0,0 @@
-error[E0308]: mismatched types
-  --> $DIR/opaque-in-impl-is-opaque.rs:20:19
-   |
-LL |     fn bar(&self) -> impl Display {
-   |                      ------------ the found opaque type
-...
-LL |     let x: &str = ().bar();
-   |            ----   ^^^^^^^^ expected `&str`, found opaque type
-   |            |
-   |            expected due to this
-   |
-   = note: expected reference `&str`
-            found opaque type `impl std::fmt::Display`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/impl-trait/in-trait/outlives-in-nested-rpit.rs b/tests/ui/impl-trait/in-trait/outlives-in-nested-rpit.rs
new file mode 100644
index 00000000000..6330242ceeb
--- /dev/null
+++ b/tests/ui/impl-trait/in-trait/outlives-in-nested-rpit.rs
@@ -0,0 +1,11 @@
+// check-pass
+
+#![feature(return_position_impl_trait_in_trait)]
+
+trait Foo {
+    fn early<'a, T: 'a>(x: &'a T) -> impl Iterator<Item = impl Into<&'a T>>;
+
+    fn late<'a, T>(x: &'a T) -> impl Iterator<Item = impl Into<&'a T>>;
+}
+
+fn main() {}
diff --git a/tests/ui/impl-trait/in-trait/return-dont-satisfy-bounds.current.stderr b/tests/ui/impl-trait/in-trait/return-dont-satisfy-bounds.current.stderr
deleted file mode 100644
index ff30103b771..00000000000
--- a/tests/ui/impl-trait/in-trait/return-dont-satisfy-bounds.current.stderr
+++ /dev/null
@@ -1,16 +0,0 @@
-error[E0277]: the trait bound `impl Foo<u8>: Foo<char>` is not satisfied
-  --> $DIR/return-dont-satisfy-bounds.rs:13:34
-   |
-LL |     fn foo<F2: Foo<u8>>(self) -> impl Foo<u8> {
-   |                                  ^^^^^^^^^^^^ the trait `Foo<char>` is not implemented for `impl Foo<u8>`
-   |
-   = help: the trait `Foo<char>` is implemented for `Bar`
-note: required by a bound in `Foo::foo::{opaque#0}`
-  --> $DIR/return-dont-satisfy-bounds.rs:7:30
-   |
-LL |     fn foo<F2>(self) -> impl Foo<T>;
-   |                              ^^^^^^ required by this bound in `Foo::foo::{opaque#0}`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/impl-trait/in-trait/return-dont-satisfy-bounds.next.stderr b/tests/ui/impl-trait/in-trait/return-dont-satisfy-bounds.next.stderr
deleted file mode 100644
index 7c7f7feaa55..00000000000
--- a/tests/ui/impl-trait/in-trait/return-dont-satisfy-bounds.next.stderr
+++ /dev/null
@@ -1,16 +0,0 @@
-error[E0277]: the trait bound `impl Foo<u8>: Foo<char>` is not satisfied
-  --> $DIR/return-dont-satisfy-bounds.rs:13:34
-   |
-LL |     fn foo<F2: Foo<u8>>(self) -> impl Foo<u8> {
-   |                                  ^^^^^^^^^^^^ the trait `Foo<char>` is not implemented for `impl Foo<u8>`
-   |
-   = help: the trait `Foo<char>` is implemented for `Bar`
-note: required by a bound in `Foo::{opaque#0}`
-  --> $DIR/return-dont-satisfy-bounds.rs:7:30
-   |
-LL |     fn foo<F2>(self) -> impl Foo<T>;
-   |                              ^^^^^^ required by this bound in `Foo::{opaque#0}`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/impl-trait/in-trait/signature-mismatch.current.stderr b/tests/ui/impl-trait/in-trait/signature-mismatch.current.stderr
deleted file mode 100644
index 8c9dd403174..00000000000
--- a/tests/ui/impl-trait/in-trait/signature-mismatch.current.stderr
+++ /dev/null
@@ -1,61 +0,0 @@
-error: return type captures more lifetimes than trait definition
-  --> $DIR/signature-mismatch.rs:36:47
-   |
-LL |     fn async_fn<'a>(&self, buff: &'a [u8]) -> impl Future<Output = Vec<u8>> + 'a {
-   |                 -- this lifetime was captured ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-note: hidden type must only reference lifetimes captured by this impl trait
-  --> $DIR/signature-mismatch.rs:17:40
-   |
-LL |     fn async_fn(&self, buff: &[u8]) -> impl Future<Output = Vec<u8>>;
-   |                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   = note: hidden type inferred to be `impl Future<Output = Vec<u8>> + 'a`
-
-error: return type captures more lifetimes than trait definition
-  --> $DIR/signature-mismatch.rs:41:57
-   |
-LL |     fn async_fn_early<'a: 'a>(&self, buff: &'a [u8]) -> impl Future<Output = Vec<u8>> + 'a {
-   |                       -- this lifetime was captured     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-note: hidden type must only reference lifetimes captured by this impl trait
-  --> $DIR/signature-mismatch.rs:18:57
-   |
-LL |     fn async_fn_early<'a: 'a>(&self, buff: &'a [u8]) -> impl Future<Output = Vec<u8>>;
-   |                                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   = note: hidden type inferred to be `impl Future<Output = Vec<u8>> + 'a`
-
-error: return type captures more lifetimes than trait definition
-  --> $DIR/signature-mismatch.rs:49:10
-   |
-LL |     fn async_fn_multiple<'a, 'b>(
-   |                              -- this lifetime was captured
-...
-LL |     ) -> impl Future<Output = Vec<u8>> + Captures2<'a, 'b> {
-   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-note: hidden type must only reference lifetimes captured by this impl trait
-  --> $DIR/signature-mismatch.rs:20:12
-   |
-LL |         -> impl Future<Output = Vec<u8>> + Captures<'a>;
-   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   = note: hidden type inferred to be `impl Future<Output = Vec<u8>> + Captures2<'a, 'b>`
-
-error[E0309]: the parameter type `T` may not live long enough
-  --> $DIR/signature-mismatch.rs:58:10
-   |
-LL |     ) -> impl Future<Output = Vec<u8>> {
-   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...so that the type `impl Future<Output = Vec<u8>>` will meet its required lifetime bounds...
-   |
-note: ...that is required by this bound
-  --> $DIR/signature-mismatch.rs:25:42
-   |
-LL |     ) -> impl Future<Output = Vec<u8>> + 'a;
-   |                                          ^^
-help: consider adding an explicit lifetime bound...
-   |
-LL |     fn async_fn_reduce_outlive<'a, 'b, T: 'a>(
-   |                                         ++++
-
-error: aborting due to 4 previous errors
-
-For more information about this error, try `rustc --explain E0309`.
diff --git a/tests/ui/impl-trait/in-trait/signature-mismatch.next.stderr b/tests/ui/impl-trait/in-trait/signature-mismatch.next.stderr
deleted file mode 100644
index 8c9dd403174..00000000000
--- a/tests/ui/impl-trait/in-trait/signature-mismatch.next.stderr
+++ /dev/null
@@ -1,61 +0,0 @@
-error: return type captures more lifetimes than trait definition
-  --> $DIR/signature-mismatch.rs:36:47
-   |
-LL |     fn async_fn<'a>(&self, buff: &'a [u8]) -> impl Future<Output = Vec<u8>> + 'a {
-   |                 -- this lifetime was captured ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-note: hidden type must only reference lifetimes captured by this impl trait
-  --> $DIR/signature-mismatch.rs:17:40
-   |
-LL |     fn async_fn(&self, buff: &[u8]) -> impl Future<Output = Vec<u8>>;
-   |                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   = note: hidden type inferred to be `impl Future<Output = Vec<u8>> + 'a`
-
-error: return type captures more lifetimes than trait definition
-  --> $DIR/signature-mismatch.rs:41:57
-   |
-LL |     fn async_fn_early<'a: 'a>(&self, buff: &'a [u8]) -> impl Future<Output = Vec<u8>> + 'a {
-   |                       -- this lifetime was captured     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-note: hidden type must only reference lifetimes captured by this impl trait
-  --> $DIR/signature-mismatch.rs:18:57
-   |
-LL |     fn async_fn_early<'a: 'a>(&self, buff: &'a [u8]) -> impl Future<Output = Vec<u8>>;
-   |                                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   = note: hidden type inferred to be `impl Future<Output = Vec<u8>> + 'a`
-
-error: return type captures more lifetimes than trait definition
-  --> $DIR/signature-mismatch.rs:49:10
-   |
-LL |     fn async_fn_multiple<'a, 'b>(
-   |                              -- this lifetime was captured
-...
-LL |     ) -> impl Future<Output = Vec<u8>> + Captures2<'a, 'b> {
-   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-note: hidden type must only reference lifetimes captured by this impl trait
-  --> $DIR/signature-mismatch.rs:20:12
-   |
-LL |         -> impl Future<Output = Vec<u8>> + Captures<'a>;
-   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   = note: hidden type inferred to be `impl Future<Output = Vec<u8>> + Captures2<'a, 'b>`
-
-error[E0309]: the parameter type `T` may not live long enough
-  --> $DIR/signature-mismatch.rs:58:10
-   |
-LL |     ) -> impl Future<Output = Vec<u8>> {
-   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...so that the type `impl Future<Output = Vec<u8>>` will meet its required lifetime bounds...
-   |
-note: ...that is required by this bound
-  --> $DIR/signature-mismatch.rs:25:42
-   |
-LL |     ) -> impl Future<Output = Vec<u8>> + 'a;
-   |                                          ^^
-help: consider adding an explicit lifetime bound...
-   |
-LL |     fn async_fn_reduce_outlive<'a, 'b, T: 'a>(
-   |                                         ++++
-
-error: aborting due to 4 previous errors
-
-For more information about this error, try `rustc --explain E0309`.
diff --git a/tests/ui/impl-trait/in-trait/specialization-broken.current.stderr b/tests/ui/impl-trait/in-trait/specialization-broken.current.stderr
deleted file mode 100644
index f48e7a1ed14..00000000000
--- a/tests/ui/impl-trait/in-trait/specialization-broken.current.stderr
+++ /dev/null
@@ -1,31 +0,0 @@
-error[E0053]: method `bar` has an incompatible type for trait
-  --> $DIR/specialization-broken.rs:19:22
-   |
-LL | default impl<U> Foo for U
-   |              - this type parameter
-...
-LL |     fn bar(&self) -> U {
-   |                      ^
-   |                      |
-   |                      expected associated type, found type parameter `U`
-   |                      help: change the output type to match the trait: `impl Sized`
-   |
-note: type in trait
-  --> $DIR/specialization-broken.rs:12:22
-   |
-LL |     fn bar(&self) -> impl Sized;
-   |                      ^^^^^^^^^^
-   = note: expected signature `fn(&U) -> impl Sized`
-              found signature `fn(&U) -> U`
-
-error: method with return-position `impl Trait` in trait cannot be specialized
-  --> $DIR/specialization-broken.rs:19:5
-   |
-LL |     fn bar(&self) -> U {
-   |     ^^^^^^^^^^^^^^^^^^
-   |
-   = note: specialization behaves in inconsistent and surprising ways with `#![feature(return_position_impl_trait_in_trait)]`, and for now is disallowed
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0053`.
diff --git a/tests/ui/impl-trait/in-trait/specialization-broken.next.stderr b/tests/ui/impl-trait/in-trait/specialization-broken.next.stderr
deleted file mode 100644
index f48e7a1ed14..00000000000
--- a/tests/ui/impl-trait/in-trait/specialization-broken.next.stderr
+++ /dev/null
@@ -1,31 +0,0 @@
-error[E0053]: method `bar` has an incompatible type for trait
-  --> $DIR/specialization-broken.rs:19:22
-   |
-LL | default impl<U> Foo for U
-   |              - this type parameter
-...
-LL |     fn bar(&self) -> U {
-   |                      ^
-   |                      |
-   |                      expected associated type, found type parameter `U`
-   |                      help: change the output type to match the trait: `impl Sized`
-   |
-note: type in trait
-  --> $DIR/specialization-broken.rs:12:22
-   |
-LL |     fn bar(&self) -> impl Sized;
-   |                      ^^^^^^^^^^
-   = note: expected signature `fn(&U) -> impl Sized`
-              found signature `fn(&U) -> U`
-
-error: method with return-position `impl Trait` in trait cannot be specialized
-  --> $DIR/specialization-broken.rs:19:5
-   |
-LL |     fn bar(&self) -> U {
-   |     ^^^^^^^^^^^^^^^^^^
-   |
-   = note: specialization behaves in inconsistent and surprising ways with `#![feature(return_position_impl_trait_in_trait)]`, and for now is disallowed
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0053`.
diff --git a/tests/ui/impl-trait/in-trait/trait-more-generics-than-impl.current.stderr b/tests/ui/impl-trait/in-trait/trait-more-generics-than-impl.current.stderr
deleted file mode 100644
index 64c942705cf..00000000000
--- a/tests/ui/impl-trait/in-trait/trait-more-generics-than-impl.current.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-error[E0049]: method `bar` has 0 type parameters but its trait declaration has 1 type parameter
-  --> $DIR/trait-more-generics-than-impl.rs:14:11
-   |
-LL |     fn bar<T>() -> impl Sized;
-   |            - expected 1 type parameter
-...
-LL |     fn bar() -> impl Sized {}
-   |           ^ found 0 type parameters
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0049`.
diff --git a/tests/ui/impl-trait/in-trait/trait-more-generics-than-impl.next.stderr b/tests/ui/impl-trait/in-trait/trait-more-generics-than-impl.next.stderr
deleted file mode 100644
index 64c942705cf..00000000000
--- a/tests/ui/impl-trait/in-trait/trait-more-generics-than-impl.next.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-error[E0049]: method `bar` has 0 type parameters but its trait declaration has 1 type parameter
-  --> $DIR/trait-more-generics-than-impl.rs:14:11
-   |
-LL |     fn bar<T>() -> impl Sized;
-   |            - expected 1 type parameter
-...
-LL |     fn bar() -> impl Sized {}
-   |           ^ found 0 type parameters
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0049`.
diff --git a/tests/ui/impl-trait/in-trait/unconstrained-lt.current.stderr b/tests/ui/impl-trait/in-trait/unconstrained-lt.current.stderr
deleted file mode 100644
index bf088ae8b25..00000000000
--- a/tests/ui/impl-trait/in-trait/unconstrained-lt.current.stderr
+++ /dev/null
@@ -1,9 +0,0 @@
-error[E0207]: the lifetime parameter `'a` is not constrained by the impl trait, self type, or predicates
-  --> $DIR/unconstrained-lt.rs:10:6
-   |
-LL | impl<'a, T> Foo for T {
-   |      ^^ unconstrained lifetime parameter
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0207`.
diff --git a/tests/ui/impl-trait/in-trait/unconstrained-lt.next.stderr b/tests/ui/impl-trait/in-trait/unconstrained-lt.next.stderr
deleted file mode 100644
index bf088ae8b25..00000000000
--- a/tests/ui/impl-trait/in-trait/unconstrained-lt.next.stderr
+++ /dev/null
@@ -1,9 +0,0 @@
-error[E0207]: the lifetime parameter `'a` is not constrained by the impl trait, self type, or predicates
-  --> $DIR/unconstrained-lt.rs:10:6
-   |
-LL | impl<'a, T> Foo for T {
-   |      ^^ unconstrained lifetime parameter
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0207`.
diff --git a/tests/ui/impl-trait/in-trait/wf-bounds.current.stderr b/tests/ui/impl-trait/in-trait/wf-bounds.current.stderr
deleted file mode 100644
index 74c84c012b1..00000000000
--- a/tests/ui/impl-trait/in-trait/wf-bounds.current.stderr
+++ /dev/null
@@ -1,57 +0,0 @@
-error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
-  --> $DIR/wf-bounds.rs:17:22
-   |
-LL |     fn nya() -> impl Wf<Vec<[u8]>>;
-   |                      ^^^^^^^^^^^^^ doesn't have a size known at compile-time
-   |
-   = help: the trait `Sized` is not implemented for `[u8]`
-note: required by a bound in `Vec`
-  --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
-
-error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
-  --> $DIR/wf-bounds.rs:20:23
-   |
-LL |     fn nya2() -> impl Wf<[u8]>;
-   |                       ^^^^^^^^ doesn't have a size known at compile-time
-   |
-   = help: the trait `Sized` is not implemented for `[u8]`
-note: required by a bound in `Wf`
-  --> $DIR/wf-bounds.rs:10:10
-   |
-LL | trait Wf<T> {
-   |          ^ required by this bound in `Wf`
-help: consider relaxing the implicit `Sized` restriction
-   |
-LL | trait Wf<T: ?Sized> {
-   |           ++++++++
-
-error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
-  --> $DIR/wf-bounds.rs:23:44
-   |
-LL |     fn nya3() -> impl Wf<(), Output = impl Wf<Vec<[u8]>>>;
-   |                                            ^^^^^^^^^^^^^ doesn't have a size known at compile-time
-   |
-   = help: the trait `Sized` is not implemented for `[u8]`
-note: required by a bound in `Vec`
-  --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
-
-error[E0277]: `T` doesn't implement `std::fmt::Display`
-  --> $DIR/wf-bounds.rs:26:26
-   |
-LL |     fn nya4<T>() -> impl Wf<NeedsDisplay<T>>;
-   |                          ^^^^^^^^^^^^^^^^^^^ `T` cannot be formatted with the default formatter
-   |
-   = note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
-note: required by a bound in `NeedsDisplay`
-  --> $DIR/wf-bounds.rs:14:24
-   |
-LL | struct NeedsDisplay<T: Display>(T);
-   |                        ^^^^^^^ required by this bound in `NeedsDisplay`
-help: consider restricting type parameter `T`
-   |
-LL |     fn nya4<T: std::fmt::Display>() -> impl Wf<NeedsDisplay<T>>;
-   |              +++++++++++++++++++
-
-error: aborting due to 4 previous errors
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/impl-trait/in-trait/wf-bounds.next.stderr b/tests/ui/impl-trait/in-trait/wf-bounds.next.stderr
deleted file mode 100644
index 74c84c012b1..00000000000
--- a/tests/ui/impl-trait/in-trait/wf-bounds.next.stderr
+++ /dev/null
@@ -1,57 +0,0 @@
-error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
-  --> $DIR/wf-bounds.rs:17:22
-   |
-LL |     fn nya() -> impl Wf<Vec<[u8]>>;
-   |                      ^^^^^^^^^^^^^ doesn't have a size known at compile-time
-   |
-   = help: the trait `Sized` is not implemented for `[u8]`
-note: required by a bound in `Vec`
-  --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
-
-error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
-  --> $DIR/wf-bounds.rs:20:23
-   |
-LL |     fn nya2() -> impl Wf<[u8]>;
-   |                       ^^^^^^^^ doesn't have a size known at compile-time
-   |
-   = help: the trait `Sized` is not implemented for `[u8]`
-note: required by a bound in `Wf`
-  --> $DIR/wf-bounds.rs:10:10
-   |
-LL | trait Wf<T> {
-   |          ^ required by this bound in `Wf`
-help: consider relaxing the implicit `Sized` restriction
-   |
-LL | trait Wf<T: ?Sized> {
-   |           ++++++++
-
-error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
-  --> $DIR/wf-bounds.rs:23:44
-   |
-LL |     fn nya3() -> impl Wf<(), Output = impl Wf<Vec<[u8]>>>;
-   |                                            ^^^^^^^^^^^^^ doesn't have a size known at compile-time
-   |
-   = help: the trait `Sized` is not implemented for `[u8]`
-note: required by a bound in `Vec`
-  --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
-
-error[E0277]: `T` doesn't implement `std::fmt::Display`
-  --> $DIR/wf-bounds.rs:26:26
-   |
-LL |     fn nya4<T>() -> impl Wf<NeedsDisplay<T>>;
-   |                          ^^^^^^^^^^^^^^^^^^^ `T` cannot be formatted with the default formatter
-   |
-   = note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
-note: required by a bound in `NeedsDisplay`
-  --> $DIR/wf-bounds.rs:14:24
-   |
-LL | struct NeedsDisplay<T: Display>(T);
-   |                        ^^^^^^^ required by this bound in `NeedsDisplay`
-help: consider restricting type parameter `T`
-   |
-LL |     fn nya4<T: std::fmt::Display>() -> impl Wf<NeedsDisplay<T>>;
-   |              +++++++++++++++++++
-
-error: aborting due to 4 previous errors
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/impl-trait/mapping-duplicated-lifetimes-issue-114597.rs b/tests/ui/impl-trait/mapping-duplicated-lifetimes-issue-114597.rs
new file mode 100644
index 00000000000..a2dd0a9308d
--- /dev/null
+++ b/tests/ui/impl-trait/mapping-duplicated-lifetimes-issue-114597.rs
@@ -0,0 +1,15 @@
+// check-pass
+// issue: 114597
+// edition: 2021
+
+struct A<'a> {
+    dat: &'a (),
+}
+
+impl<'a> A<'a> {
+    async fn a(&self) -> impl Iterator<Item = std::iter::Repeat<()>> {
+        std::iter::repeat(()).map(|()| std::iter::repeat(()))
+    }
+}
+
+fn main() {}