about summary refs log tree commit diff
path: root/tests/ui/impl-trait
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2022-10-01 12:19:31 +0200
committerCamille GILLOT <gillot.camille@gmail.com>2023-01-27 18:58:13 +0000
commit9259da51edfb54a2dfb55a624005b7aa945cdcc6 (patch)
treeb8f92cdb007d194fa680e5af392b2d8bfa786e6c /tests/ui/impl-trait
parenta20078f044d42241e14437368e8e1d0f288aa7c0 (diff)
downloadrust-9259da51edfb54a2dfb55a624005b7aa945cdcc6.tar.gz
rust-9259da51edfb54a2dfb55a624005b7aa945cdcc6.zip
Test the 3 generator handling versions for generator/async tests.
Diffstat (limited to 'tests/ui/impl-trait')
-rw-r--r--tests/ui/impl-trait/issue-55872-2.drop_tracking.stderr8
-rw-r--r--tests/ui/impl-trait/issue-55872-2.drop_tracking_mir.stderr8
-rw-r--r--tests/ui/impl-trait/issue-55872-2.no_drop_tracking.stderr8
-rw-r--r--tests/ui/impl-trait/issue-55872-2.rs3
-rw-r--r--tests/ui/impl-trait/issue-55872-2.stderr2
-rw-r--r--tests/ui/impl-trait/recursive-impl-trait-type-indirect.drop_tracking.stderr (renamed from tests/ui/impl-trait/recursive-impl-trait-type-indirect.stderr)40
-rw-r--r--tests/ui/impl-trait/recursive-impl-trait-type-indirect.drop_tracking_mir.stderr152
-rw-r--r--tests/ui/impl-trait/recursive-impl-trait-type-indirect.no_drop_tracking.stderr152
-rw-r--r--tests/ui/impl-trait/recursive-impl-trait-type-indirect.rs4
9 files changed, 356 insertions, 21 deletions
diff --git a/tests/ui/impl-trait/issue-55872-2.drop_tracking.stderr b/tests/ui/impl-trait/issue-55872-2.drop_tracking.stderr
new file mode 100644
index 00000000000..477c964bd40
--- /dev/null
+++ b/tests/ui/impl-trait/issue-55872-2.drop_tracking.stderr
@@ -0,0 +1,8 @@
+error: type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias
+  --> $DIR/issue-55872-2.rs:17:9
+   |
+LL |         async {}
+   |         ^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/tests/ui/impl-trait/issue-55872-2.drop_tracking_mir.stderr b/tests/ui/impl-trait/issue-55872-2.drop_tracking_mir.stderr
new file mode 100644
index 00000000000..477c964bd40
--- /dev/null
+++ b/tests/ui/impl-trait/issue-55872-2.drop_tracking_mir.stderr
@@ -0,0 +1,8 @@
+error: type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias
+  --> $DIR/issue-55872-2.rs:17:9
+   |
+LL |         async {}
+   |         ^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/tests/ui/impl-trait/issue-55872-2.no_drop_tracking.stderr b/tests/ui/impl-trait/issue-55872-2.no_drop_tracking.stderr
new file mode 100644
index 00000000000..477c964bd40
--- /dev/null
+++ b/tests/ui/impl-trait/issue-55872-2.no_drop_tracking.stderr
@@ -0,0 +1,8 @@
+error: type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias
+  --> $DIR/issue-55872-2.rs:17:9
+   |
+LL |         async {}
+   |         ^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/tests/ui/impl-trait/issue-55872-2.rs b/tests/ui/impl-trait/issue-55872-2.rs
index 4443d3c4d0d..1696ead0d8d 100644
--- a/tests/ui/impl-trait/issue-55872-2.rs
+++ b/tests/ui/impl-trait/issue-55872-2.rs
@@ -1,3 +1,6 @@
+// revisions: no_drop_tracking drop_tracking drop_tracking_mir
+// [drop_tracking] compile-flags: -Zdrop-tracking
+// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir
 // edition:2018
 
 #![feature(type_alias_impl_trait)]
diff --git a/tests/ui/impl-trait/issue-55872-2.stderr b/tests/ui/impl-trait/issue-55872-2.stderr
index 11b8485c8bb..477c964bd40 100644
--- a/tests/ui/impl-trait/issue-55872-2.stderr
+++ b/tests/ui/impl-trait/issue-55872-2.stderr
@@ -1,5 +1,5 @@
 error: type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias
-  --> $DIR/issue-55872-2.rs:14:9
+  --> $DIR/issue-55872-2.rs:17:9
    |
 LL |         async {}
    |         ^^^^^^^^
diff --git a/tests/ui/impl-trait/recursive-impl-trait-type-indirect.stderr b/tests/ui/impl-trait/recursive-impl-trait-type-indirect.drop_tracking.stderr
index ebb231ae14f..43118ae3854 100644
--- a/tests/ui/impl-trait/recursive-impl-trait-type-indirect.stderr
+++ b/tests/ui/impl-trait/recursive-impl-trait-type-indirect.drop_tracking.stderr
@@ -1,5 +1,5 @@
 error[E0720]: cannot resolve opaque type
-  --> $DIR/recursive-impl-trait-type-indirect.rs:7:22
+  --> $DIR/recursive-impl-trait-type-indirect.rs:11:22
    |
 LL | fn option(i: i32) -> impl Sized {
    |                      ^^^^^^^^^^ recursive opaque type
@@ -10,7 +10,7 @@ LL |     if i < 0 { None } else { Some((option(i - 1), i)) }
    |                returning here with type `Option<(impl Sized, i32)>`
 
 error[E0720]: cannot resolve opaque type
-  --> $DIR/recursive-impl-trait-type-indirect.rs:12:15
+  --> $DIR/recursive-impl-trait-type-indirect.rs:16:15
    |
 LL | fn tuple() -> impl Sized {
    |               ^^^^^^^^^^ recursive opaque type
@@ -19,7 +19,7 @@ LL |     (tuple(),)
    |     ---------- returning here with type `(impl Sized,)`
 
 error[E0720]: cannot resolve opaque type
-  --> $DIR/recursive-impl-trait-type-indirect.rs:17:15
+  --> $DIR/recursive-impl-trait-type-indirect.rs:21:15
    |
 LL | fn array() -> impl Sized {
    |               ^^^^^^^^^^ recursive opaque type
@@ -28,7 +28,7 @@ LL |     [array()]
    |     --------- returning here with type `[impl Sized; 1]`
 
 error[E0720]: cannot resolve opaque type
-  --> $DIR/recursive-impl-trait-type-indirect.rs:22:13
+  --> $DIR/recursive-impl-trait-type-indirect.rs:26:13
    |
 LL | fn ptr() -> impl Sized {
    |             ^^^^^^^^^^ recursive opaque type
@@ -37,7 +37,7 @@ LL |     &ptr() as *const _
    |     ------------------ returning here with type `*const impl Sized`
 
 error[E0720]: cannot resolve opaque type
-  --> $DIR/recursive-impl-trait-type-indirect.rs:27:16
+  --> $DIR/recursive-impl-trait-type-indirect.rs:31:16
    |
 LL | fn fn_ptr() -> impl Sized {
    |                ^^^^^^^^^^ recursive opaque type
@@ -46,7 +46,7 @@ LL |     fn_ptr as fn() -> _
    |     ------------------- returning here with type `fn() -> impl Sized`
 
 error[E0720]: cannot resolve opaque type
-  --> $DIR/recursive-impl-trait-type-indirect.rs:32:25
+  --> $DIR/recursive-impl-trait-type-indirect.rs:36:25
    |
 LL |   fn closure_capture() -> impl Sized {
    |                           ^^^^^^^^^^ recursive opaque type
@@ -55,10 +55,10 @@ LL | /     move || {
 LL | |         x;
    | |         - closure captures itself here
 LL | |     }
-   | |_____- returning here with type `[closure@$DIR/recursive-impl-trait-type-indirect.rs:35:5: 35:12]`
+   | |_____- returning here with type `[closure@$DIR/recursive-impl-trait-type-indirect.rs:39:5: 39:12]`
 
 error[E0720]: cannot resolve opaque type
-  --> $DIR/recursive-impl-trait-type-indirect.rs:40:29
+  --> $DIR/recursive-impl-trait-type-indirect.rs:44:29
    |
 LL |   fn closure_ref_capture() -> impl Sized {
    |                               ^^^^^^^^^^ recursive opaque type
@@ -67,28 +67,28 @@ LL | /     move || {
 LL | |         &x;
    | |          - closure captures itself here
 LL | |     }
-   | |_____- returning here with type `[closure@$DIR/recursive-impl-trait-type-indirect.rs:43:5: 43:12]`
+   | |_____- returning here with type `[closure@$DIR/recursive-impl-trait-type-indirect.rs:47:5: 47:12]`
 
 error[E0720]: cannot resolve opaque type
-  --> $DIR/recursive-impl-trait-type-indirect.rs:48:21
+  --> $DIR/recursive-impl-trait-type-indirect.rs:52:21
    |
 LL | fn closure_sig() -> impl Sized {
    |                     ^^^^^^^^^^ recursive opaque type
 LL |
 LL |     || closure_sig()
-   |     ---------------- returning here with type `[closure@$DIR/recursive-impl-trait-type-indirect.rs:50:5: 50:7]`
+   |     ---------------- returning here with type `[closure@$DIR/recursive-impl-trait-type-indirect.rs:54:5: 54:7]`
 
 error[E0720]: cannot resolve opaque type
-  --> $DIR/recursive-impl-trait-type-indirect.rs:53:23
+  --> $DIR/recursive-impl-trait-type-indirect.rs:57:23
    |
 LL | fn generator_sig() -> impl Sized {
    |                       ^^^^^^^^^^ recursive opaque type
 LL |
 LL |     || generator_sig()
-   |     ------------------ returning here with type `[closure@$DIR/recursive-impl-trait-type-indirect.rs:55:5: 55:7]`
+   |     ------------------ returning here with type `[closure@$DIR/recursive-impl-trait-type-indirect.rs:59:5: 59:7]`
 
 error[E0720]: cannot resolve opaque type
-  --> $DIR/recursive-impl-trait-type-indirect.rs:58:27
+  --> $DIR/recursive-impl-trait-type-indirect.rs:62:27
    |
 LL |   fn generator_capture() -> impl Sized {
    |                             ^^^^^^^^^^ recursive opaque type
@@ -98,10 +98,10 @@ LL | |         yield;
 LL | |         x;
    | |         - generator captures itself here
 LL | |     }
-   | |_____- returning here with type `[generator@$DIR/recursive-impl-trait-type-indirect.rs:61:5: 61:12]`
+   | |_____- returning here with type `[generator@$DIR/recursive-impl-trait-type-indirect.rs:65:5: 65:12]`
 
 error[E0720]: cannot resolve opaque type
-  --> $DIR/recursive-impl-trait-type-indirect.rs:67:35
+  --> $DIR/recursive-impl-trait-type-indirect.rs:71:35
    |
 LL | fn substs_change<T: 'static>() -> impl Sized {
    |                                   ^^^^^^^^^^ recursive opaque type
@@ -110,7 +110,7 @@ LL |     (substs_change::<&T>(),)
    |     ------------------------ returning here with type `(impl Sized,)`
 
 error[E0720]: cannot resolve opaque type
-  --> $DIR/recursive-impl-trait-type-indirect.rs:72:24
+  --> $DIR/recursive-impl-trait-type-indirect.rs:76:24
    |
 LL |   fn generator_hold() -> impl Sized {
    |                          ^^^^^^^^^^ recursive opaque type
@@ -121,10 +121,10 @@ LL | |         let x = generator_hold();
 LL | |         yield;
 LL | |         x;
 LL | |     }
-   | |_____- returning here with type `[generator@$DIR/recursive-impl-trait-type-indirect.rs:74:5: 74:12]`
+   | |_____- returning here with type `[generator@$DIR/recursive-impl-trait-type-indirect.rs:78:5: 78:12]`
 
 error[E0720]: cannot resolve opaque type
-  --> $DIR/recursive-impl-trait-type-indirect.rs:86:26
+  --> $DIR/recursive-impl-trait-type-indirect.rs:90:26
    |
 LL | fn mutual_recursion() -> impl Sync {
    |                          ^^^^^^^^^ recursive opaque type
@@ -136,7 +136,7 @@ LL | fn mutual_recursion_b() -> impl Sized {
    |                            ---------- returning this opaque type `impl Sized`
 
 error[E0720]: cannot resolve opaque type
-  --> $DIR/recursive-impl-trait-type-indirect.rs:91:28
+  --> $DIR/recursive-impl-trait-type-indirect.rs:95:28
    |
 LL | fn mutual_recursion() -> impl Sync {
    |                          --------- returning this opaque type `impl Sync`
diff --git a/tests/ui/impl-trait/recursive-impl-trait-type-indirect.drop_tracking_mir.stderr b/tests/ui/impl-trait/recursive-impl-trait-type-indirect.drop_tracking_mir.stderr
new file mode 100644
index 00000000000..43118ae3854
--- /dev/null
+++ b/tests/ui/impl-trait/recursive-impl-trait-type-indirect.drop_tracking_mir.stderr
@@ -0,0 +1,152 @@
+error[E0720]: cannot resolve opaque type
+  --> $DIR/recursive-impl-trait-type-indirect.rs:11:22
+   |
+LL | fn option(i: i32) -> impl Sized {
+   |                      ^^^^^^^^^^ recursive opaque type
+LL |
+LL |     if i < 0 { None } else { Some((option(i - 1), i)) }
+   |                ----          ------------------------ returning here with type `Option<(impl Sized, i32)>`
+   |                |
+   |                returning here with type `Option<(impl Sized, i32)>`
+
+error[E0720]: cannot resolve opaque type
+  --> $DIR/recursive-impl-trait-type-indirect.rs:16:15
+   |
+LL | fn tuple() -> impl Sized {
+   |               ^^^^^^^^^^ recursive opaque type
+LL |
+LL |     (tuple(),)
+   |     ---------- returning here with type `(impl Sized,)`
+
+error[E0720]: cannot resolve opaque type
+  --> $DIR/recursive-impl-trait-type-indirect.rs:21:15
+   |
+LL | fn array() -> impl Sized {
+   |               ^^^^^^^^^^ recursive opaque type
+LL |
+LL |     [array()]
+   |     --------- returning here with type `[impl Sized; 1]`
+
+error[E0720]: cannot resolve opaque type
+  --> $DIR/recursive-impl-trait-type-indirect.rs:26:13
+   |
+LL | fn ptr() -> impl Sized {
+   |             ^^^^^^^^^^ recursive opaque type
+LL |
+LL |     &ptr() as *const _
+   |     ------------------ returning here with type `*const impl Sized`
+
+error[E0720]: cannot resolve opaque type
+  --> $DIR/recursive-impl-trait-type-indirect.rs:31:16
+   |
+LL | fn fn_ptr() -> impl Sized {
+   |                ^^^^^^^^^^ recursive opaque type
+LL |
+LL |     fn_ptr as fn() -> _
+   |     ------------------- returning here with type `fn() -> impl Sized`
+
+error[E0720]: cannot resolve opaque type
+  --> $DIR/recursive-impl-trait-type-indirect.rs:36:25
+   |
+LL |   fn closure_capture() -> impl Sized {
+   |                           ^^^^^^^^^^ recursive opaque type
+...
+LL | /     move || {
+LL | |         x;
+   | |         - closure captures itself here
+LL | |     }
+   | |_____- returning here with type `[closure@$DIR/recursive-impl-trait-type-indirect.rs:39:5: 39:12]`
+
+error[E0720]: cannot resolve opaque type
+  --> $DIR/recursive-impl-trait-type-indirect.rs:44:29
+   |
+LL |   fn closure_ref_capture() -> impl Sized {
+   |                               ^^^^^^^^^^ recursive opaque type
+...
+LL | /     move || {
+LL | |         &x;
+   | |          - closure captures itself here
+LL | |     }
+   | |_____- returning here with type `[closure@$DIR/recursive-impl-trait-type-indirect.rs:47:5: 47:12]`
+
+error[E0720]: cannot resolve opaque type
+  --> $DIR/recursive-impl-trait-type-indirect.rs:52:21
+   |
+LL | fn closure_sig() -> impl Sized {
+   |                     ^^^^^^^^^^ recursive opaque type
+LL |
+LL |     || closure_sig()
+   |     ---------------- returning here with type `[closure@$DIR/recursive-impl-trait-type-indirect.rs:54:5: 54:7]`
+
+error[E0720]: cannot resolve opaque type
+  --> $DIR/recursive-impl-trait-type-indirect.rs:57:23
+   |
+LL | fn generator_sig() -> impl Sized {
+   |                       ^^^^^^^^^^ recursive opaque type
+LL |
+LL |     || generator_sig()
+   |     ------------------ returning here with type `[closure@$DIR/recursive-impl-trait-type-indirect.rs:59:5: 59:7]`
+
+error[E0720]: cannot resolve opaque type
+  --> $DIR/recursive-impl-trait-type-indirect.rs:62:27
+   |
+LL |   fn generator_capture() -> impl Sized {
+   |                             ^^^^^^^^^^ recursive opaque type
+...
+LL | /     move || {
+LL | |         yield;
+LL | |         x;
+   | |         - generator captures itself here
+LL | |     }
+   | |_____- returning here with type `[generator@$DIR/recursive-impl-trait-type-indirect.rs:65:5: 65:12]`
+
+error[E0720]: cannot resolve opaque type
+  --> $DIR/recursive-impl-trait-type-indirect.rs:71:35
+   |
+LL | fn substs_change<T: 'static>() -> impl Sized {
+   |                                   ^^^^^^^^^^ recursive opaque type
+LL |
+LL |     (substs_change::<&T>(),)
+   |     ------------------------ returning here with type `(impl Sized,)`
+
+error[E0720]: cannot resolve opaque type
+  --> $DIR/recursive-impl-trait-type-indirect.rs:76:24
+   |
+LL |   fn generator_hold() -> impl Sized {
+   |                          ^^^^^^^^^^ recursive opaque type
+LL |
+LL | /     move || {
+LL | |         let x = generator_hold();
+   | |             - generator captures itself here
+LL | |         yield;
+LL | |         x;
+LL | |     }
+   | |_____- returning here with type `[generator@$DIR/recursive-impl-trait-type-indirect.rs:78:5: 78:12]`
+
+error[E0720]: cannot resolve opaque type
+  --> $DIR/recursive-impl-trait-type-indirect.rs:90:26
+   |
+LL | fn mutual_recursion() -> impl Sync {
+   |                          ^^^^^^^^^ recursive opaque type
+LL |
+LL |     mutual_recursion_b()
+   |     -------------------- returning here with type `impl Sized`
+...
+LL | fn mutual_recursion_b() -> impl Sized {
+   |                            ---------- returning this opaque type `impl Sized`
+
+error[E0720]: cannot resolve opaque type
+  --> $DIR/recursive-impl-trait-type-indirect.rs:95:28
+   |
+LL | fn mutual_recursion() -> impl Sync {
+   |                          --------- returning this opaque type `impl Sync`
+...
+LL | fn mutual_recursion_b() -> impl Sized {
+   |                            ^^^^^^^^^^ recursive opaque type
+LL |
+LL |     mutual_recursion()
+   |     ------------------ returning here with type `impl Sync`
+
+error: aborting due to 14 previous errors
+
+For more information about this error, try `rustc --explain E0720`.
diff --git a/tests/ui/impl-trait/recursive-impl-trait-type-indirect.no_drop_tracking.stderr b/tests/ui/impl-trait/recursive-impl-trait-type-indirect.no_drop_tracking.stderr
new file mode 100644
index 00000000000..43118ae3854
--- /dev/null
+++ b/tests/ui/impl-trait/recursive-impl-trait-type-indirect.no_drop_tracking.stderr
@@ -0,0 +1,152 @@
+error[E0720]: cannot resolve opaque type
+  --> $DIR/recursive-impl-trait-type-indirect.rs:11:22
+   |
+LL | fn option(i: i32) -> impl Sized {
+   |                      ^^^^^^^^^^ recursive opaque type
+LL |
+LL |     if i < 0 { None } else { Some((option(i - 1), i)) }
+   |                ----          ------------------------ returning here with type `Option<(impl Sized, i32)>`
+   |                |
+   |                returning here with type `Option<(impl Sized, i32)>`
+
+error[E0720]: cannot resolve opaque type
+  --> $DIR/recursive-impl-trait-type-indirect.rs:16:15
+   |
+LL | fn tuple() -> impl Sized {
+   |               ^^^^^^^^^^ recursive opaque type
+LL |
+LL |     (tuple(),)
+   |     ---------- returning here with type `(impl Sized,)`
+
+error[E0720]: cannot resolve opaque type
+  --> $DIR/recursive-impl-trait-type-indirect.rs:21:15
+   |
+LL | fn array() -> impl Sized {
+   |               ^^^^^^^^^^ recursive opaque type
+LL |
+LL |     [array()]
+   |     --------- returning here with type `[impl Sized; 1]`
+
+error[E0720]: cannot resolve opaque type
+  --> $DIR/recursive-impl-trait-type-indirect.rs:26:13
+   |
+LL | fn ptr() -> impl Sized {
+   |             ^^^^^^^^^^ recursive opaque type
+LL |
+LL |     &ptr() as *const _
+   |     ------------------ returning here with type `*const impl Sized`
+
+error[E0720]: cannot resolve opaque type
+  --> $DIR/recursive-impl-trait-type-indirect.rs:31:16
+   |
+LL | fn fn_ptr() -> impl Sized {
+   |                ^^^^^^^^^^ recursive opaque type
+LL |
+LL |     fn_ptr as fn() -> _
+   |     ------------------- returning here with type `fn() -> impl Sized`
+
+error[E0720]: cannot resolve opaque type
+  --> $DIR/recursive-impl-trait-type-indirect.rs:36:25
+   |
+LL |   fn closure_capture() -> impl Sized {
+   |                           ^^^^^^^^^^ recursive opaque type
+...
+LL | /     move || {
+LL | |         x;
+   | |         - closure captures itself here
+LL | |     }
+   | |_____- returning here with type `[closure@$DIR/recursive-impl-trait-type-indirect.rs:39:5: 39:12]`
+
+error[E0720]: cannot resolve opaque type
+  --> $DIR/recursive-impl-trait-type-indirect.rs:44:29
+   |
+LL |   fn closure_ref_capture() -> impl Sized {
+   |                               ^^^^^^^^^^ recursive opaque type
+...
+LL | /     move || {
+LL | |         &x;
+   | |          - closure captures itself here
+LL | |     }
+   | |_____- returning here with type `[closure@$DIR/recursive-impl-trait-type-indirect.rs:47:5: 47:12]`
+
+error[E0720]: cannot resolve opaque type
+  --> $DIR/recursive-impl-trait-type-indirect.rs:52:21
+   |
+LL | fn closure_sig() -> impl Sized {
+   |                     ^^^^^^^^^^ recursive opaque type
+LL |
+LL |     || closure_sig()
+   |     ---------------- returning here with type `[closure@$DIR/recursive-impl-trait-type-indirect.rs:54:5: 54:7]`
+
+error[E0720]: cannot resolve opaque type
+  --> $DIR/recursive-impl-trait-type-indirect.rs:57:23
+   |
+LL | fn generator_sig() -> impl Sized {
+   |                       ^^^^^^^^^^ recursive opaque type
+LL |
+LL |     || generator_sig()
+   |     ------------------ returning here with type `[closure@$DIR/recursive-impl-trait-type-indirect.rs:59:5: 59:7]`
+
+error[E0720]: cannot resolve opaque type
+  --> $DIR/recursive-impl-trait-type-indirect.rs:62:27
+   |
+LL |   fn generator_capture() -> impl Sized {
+   |                             ^^^^^^^^^^ recursive opaque type
+...
+LL | /     move || {
+LL | |         yield;
+LL | |         x;
+   | |         - generator captures itself here
+LL | |     }
+   | |_____- returning here with type `[generator@$DIR/recursive-impl-trait-type-indirect.rs:65:5: 65:12]`
+
+error[E0720]: cannot resolve opaque type
+  --> $DIR/recursive-impl-trait-type-indirect.rs:71:35
+   |
+LL | fn substs_change<T: 'static>() -> impl Sized {
+   |                                   ^^^^^^^^^^ recursive opaque type
+LL |
+LL |     (substs_change::<&T>(),)
+   |     ------------------------ returning here with type `(impl Sized,)`
+
+error[E0720]: cannot resolve opaque type
+  --> $DIR/recursive-impl-trait-type-indirect.rs:76:24
+   |
+LL |   fn generator_hold() -> impl Sized {
+   |                          ^^^^^^^^^^ recursive opaque type
+LL |
+LL | /     move || {
+LL | |         let x = generator_hold();
+   | |             - generator captures itself here
+LL | |         yield;
+LL | |         x;
+LL | |     }
+   | |_____- returning here with type `[generator@$DIR/recursive-impl-trait-type-indirect.rs:78:5: 78:12]`
+
+error[E0720]: cannot resolve opaque type
+  --> $DIR/recursive-impl-trait-type-indirect.rs:90:26
+   |
+LL | fn mutual_recursion() -> impl Sync {
+   |                          ^^^^^^^^^ recursive opaque type
+LL |
+LL |     mutual_recursion_b()
+   |     -------------------- returning here with type `impl Sized`
+...
+LL | fn mutual_recursion_b() -> impl Sized {
+   |                            ---------- returning this opaque type `impl Sized`
+
+error[E0720]: cannot resolve opaque type
+  --> $DIR/recursive-impl-trait-type-indirect.rs:95:28
+   |
+LL | fn mutual_recursion() -> impl Sync {
+   |                          --------- returning this opaque type `impl Sync`
+...
+LL | fn mutual_recursion_b() -> impl Sized {
+   |                            ^^^^^^^^^^ recursive opaque type
+LL |
+LL |     mutual_recursion()
+   |     ------------------ returning here with type `impl Sync`
+
+error: aborting due to 14 previous errors
+
+For more information about this error, try `rustc --explain E0720`.
diff --git a/tests/ui/impl-trait/recursive-impl-trait-type-indirect.rs b/tests/ui/impl-trait/recursive-impl-trait-type-indirect.rs
index ffc0cd9d10c..630372e13ed 100644
--- a/tests/ui/impl-trait/recursive-impl-trait-type-indirect.rs
+++ b/tests/ui/impl-trait/recursive-impl-trait-type-indirect.rs
@@ -1,3 +1,7 @@
+// revisions: no_drop_tracking drop_tracking drop_tracking_mir
+// [drop_tracking] compile-flags: -Zdrop-tracking
+// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir
+
 // Test that impl trait does not allow creating recursive types that are
 // otherwise forbidden.