about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-10-12 06:57:24 +0000
committerbors <bors@rust-lang.org>2022-10-12 06:57:24 +0000
commite6ce5627a9e8af9ae4673a390954fffaf526e5cc (patch)
treea7787f3dd60a56b679bd953185cf48229c971d41 /src/test
parent2b91cbe2d4ce90d30520674876e9d700cf7a561b (diff)
parent96bcced390ee149436bab890b70821ff34912b53 (diff)
Auto merge of #102948 - Dylan-DPC:rollup-j8h74rb, r=Dylan-DPC
Rollup of 8 pull requests

Successful merges:

 - #102110 (Migrate rustc_passes diagnostics)
 - #102187 (Use correct location for type tests in promoted constants)
 - #102239 (Move style guide to rust-lang/rust)
 - #102578 (Panic for invalid arguments of `{integer primitive}::ilog{,2,10}` in all modes)
 - #102811 (Use memset to initialize readbuf)
 - #102890 (Check representability in adt_sized_constraint)
 - #102913 (unify `IsPattern` and `IsImport` enum in `show_candidates`)
 - #102924 (rustdoc: remove unused classes from sidebar links)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'src/test')
-rw-r--r--src/test/rustdoc-gui/sidebar-links-color.goml126
-rw-r--r--src/test/rustdoc-gui/sidebar-macro-reexport.goml2
-rw-r--r--src/test/rustdoc-ui/infinite-recursive-type-impl-trait-return.rs3
-rw-r--r--src/test/rustdoc-ui/infinite-recursive-type-impl-trait-return.stderr17
-rw-r--r--src/test/rustdoc-ui/infinite-recursive-type-impl-trait.rs4
-rw-r--r--src/test/rustdoc-ui/infinite-recursive-type-impl-trait.stderr17
-rw-r--r--src/test/ui/associated-types/issue-85103.rs2
-rw-r--r--src/test/ui/associated-types/issue-85103.stderr2
-rw-r--r--src/test/ui/consts/issue-102117.rs30
-rw-r--r--src/test/ui/consts/issue-102117.stderr37
-rw-r--r--src/test/ui/issues/issue-72554.rs1
-rw-r--r--src/test/ui/issues/issue-72554.stderr20
-rw-r--r--src/test/ui/variance/variance-regions-unused-indirect.rs1
-rw-r--r--src/test/ui/variance/variance-regions-unused-indirect.stderr30
14 files changed, 169 insertions, 123 deletions
diff --git a/src/test/rustdoc-gui/sidebar-links-color.goml b/src/test/rustdoc-gui/sidebar-links-color.goml
index 3f719c4c4dc..18a1a3fadea 100644
--- a/src/test/rustdoc-gui/sidebar-links-color.goml
+++ b/src/test/rustdoc-gui/sidebar-links-color.goml
@@ -13,72 +13,72 @@ reload:
 
 // Struct
 assert-css: (
-    ".sidebar a.struct:not(.current)",
+    ".sidebar .block.struct a:not(.current)",
     {"color": "rgb(83, 177, 219)", "background-color": "rgba(0, 0, 0, 0)"},
 )
-move-cursor-to: ".sidebar a.struct:not(.current)"
+move-cursor-to: ".sidebar .block.struct a:not(.current)"
 assert-css: (
-    ".sidebar a.struct:hover",
+    ".sidebar .block.struct a:hover",
     {"color": "rgb(255, 180, 76)", "background-color": "rgba(0, 0, 0, 0)"},
 )
 // Enum
 assert-css: (
-    ".sidebar a.enum",
+    ".sidebar .block.enum a",
     {"color": "rgb(83, 177, 219)", "background-color": "rgba(0, 0, 0, 0)"},
 )
-move-cursor-to: ".sidebar a.enum"
+move-cursor-to: ".sidebar .block.enum a"
 assert-css: (
-    ".sidebar a.enum:hover",
+    ".sidebar .block.enum a:hover",
     {"color": "rgb(255, 180, 76)", "background-color": "rgba(0, 0, 0, 0)"},
 )
 // Union
 assert-css: (
-    ".sidebar a.union",
+    ".sidebar .block.union a",
     {"color": "rgb(83, 177, 219)", "background-color": "rgba(0, 0, 0, 0)"},
 )
-move-cursor-to: ".sidebar a.union"
+move-cursor-to: ".sidebar .block.union a"
 assert-css: (
-    ".sidebar a.union:hover",
+    ".sidebar .block.union a:hover",
     {"color": "rgb(255, 180, 76)", "background-color": "rgba(0, 0, 0, 0)"},
 )
 // Trait
 assert-css: (
-    ".sidebar a.trait",
+    ".sidebar .block.trait a",
     {"color": "rgb(83, 177, 219)", "background-color": "rgba(0, 0, 0, 0)"},
 )
-move-cursor-to: ".sidebar a.trait"
+move-cursor-to: ".sidebar .block.trait a"
 assert-css: (
-    ".sidebar a.trait:hover",
+    ".sidebar .block.trait a:hover",
     {"color": "rgb(255, 180, 76)", "background-color": "rgba(0, 0, 0, 0)"},
 )
 // Function
 assert-css: (
-    ".sidebar a.fn",
+    ".sidebar .block.fn a",
     {"color": "rgb(83, 177, 219)", "background-color": "rgba(0, 0, 0, 0)"},
 )
-move-cursor-to: ".sidebar a.fn"
+move-cursor-to: ".sidebar .block.fn a"
 assert-css: (
-    ".sidebar a.fn:hover",
+    ".sidebar .block.fn a:hover",
     {"color": "rgb(255, 180, 76)", "background-color": "rgba(0, 0, 0, 0)"},
 )
 // Type definition
 assert-css: (
-    ".sidebar a.type",
+    ".sidebar .block.type a",
     {"color": "rgb(83, 177, 219)", "background-color": "rgba(0, 0, 0, 0)"},
 )
-move-cursor-to: ".sidebar a.type"
+move-cursor-to: ".sidebar .block.type a"
 assert-css: (
-    ".sidebar a.type:hover",
+    ".sidebar .block.type a:hover",
     {"color": "rgb(255, 180, 76)", "background-color": "rgba(0, 0, 0, 0)"},
 )
 // Keyword
 assert-css: (
-    ".sidebar a.keyword",
+    ".sidebar .block.keyword a",
     {"color": "rgb(83, 177, 219)", "background-color": "rgba(0, 0, 0, 0)"},
 )
-move-cursor-to: ".sidebar a.keyword"
+move-cursor-to: ".sidebar .block.keyword a"
 assert-css: (
-    ".sidebar a.keyword:hover",
+    ".sidebar .block.keyword a:hover",
     {"color": "rgb(255, 180, 76)", "background-color": "rgba(0, 0, 0, 0)"},
 )
 
@@ -88,72 +88,72 @@ reload:
 
 // Struct
 assert-css: (
-    ".sidebar a.struct:not(.current)",
+    ".sidebar .block.struct a:not(.current)",
     {"color": "rgb(253, 191, 53)", "background-color": "rgba(0, 0, 0, 0)"},
 )
-move-cursor-to: ".sidebar a.struct:not(.current)"
+move-cursor-to: ".sidebar .block.struct a:not(.current)"
 assert-css: (
-    ".sidebar a.struct:hover",
+    ".sidebar .block.struct a:hover",
     {"color": "rgb(253, 191, 53)", "background-color": "rgb(68, 68, 68)"},
 )
 // Enum
 assert-css: (
-    ".sidebar a.enum",
+    ".sidebar .block.enum a",
     {"color": "rgb(253, 191, 53)", "background-color": "rgba(0, 0, 0, 0)"},
 )
-move-cursor-to: ".sidebar a.enum"
+move-cursor-to: ".sidebar .block.enum a"
 assert-css: (
-    ".sidebar a.enum:hover",
+    ".sidebar .block.enum a:hover",
     {"color": "rgb(253, 191, 53)", "background-color": "rgb(68, 68, 68)"},
 )
 // Union
 assert-css: (
-    ".sidebar a.union",
+    ".sidebar .block.union a",
     {"color": "rgb(253, 191, 53)", "background-color": "rgba(0, 0, 0, 0)"},
 )
-move-cursor-to: ".sidebar a.union"
+move-cursor-to: ".sidebar .block.union a"
 assert-css: (
-    ".sidebar a.union:hover",
+    ".sidebar .block.union a:hover",
     {"color": "rgb(253, 191, 53)", "background-color": "rgb(68, 68, 68)"},
 )
 // Trait
 assert-css: (
-    ".sidebar a.trait",
+    ".sidebar .block.trait a",
     {"color": "rgb(253, 191, 53)", "background-color": "rgba(0, 0, 0, 0)"},
 )
-move-cursor-to: ".sidebar a.trait"
+move-cursor-to: ".sidebar .block.trait a"
 assert-css: (
-    ".sidebar a.trait:hover",
+    ".sidebar .block.trait a:hover",
     {"color": "rgb(253, 191, 53)", "background-color": "rgb(68, 68, 68)"},
 )
 // Function
 assert-css: (
-    ".sidebar a.fn",
+    ".sidebar .block.fn a",
     {"color": "rgb(253, 191, 53)", "background-color": "rgba(0, 0, 0, 0)"},
 )
-move-cursor-to: ".sidebar a.fn"
+move-cursor-to: ".sidebar .block.fn a"
 assert-css: (
-    ".sidebar a.fn:hover",
+    ".sidebar .block.fn a:hover",
     {"color": "rgb(253, 191, 53)", "background-color": "rgb(68, 68, 68)"},
 )
 // Type definition
 assert-css: (
-    ".sidebar a.type",
+    ".sidebar .block.type a",
     {"color": "rgb(253, 191, 53)", "background-color": "rgba(0, 0, 0, 0)"},
 )
-move-cursor-to: ".sidebar a.type"
+move-cursor-to: ".sidebar .block.type a"
 assert-css: (
-    ".sidebar a.type:hover",
+    ".sidebar .block.type a:hover",
     {"color": "rgb(253, 191, 53)", "background-color": "rgb(68, 68, 68)"},
 )
 // Keyword
 assert-css: (
-    ".sidebar a.keyword",
+    ".sidebar .block.keyword a",
     {"color": "rgb(253, 191, 53)", "background-color": "rgba(0, 0, 0, 0)"},
 )
-move-cursor-to: ".sidebar a.keyword"
+move-cursor-to: ".sidebar .block.keyword a"
 assert-css: (
-    ".sidebar a.keyword:hover",
+    ".sidebar .block.keyword a:hover",
     {"color": "rgb(253, 191, 53)", "background-color": "rgb(68, 68, 68)"},
 )
 
@@ -163,71 +163,71 @@ reload:
 
 // Struct
 assert-css: (
-    ".sidebar a.struct:not(.current)",
+    ".sidebar .block.struct a:not(.current)",
     {"color": "rgb(53, 109, 164)", "background-color": "rgba(0, 0, 0, 0)"},
 )
-move-cursor-to: ".sidebar a.struct:not(.current)"
+move-cursor-to: ".sidebar .block.struct a:not(.current)"
 assert-css: (
-    ".sidebar a.struct:hover",
+    ".sidebar .block.struct a:hover",
     {"color": "rgb(53, 109, 164)", "background-color": "rgb(255, 255, 255)"},
 )
 // Enum
 assert-css: (
-    ".sidebar a.enum",
+    ".sidebar .block.enum a",
     {"color": "rgb(53, 109, 164)", "background-color": "rgba(0, 0, 0, 0)"},
 )
-move-cursor-to: ".sidebar a.enum"
+move-cursor-to: ".sidebar .block.enum a"
 assert-css: (
-    ".sidebar a.enum:hover",
+    ".sidebar .block.enum a:hover",
     {"color": "rgb(53, 109, 164)", "background-color": "rgb(255, 255, 255)"},
 )
 // Union
 assert-css: (
-    ".sidebar a.union",
+    ".sidebar .block.union a",
     {"color": "rgb(53, 109, 164)", "background-color": "rgba(0, 0, 0, 0)"},
 )
-move-cursor-to: ".sidebar a.union"
+move-cursor-to: ".sidebar .block.union a"
 assert-css: (
-    ".sidebar a.union:hover",
+    ".sidebar .block.union a:hover",
     {"color": "rgb(53, 109, 164)", "background-color": "rgb(255, 255, 255)"},
 )
 // Trait
 assert-css: (
-    ".sidebar a.trait",
+    ".sidebar .block.trait a",
     {"color": "rgb(53, 109, 164)", "background-color": "rgba(0, 0, 0, 0)"},
 )
-move-cursor-to: ".sidebar a.trait"
+move-cursor-to: ".sidebar .block.trait a"
 assert-css: (
-    ".sidebar a.trait:hover",
+    ".sidebar .block.trait a:hover",
     {"color": "rgb(53, 109, 164)", "background-color": "rgb(255, 255, 255)"},
 )
 // Function
 assert-css: (
-    ".sidebar a.fn",
+    ".sidebar .block.fn a",
     {"color": "rgb(53, 109, 164)", "background-color": "rgba(0, 0, 0, 0)"},
 )
-move-cursor-to: ".sidebar a.fn"
+move-cursor-to: ".sidebar .block.fn a"
 assert-css: (
-    ".sidebar a.fn:hover",
+    ".sidebar .block.fn a:hover",
     {"color": "rgb(53, 109, 164)", "background-color": "rgb(255, 255, 255)"},
 )
 // Type definition
 assert-css: (
-    ".sidebar a.type",
+    ".sidebar .block.type a",
     {"color": "rgb(53, 109, 164)", "background-color": "rgba(0, 0, 0, 0)"},
 )
-move-cursor-to: ".sidebar a.type"
+move-cursor-to: ".sidebar .block.type a"
 assert-css: (
-    ".sidebar a.type:hover",
+    ".sidebar .block.type a:hover",
     {"color": "rgb(53, 109, 164)", "background-color": "rgb(255, 255, 255)"},
 )
 // Keyword
 assert-css: (
-    ".sidebar a.keyword",
+    ".sidebar .block.keyword a",
     {"color": "rgb(53, 109, 164)", "background-color": "rgba(0, 0, 0, 0)"},
 )
-move-cursor-to: ".sidebar a.keyword"
+move-cursor-to: ".sidebar .block.keyword a"
 assert-css: (
-    ".sidebar a.keyword:hover",
+    ".sidebar .block.keyword a:hover",
     {"color": "rgb(53, 109, 164)", "background-color": "rgb(255, 255, 255)"},
 )
diff --git a/src/test/rustdoc-gui/sidebar-macro-reexport.goml b/src/test/rustdoc-gui/sidebar-macro-reexport.goml
index 01282f2ffeb..b5c1b6a4390 100644
--- a/src/test/rustdoc-gui/sidebar-macro-reexport.goml
+++ b/src/test/rustdoc-gui/sidebar-macro-reexport.goml
@@ -1,5 +1,5 @@
 // This test ensures that the reexport of a macro doesn't make the original macro
 // displayed twice in the sidebar.
 goto: "file://" + |DOC_PATH| + "/test_docs/macro.repro.html"
-wait-for: ".sidebar-elems .macro .macro"
+wait-for: ".sidebar-elems .block.macro a"
 assert-count: ("//*[@class='sidebar-elems']//*[@class='block macro']//a[text()='repro']", 1)
diff --git a/src/test/rustdoc-ui/infinite-recursive-type-impl-trait-return.rs b/src/test/rustdoc-ui/infinite-recursive-type-impl-trait-return.rs
index 2319de55683..4b1e04234c8 100644
--- a/src/test/rustdoc-ui/infinite-recursive-type-impl-trait-return.rs
+++ b/src/test/rustdoc-ui/infinite-recursive-type-impl-trait-return.rs
@@ -1,11 +1,12 @@
+// check-pass
 // normalize-stderr-test: "`.*`" -> "`DEF_ID`"
 // normalize-stdout-test: "`.*`" -> "`DEF_ID`"
 // edition:2018
 
 pub async fn f() -> impl std::fmt::Debug {
+    // rustdoc doesn't care that this is infinitely sized
     #[derive(Debug)]
     enum E {
-    //~^ ERROR recursive type `f::{closure#0}::E` has infinite size
         This(E),
         Unit,
     }
diff --git a/src/test/rustdoc-ui/infinite-recursive-type-impl-trait-return.stderr b/src/test/rustdoc-ui/infinite-recursive-type-impl-trait-return.stderr
deleted file mode 100644
index e6ab67d59ce..00000000000
--- a/src/test/rustdoc-ui/infinite-recursive-type-impl-trait-return.stderr
+++ /dev/null
@@ -1,17 +0,0 @@
-error[E0072]: recursive type `DEF_ID` has infinite size
-  --> $DIR/infinite-recursive-type-impl-trait-return.rs:7:5
-   |
-LL |     enum E {
-   |     ^^^^^^
-LL |
-LL |         This(E),
-   |              - recursive without indirection
-   |
-help: insert some indirection (e.g., a `DEF_ID`) to break the cycle
-   |
-LL |         This(Box<E>),
-   |              ++++ +
-
-error: aborting due to previous error
-
-For more information about this error, try `DEF_ID`.
diff --git a/src/test/rustdoc-ui/infinite-recursive-type-impl-trait.rs b/src/test/rustdoc-ui/infinite-recursive-type-impl-trait.rs
index b3a7ee56313..ac79582fb3f 100644
--- a/src/test/rustdoc-ui/infinite-recursive-type-impl-trait.rs
+++ b/src/test/rustdoc-ui/infinite-recursive-type-impl-trait.rs
@@ -1,6 +1,8 @@
+// check-pass
+
 fn f() -> impl Sized {
+    // rustdoc doesn't care that this is infinitely sized
     enum E {
-    //~^ ERROR recursive type `f::E` has infinite size
         V(E),
     }
     unimplemented!()
diff --git a/src/test/rustdoc-ui/infinite-recursive-type-impl-trait.stderr b/src/test/rustdoc-ui/infinite-recursive-type-impl-trait.stderr
deleted file mode 100644
index 165ff678372..00000000000
--- a/src/test/rustdoc-ui/infinite-recursive-type-impl-trait.stderr
+++ /dev/null
@@ -1,17 +0,0 @@
-error[E0072]: recursive type `f::E` has infinite size
-  --> $DIR/infinite-recursive-type-impl-trait.rs:2:5
-   |
-LL |     enum E {
-   |     ^^^^^^
-LL |
-LL |         V(E),
-   |           - recursive without indirection
-   |
-help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
-   |
-LL |         V(Box<E>),
-   |           ++++ +
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0072`.
diff --git a/src/test/ui/associated-types/issue-85103.rs b/src/test/ui/associated-types/issue-85103.rs
index c5e13856178..9c6a419e9f7 100644
--- a/src/test/ui/associated-types/issue-85103.rs
+++ b/src/test/ui/associated-types/issue-85103.rs
@@ -4,6 +4,6 @@ use std::borrow::Cow;
 
 #[rustc_layout(debug)]
 type Edges<'a, E> = Cow<'a, [E]>;
-//~^ ERROR layout error: NormalizationFailure
+//~^ 6:1: 6:18: unable to determine layout for `<[E] as ToOwned>::Owned` because `<[E] as ToOwned>::Owned` cannot be normalized
 
 fn main() {}
diff --git a/src/test/ui/associated-types/issue-85103.stderr b/src/test/ui/associated-types/issue-85103.stderr
index bddd1dce8e6..17f7148074c 100644
--- a/src/test/ui/associated-types/issue-85103.stderr
+++ b/src/test/ui/associated-types/issue-85103.stderr
@@ -1,4 +1,4 @@
-error: layout error: NormalizationFailure(<[E] as std::borrow::ToOwned>::Owned, Type(<[E] as std::borrow::ToOwned>::Owned))
+error: unable to determine layout for `<[E] as ToOwned>::Owned` because `<[E] as ToOwned>::Owned` cannot be normalized
   --> $DIR/issue-85103.rs:6:1
    |
 LL | type Edges<'a, E> = Cow<'a, [E]>;
diff --git a/src/test/ui/consts/issue-102117.rs b/src/test/ui/consts/issue-102117.rs
new file mode 100644
index 00000000000..b77342c4135
--- /dev/null
+++ b/src/test/ui/consts/issue-102117.rs
@@ -0,0 +1,30 @@
+#![feature(inline_const, const_type_id)]
+
+use std::alloc::Layout;
+use std::any::TypeId;
+use std::mem::transmute;
+use std::ptr::drop_in_place;
+
+pub struct VTable {
+    layout: Layout,
+    type_id: TypeId,
+    drop_in_place: unsafe fn(*mut ()),
+}
+
+impl VTable {
+    pub fn new<T>() -> &'static Self {
+        const {
+          //~^ ERROR the parameter type `T` may not live long enough
+          //~| ERROR the parameter type `T` may not live long enough
+            &VTable {
+                layout: Layout::new::<T>(),
+                type_id: TypeId::of::<T>(),
+                drop_in_place: unsafe {
+                    transmute::<unsafe fn(*mut T), unsafe fn(*mut ())>(drop_in_place::<T>)
+                },
+            }
+        }
+    }
+}
+
+fn main() {}
diff --git a/src/test/ui/consts/issue-102117.stderr b/src/test/ui/consts/issue-102117.stderr
new file mode 100644
index 00000000000..eb4b329bd81
--- /dev/null
+++ b/src/test/ui/consts/issue-102117.stderr
@@ -0,0 +1,37 @@
+error[E0310]: the parameter type `T` may not live long enough
+  --> $DIR/issue-102117.rs:16:9
+   |
+LL | /         const {
+LL | |
+LL | |
+LL | |             &VTable {
+...  |
+LL | |             }
+LL | |         }
+   | |_________^ ...so that the type `T` will meet its required lifetime bounds
+   |
+help: consider adding an explicit lifetime bound...
+   |
+LL |     pub fn new<T: 'static>() -> &'static Self {
+   |                 +++++++++
+
+error[E0310]: the parameter type `T` may not live long enough
+  --> $DIR/issue-102117.rs:16:9
+   |
+LL | /         const {
+LL | |
+LL | |
+LL | |             &VTable {
+...  |
+LL | |             }
+LL | |         }
+   | |_________^ ...so that the type `T` will meet its required lifetime bounds
+   |
+help: consider adding an explicit lifetime bound...
+   |
+LL |     pub fn new<T: 'static>() -> &'static Self {
+   |                 +++++++++
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0310`.
diff --git a/src/test/ui/issues/issue-72554.rs b/src/test/ui/issues/issue-72554.rs
index 7287639c61d..54f7e9ac592 100644
--- a/src/test/ui/issues/issue-72554.rs
+++ b/src/test/ui/issues/issue-72554.rs
@@ -3,7 +3,6 @@ use std::collections::BTreeSet;
 #[derive(Hash)]
 pub enum ElemDerived {
     //~^ ERROR recursive type `ElemDerived` has infinite size
-    //~| ERROR cycle detected when computing drop-check constraints for `ElemDerived`
     A(ElemDerived)
 }
 
diff --git a/src/test/ui/issues/issue-72554.stderr b/src/test/ui/issues/issue-72554.stderr
index bc85cd7b18d..d12be539f7c 100644
--- a/src/test/ui/issues/issue-72554.stderr
+++ b/src/test/ui/issues/issue-72554.stderr
@@ -3,7 +3,7 @@ error[E0072]: recursive type `ElemDerived` has infinite size
    |
 LL | pub enum ElemDerived {
    | ^^^^^^^^^^^^^^^^^^^^
-...
+LL |
 LL |     A(ElemDerived)
    |       ----------- recursive without indirection
    |
@@ -12,20 +12,6 @@ help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
 LL |     A(Box<ElemDerived>)
    |       ++++           +
 
-error[E0391]: cycle detected when computing drop-check constraints for `ElemDerived`
-  --> $DIR/issue-72554.rs:4:1
-   |
-LL | pub enum ElemDerived {
-   | ^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: ...which immediately requires computing drop-check constraints for `ElemDerived` again
-note: cycle used when computing drop-check constraints for `Elem`
-  --> $DIR/issue-72554.rs:11:1
-   |
-LL | pub enum Elem {
-   | ^^^^^^^^^^^^^
-
-error: aborting due to 2 previous errors
+error: aborting due to previous error
 
-Some errors have detailed explanations: E0072, E0391.
-For more information about an error, try `rustc --explain E0072`.
+For more information about this error, try `rustc --explain E0072`.
diff --git a/src/test/ui/variance/variance-regions-unused-indirect.rs b/src/test/ui/variance/variance-regions-unused-indirect.rs
index 1514e39563e..6c2c24ddbc7 100644
--- a/src/test/ui/variance/variance-regions-unused-indirect.rs
+++ b/src/test/ui/variance/variance-regions-unused-indirect.rs
@@ -1,6 +1,7 @@
 // Test that disallow lifetime parameters that are unused.
 
 enum Foo<'a> { //~ ERROR parameter `'a` is never used
+    //~^ ERROR recursive types `Foo` and `Bar` have infinite size
     Foo1(Bar<'a>)
 }
 
diff --git a/src/test/ui/variance/variance-regions-unused-indirect.stderr b/src/test/ui/variance/variance-regions-unused-indirect.stderr
index 93710cc133a..14fdd849294 100644
--- a/src/test/ui/variance/variance-regions-unused-indirect.stderr
+++ b/src/test/ui/variance/variance-regions-unused-indirect.stderr
@@ -1,3 +1,26 @@
+error[E0072]: recursive types `Foo` and `Bar` have infinite size
+  --> $DIR/variance-regions-unused-indirect.rs:3:1
+   |
+LL | enum Foo<'a> {
+   | ^^^^^^^^^^^^
+LL |
+LL |     Foo1(Bar<'a>)
+   |          ------- recursive without indirection
+...
+LL | enum Bar<'a> {
+   | ^^^^^^^^^^^^
+LL |     Bar1(Foo<'a>)
+   |          ------- recursive without indirection
+   |
+help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
+   |
+LL ~     Foo1(Box<Bar<'a>>)
+LL | }
+LL | 
+LL | enum Bar<'a> {
+LL ~     Bar1(Box<Foo<'a>>)
+   |
+
 error[E0392]: parameter `'a` is never used
   --> $DIR/variance-regions-unused-indirect.rs:3:10
    |
@@ -7,13 +30,14 @@ LL | enum Foo<'a> {
    = help: consider removing `'a`, referring to it in a field, or using a marker such as `PhantomData`
 
 error[E0392]: parameter `'a` is never used
-  --> $DIR/variance-regions-unused-indirect.rs:7:10
+  --> $DIR/variance-regions-unused-indirect.rs:8:10
    |
 LL | enum Bar<'a> {
    |          ^^ unused parameter
    |
    = help: consider removing `'a`, referring to it in a field, or using a marker such as `PhantomData`
 
-error: aborting due to 2 previous errors
+error: aborting due to 3 previous errors
 
-For more information about this error, try `rustc --explain E0392`.
+Some errors have detailed explanations: E0072, E0392.
+For more information about an error, try `rustc --explain E0072`.