about summary refs log tree commit diff
path: root/src/test/ui/variance
diff options
context:
space:
mode:
authorAlbert Larsan <74931857+albertlarsan68@users.noreply.github.com>2023-01-05 09:13:28 +0100
committerAlbert Larsan <74931857+albertlarsan68@users.noreply.github.com>2023-01-11 09:32:08 +0000
commitcf2dff2b1e3fa55fa5415d524200070d0d7aacfe (patch)
tree40a88d9a46aaf3e8870676eb2538378b75a263eb /src/test/ui/variance
parentca855e6e42787ecd062d81d53336fe6788ef51a9 (diff)
Move /src/test to /tests
Diffstat (limited to 'src/test/ui/variance')
-rw-r--r--src/test/ui/variance/variance-associated-consts.rs17
-rw-r--r--src/test/ui/variance/variance-associated-consts.stderr9
-rw-r--r--src/test/ui/variance/variance-associated-types.rs22
-rw-r--r--src/test/ui/variance/variance-associated-types.stderr15
-rw-r--r--src/test/ui/variance/variance-associated-types2.rs17
-rw-r--r--src/test/ui/variance/variance-associated-types2.stderr10
-rw-r--r--src/test/ui/variance/variance-btree-invariant-types.rs80
-rw-r--r--src/test/ui/variance/variance-btree-invariant-types.stderr202
-rw-r--r--src/test/ui/variance/variance-cell-is-invariant.rs19
-rw-r--r--src/test/ui/variance/variance-cell-is-invariant.stderr18
-rw-r--r--src/test/ui/variance/variance-contravariant-arg-object.rs27
-rw-r--r--src/test/ui/variance/variance-contravariant-arg-object.stderr28
-rw-r--r--src/test/ui/variance/variance-contravariant-arg-trait-match.rs28
-rw-r--r--src/test/ui/variance/variance-contravariant-arg-trait-match.stderr28
-rw-r--r--src/test/ui/variance/variance-contravariant-self-trait-match.rs29
-rw-r--r--src/test/ui/variance/variance-contravariant-self-trait-match.stderr28
-rw-r--r--src/test/ui/variance/variance-covariant-arg-object.rs27
-rw-r--r--src/test/ui/variance/variance-covariant-arg-object.stderr28
-rw-r--r--src/test/ui/variance/variance-covariant-arg-trait-match.rs27
-rw-r--r--src/test/ui/variance/variance-covariant-arg-trait-match.stderr28
-rw-r--r--src/test/ui/variance/variance-covariant-self-trait-match.rs27
-rw-r--r--src/test/ui/variance/variance-covariant-self-trait-match.stderr28
-rw-r--r--src/test/ui/variance/variance-invariant-arg-object.rs23
-rw-r--r--src/test/ui/variance/variance-invariant-arg-object.stderr28
-rw-r--r--src/test/ui/variance/variance-invariant-arg-trait-match.rs23
-rw-r--r--src/test/ui/variance/variance-invariant-arg-trait-match.stderr28
-rw-r--r--src/test/ui/variance/variance-invariant-self-trait-match.rs23
-rw-r--r--src/test/ui/variance/variance-invariant-self-trait-match.stderr28
-rw-r--r--src/test/ui/variance/variance-issue-20533.rs43
-rw-r--r--src/test/ui/variance/variance-issue-20533.stderr33
-rw-r--r--src/test/ui/variance/variance-object-types.rs12
-rw-r--r--src/test/ui/variance/variance-object-types.stderr9
-rw-r--r--src/test/ui/variance/variance-regions-direct.rs65
-rw-r--r--src/test/ui/variance/variance-regions-direct.stderr45
-rw-r--r--src/test/ui/variance/variance-regions-indirect.rs34
-rw-r--r--src/test/ui/variance/variance-regions-indirect.stderr33
-rw-r--r--src/test/ui/variance/variance-regions-unused-direct.rs15
-rw-r--r--src/test/ui/variance/variance-regions-unused-direct.stderr19
-rw-r--r--src/test/ui/variance/variance-regions-unused-indirect.rs12
-rw-r--r--src/test/ui/variance/variance-regions-unused-indirect.stderr43
-rw-r--r--src/test/ui/variance/variance-trait-bounds.rs35
-rw-r--r--src/test/ui/variance/variance-trait-bounds.stderr27
-rw-r--r--src/test/ui/variance/variance-trait-matching.rs38
-rw-r--r--src/test/ui/variance/variance-trait-matching.stderr12
-rw-r--r--src/test/ui/variance/variance-trait-object-bound.rs18
-rw-r--r--src/test/ui/variance/variance-trait-object-bound.stderr9
-rw-r--r--src/test/ui/variance/variance-types-bounds.rs43
-rw-r--r--src/test/ui/variance/variance-types-bounds.stderr33
-rw-r--r--src/test/ui/variance/variance-types.rs41
-rw-r--r--src/test/ui/variance/variance-types.stderr39
-rw-r--r--src/test/ui/variance/variance-unused-region-param.rs7
-rw-r--r--src/test/ui/variance/variance-unused-region-param.stderr19
-rw-r--r--src/test/ui/variance/variance-unused-type-param.rs28
-rw-r--r--src/test/ui/variance/variance-unused-type-param.stderr54
-rw-r--r--src/test/ui/variance/variance-use-contravariant-struct-1.rs15
-rw-r--r--src/test/ui/variance/variance-use-contravariant-struct-1.stderr15
-rw-r--r--src/test/ui/variance/variance-use-contravariant-struct-2.rs17
-rw-r--r--src/test/ui/variance/variance-use-covariant-struct-1.rs14
-rw-r--r--src/test/ui/variance/variance-use-covariant-struct-1.stderr15
-rw-r--r--src/test/ui/variance/variance-use-covariant-struct-2.rs16
-rw-r--r--src/test/ui/variance/variance-use-invariant-struct-1.rs23
-rw-r--r--src/test/ui/variance/variance-use-invariant-struct-1.stderr34
62 files changed, 0 insertions, 1810 deletions
diff --git a/src/test/ui/variance/variance-associated-consts.rs b/src/test/ui/variance/variance-associated-consts.rs
deleted file mode 100644
index da55bc96244..00000000000
--- a/src/test/ui/variance/variance-associated-consts.rs
+++ /dev/null
@@ -1,17 +0,0 @@
-// Test that the variance computation considers types that
-// appear in const expressions to be invariant.
-
-#![feature(rustc_attrs)]
-#![allow(incomplete_features)]
-#![feature(generic_const_exprs)]
-
-trait Trait {
-    const Const: usize;
-}
-
-#[rustc_variance]
-struct Foo<T: Trait> { //~ ERROR [o]
-    field: [u8; <T as Trait>::Const]
-}
-
-fn main() { }
diff --git a/src/test/ui/variance/variance-associated-consts.stderr b/src/test/ui/variance/variance-associated-consts.stderr
deleted file mode 100644
index f9732d02cb2..00000000000
--- a/src/test/ui/variance/variance-associated-consts.stderr
+++ /dev/null
@@ -1,9 +0,0 @@
-error[E0208]: [o]
-  --> $DIR/variance-associated-consts.rs:13:1
-   |
-LL | struct Foo<T: Trait> {
-   | ^^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0208`.
diff --git a/src/test/ui/variance/variance-associated-types.rs b/src/test/ui/variance/variance-associated-types.rs
deleted file mode 100644
index 1165fb53c73..00000000000
--- a/src/test/ui/variance/variance-associated-types.rs
+++ /dev/null
@@ -1,22 +0,0 @@
-// Test that the variance computation considers types/regions that
-// appear in projections to be invariant.
-
-#![feature(rustc_attrs)]
-
-trait Trait<'a> {
-    type Type;
-
-    fn method(&'a self) { }
-}
-
-#[rustc_variance]
-struct Foo<'a, T : Trait<'a>> { //~ ERROR [-, +]
-    field: (T, &'a ())
-}
-
-#[rustc_variance]
-struct Bar<'a, T : Trait<'a>> { //~ ERROR [o, o]
-    field: <T as Trait<'a>>::Type
-}
-
-fn main() { }
diff --git a/src/test/ui/variance/variance-associated-types.stderr b/src/test/ui/variance/variance-associated-types.stderr
deleted file mode 100644
index 5ce62884e1d..00000000000
--- a/src/test/ui/variance/variance-associated-types.stderr
+++ /dev/null
@@ -1,15 +0,0 @@
-error[E0208]: [-, +]
-  --> $DIR/variance-associated-types.rs:13:1
-   |
-LL | struct Foo<'a, T : Trait<'a>> {
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0208]: [o, o]
-  --> $DIR/variance-associated-types.rs:18:1
-   |
-LL | struct Bar<'a, T : Trait<'a>> {
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0208`.
diff --git a/src/test/ui/variance/variance-associated-types2.rs b/src/test/ui/variance/variance-associated-types2.rs
deleted file mode 100644
index e487eefea63..00000000000
--- a/src/test/ui/variance/variance-associated-types2.rs
+++ /dev/null
@@ -1,17 +0,0 @@
-// Test that dyn Foo<Bar = T> is invariant with respect to T.
-// Failure to enforce invariance here can be weaponized, see #71550 for details.
-
-trait Foo {
-    type Bar;
-}
-
-fn make() -> Box<dyn Foo<Bar = &'static u32>> {
-    panic!()
-}
-
-fn take<'a>(_: &'a u32) {
-    let _: Box<dyn Foo<Bar = &'a u32>> = make();
-    //~^ ERROR lifetime may not live long enough
-}
-
-fn main() {}
diff --git a/src/test/ui/variance/variance-associated-types2.stderr b/src/test/ui/variance/variance-associated-types2.stderr
deleted file mode 100644
index 35871c1236f..00000000000
--- a/src/test/ui/variance/variance-associated-types2.stderr
+++ /dev/null
@@ -1,10 +0,0 @@
-error: lifetime may not live long enough
-  --> $DIR/variance-associated-types2.rs:13:12
-   |
-LL | fn take<'a>(_: &'a u32) {
-   |         -- lifetime `'a` defined here
-LL |     let _: Box<dyn Foo<Bar = &'a u32>> = make();
-   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'static`
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/variance/variance-btree-invariant-types.rs b/src/test/ui/variance/variance-btree-invariant-types.rs
deleted file mode 100644
index 09c93d0013c..00000000000
--- a/src/test/ui/variance/variance-btree-invariant-types.rs
+++ /dev/null
@@ -1,80 +0,0 @@
-use std::collections::btree_map::{IterMut, OccupiedEntry, RangeMut, VacantEntry};
-
-fn iter_cov_key<'a, 'new>(v: IterMut<'a, &'static (), ()>) -> IterMut<'a, &'new (), ()> {
-    v
-    //~^ lifetime may not live long enough
-}
-fn iter_cov_val<'a, 'new>(v: IterMut<'a, (), &'static ()>) -> IterMut<'a, (), &'new ()> {
-    v
-    //~^ lifetime may not live long enough
-}
-fn iter_contra_key<'a, 'new>(v: IterMut<'a, &'new (), ()>) -> IterMut<'a, &'static (), ()> {
-    v
-    //~^ lifetime may not live long enough
-}
-fn iter_contra_val<'a, 'new>(v: IterMut<'a, (), &'new ()>) -> IterMut<'a, (), &'static ()> {
-    v
-    //~^ lifetime may not live long enough
-}
-
-fn range_cov_key<'a, 'new>(v: RangeMut<'a, &'static (), ()>) -> RangeMut<'a, &'new (), ()> {
-    v
-    //~^ lifetime may not live long enough
-}
-fn range_cov_val<'a, 'new>(v: RangeMut<'a, (), &'static ()>) -> RangeMut<'a, (), &'new ()> {
-    v
-    //~^ lifetime may not live long enough
-}
-fn range_contra_key<'a, 'new>(v: RangeMut<'a, &'new (), ()>) -> RangeMut<'a, &'static (), ()> {
-    v
-    //~^ lifetime may not live long enough
-}
-fn range_contra_val<'a, 'new>(v: RangeMut<'a, (), &'new ()>) -> RangeMut<'a, (), &'static ()> {
-    v
-    //~^ lifetime may not live long enough
-}
-
-fn occ_cov_key<'a, 'new>(v: OccupiedEntry<'a, &'static (), ()>)
-                         -> OccupiedEntry<'a, &'new (), ()> {
-    v
-    //~^ lifetime may not live long enough
-}
-fn occ_cov_val<'a, 'new>(v: OccupiedEntry<'a, (), &'static ()>)
-                         -> OccupiedEntry<'a, (), &'new ()> {
-    v
-    //~^ lifetime may not live long enough
-}
-fn occ_contra_key<'a, 'new>(v: OccupiedEntry<'a, &'new (), ()>)
-                            -> OccupiedEntry<'a, &'static (), ()> {
-    v
-    //~^ lifetime may not live long enough
-}
-fn occ_contra_val<'a, 'new>(v: OccupiedEntry<'a, (), &'new ()>)
-                            -> OccupiedEntry<'a, (), &'static ()> {
-    v
-    //~^ lifetime may not live long enough
-}
-
-fn vac_cov_key<'a, 'new>(v: VacantEntry<'a, &'static (), ()>)
-                         -> VacantEntry<'a, &'new (), ()> {
-    v
-    //~^ lifetime may not live long enough
-}
-fn vac_cov_val<'a, 'new>(v: VacantEntry<'a, (), &'static ()>)
-                         -> VacantEntry<'a, (), &'new ()> {
-    v
-    //~^ lifetime may not live long enough
-}
-fn vac_contra_key<'a, 'new>(v: VacantEntry<'a, &'new (), ()>)
-                            -> VacantEntry<'a, &'static (), ()> {
-    v
-    //~^ lifetime may not live long enough
-}
-fn vac_contra_val<'a, 'new>(v: VacantEntry<'a, (), &'new ()>)
-                            -> VacantEntry<'a, (), &'static ()> {
-    v
-    //~^ lifetime may not live long enough
-}
-
-
-fn main() { }
diff --git a/src/test/ui/variance/variance-btree-invariant-types.stderr b/src/test/ui/variance/variance-btree-invariant-types.stderr
deleted file mode 100644
index 6f79100217a..00000000000
--- a/src/test/ui/variance/variance-btree-invariant-types.stderr
+++ /dev/null
@@ -1,202 +0,0 @@
-error: lifetime may not live long enough
-  --> $DIR/variance-btree-invariant-types.rs:4:5
-   |
-LL | fn iter_cov_key<'a, 'new>(v: IterMut<'a, &'static (), ()>) -> IterMut<'a, &'new (), ()> {
-   |                     ---- lifetime `'new` defined here
-LL |     v
-   |     ^ returning this value requires that `'new` must outlive `'static`
-   |
-   = note: requirement occurs because of the type `std::collections::btree_map::IterMut<'_, &(), ()>`, which makes the generic argument `&()` invariant
-   = note: the struct `std::collections::btree_map::IterMut<'a, K, V>` is invariant over the parameter `K`
-   = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
-
-error: lifetime may not live long enough
-  --> $DIR/variance-btree-invariant-types.rs:8:5
-   |
-LL | fn iter_cov_val<'a, 'new>(v: IterMut<'a, (), &'static ()>) -> IterMut<'a, (), &'new ()> {
-   |                     ---- lifetime `'new` defined here
-LL |     v
-   |     ^ returning this value requires that `'new` must outlive `'static`
-   |
-   = note: requirement occurs because of the type `std::collections::btree_map::IterMut<'_, (), &()>`, which makes the generic argument `()` invariant
-   = note: the struct `std::collections::btree_map::IterMut<'a, K, V>` is invariant over the parameter `K`
-   = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
-
-error: lifetime may not live long enough
-  --> $DIR/variance-btree-invariant-types.rs:12:5
-   |
-LL | fn iter_contra_key<'a, 'new>(v: IterMut<'a, &'new (), ()>) -> IterMut<'a, &'static (), ()> {
-   |                        ---- lifetime `'new` defined here
-LL |     v
-   |     ^ returning this value requires that `'new` must outlive `'static`
-   |
-   = note: requirement occurs because of the type `std::collections::btree_map::IterMut<'_, &(), ()>`, which makes the generic argument `&()` invariant
-   = note: the struct `std::collections::btree_map::IterMut<'a, K, V>` is invariant over the parameter `K`
-   = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
-
-error: lifetime may not live long enough
-  --> $DIR/variance-btree-invariant-types.rs:16:5
-   |
-LL | fn iter_contra_val<'a, 'new>(v: IterMut<'a, (), &'new ()>) -> IterMut<'a, (), &'static ()> {
-   |                        ---- lifetime `'new` defined here
-LL |     v
-   |     ^ returning this value requires that `'new` must outlive `'static`
-   |
-   = note: requirement occurs because of the type `std::collections::btree_map::IterMut<'_, (), &()>`, which makes the generic argument `()` invariant
-   = note: the struct `std::collections::btree_map::IterMut<'a, K, V>` is invariant over the parameter `K`
-   = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
-
-error: lifetime may not live long enough
-  --> $DIR/variance-btree-invariant-types.rs:21:5
-   |
-LL | fn range_cov_key<'a, 'new>(v: RangeMut<'a, &'static (), ()>) -> RangeMut<'a, &'new (), ()> {
-   |                      ---- lifetime `'new` defined here
-LL |     v
-   |     ^ returning this value requires that `'new` must outlive `'static`
-   |
-   = note: requirement occurs because of the type `RangeMut<'_, &(), ()>`, which makes the generic argument `&()` invariant
-   = note: the struct `RangeMut<'a, K, V>` is invariant over the parameter `K`
-   = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
-
-error: lifetime may not live long enough
-  --> $DIR/variance-btree-invariant-types.rs:25:5
-   |
-LL | fn range_cov_val<'a, 'new>(v: RangeMut<'a, (), &'static ()>) -> RangeMut<'a, (), &'new ()> {
-   |                      ---- lifetime `'new` defined here
-LL |     v
-   |     ^ returning this value requires that `'new` must outlive `'static`
-   |
-   = note: requirement occurs because of the type `RangeMut<'_, (), &()>`, which makes the generic argument `()` invariant
-   = note: the struct `RangeMut<'a, K, V>` is invariant over the parameter `K`
-   = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
-
-error: lifetime may not live long enough
-  --> $DIR/variance-btree-invariant-types.rs:29:5
-   |
-LL | fn range_contra_key<'a, 'new>(v: RangeMut<'a, &'new (), ()>) -> RangeMut<'a, &'static (), ()> {
-   |                         ---- lifetime `'new` defined here
-LL |     v
-   |     ^ returning this value requires that `'new` must outlive `'static`
-   |
-   = note: requirement occurs because of the type `RangeMut<'_, &(), ()>`, which makes the generic argument `&()` invariant
-   = note: the struct `RangeMut<'a, K, V>` is invariant over the parameter `K`
-   = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
-
-error: lifetime may not live long enough
-  --> $DIR/variance-btree-invariant-types.rs:33:5
-   |
-LL | fn range_contra_val<'a, 'new>(v: RangeMut<'a, (), &'new ()>) -> RangeMut<'a, (), &'static ()> {
-   |                         ---- lifetime `'new` defined here
-LL |     v
-   |     ^ returning this value requires that `'new` must outlive `'static`
-   |
-   = note: requirement occurs because of the type `RangeMut<'_, (), &()>`, which makes the generic argument `()` invariant
-   = note: the struct `RangeMut<'a, K, V>` is invariant over the parameter `K`
-   = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
-
-error: lifetime may not live long enough
-  --> $DIR/variance-btree-invariant-types.rs:39:5
-   |
-LL | fn occ_cov_key<'a, 'new>(v: OccupiedEntry<'a, &'static (), ()>)
-   |                    ---- lifetime `'new` defined here
-LL |                          -> OccupiedEntry<'a, &'new (), ()> {
-LL |     v
-   |     ^ returning this value requires that `'new` must outlive `'static`
-   |
-   = note: requirement occurs because of the type `std::collections::btree_map::OccupiedEntry<'_, &(), ()>`, which makes the generic argument `&()` invariant
-   = note: the struct `std::collections::btree_map::OccupiedEntry<'a, K, V, A>` is invariant over the parameter `K`
-   = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
-
-error: lifetime may not live long enough
-  --> $DIR/variance-btree-invariant-types.rs:44:5
-   |
-LL | fn occ_cov_val<'a, 'new>(v: OccupiedEntry<'a, (), &'static ()>)
-   |                    ---- lifetime `'new` defined here
-LL |                          -> OccupiedEntry<'a, (), &'new ()> {
-LL |     v
-   |     ^ returning this value requires that `'new` must outlive `'static`
-   |
-   = note: requirement occurs because of the type `std::collections::btree_map::OccupiedEntry<'_, (), &()>`, which makes the generic argument `()` invariant
-   = note: the struct `std::collections::btree_map::OccupiedEntry<'a, K, V, A>` is invariant over the parameter `K`
-   = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
-
-error: lifetime may not live long enough
-  --> $DIR/variance-btree-invariant-types.rs:49:5
-   |
-LL | fn occ_contra_key<'a, 'new>(v: OccupiedEntry<'a, &'new (), ()>)
-   |                       ---- lifetime `'new` defined here
-LL |                             -> OccupiedEntry<'a, &'static (), ()> {
-LL |     v
-   |     ^ returning this value requires that `'new` must outlive `'static`
-   |
-   = note: requirement occurs because of the type `std::collections::btree_map::OccupiedEntry<'_, &(), ()>`, which makes the generic argument `&()` invariant
-   = note: the struct `std::collections::btree_map::OccupiedEntry<'a, K, V, A>` is invariant over the parameter `K`
-   = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
-
-error: lifetime may not live long enough
-  --> $DIR/variance-btree-invariant-types.rs:54:5
-   |
-LL | fn occ_contra_val<'a, 'new>(v: OccupiedEntry<'a, (), &'new ()>)
-   |                       ---- lifetime `'new` defined here
-LL |                             -> OccupiedEntry<'a, (), &'static ()> {
-LL |     v
-   |     ^ returning this value requires that `'new` must outlive `'static`
-   |
-   = note: requirement occurs because of the type `std::collections::btree_map::OccupiedEntry<'_, (), &()>`, which makes the generic argument `()` invariant
-   = note: the struct `std::collections::btree_map::OccupiedEntry<'a, K, V, A>` is invariant over the parameter `K`
-   = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
-
-error: lifetime may not live long enough
-  --> $DIR/variance-btree-invariant-types.rs:60:5
-   |
-LL | fn vac_cov_key<'a, 'new>(v: VacantEntry<'a, &'static (), ()>)
-   |                    ---- lifetime `'new` defined here
-LL |                          -> VacantEntry<'a, &'new (), ()> {
-LL |     v
-   |     ^ returning this value requires that `'new` must outlive `'static`
-   |
-   = note: requirement occurs because of the type `std::collections::btree_map::VacantEntry<'_, &(), ()>`, which makes the generic argument `&()` invariant
-   = note: the struct `std::collections::btree_map::VacantEntry<'a, K, V, A>` is invariant over the parameter `K`
-   = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
-
-error: lifetime may not live long enough
-  --> $DIR/variance-btree-invariant-types.rs:65:5
-   |
-LL | fn vac_cov_val<'a, 'new>(v: VacantEntry<'a, (), &'static ()>)
-   |                    ---- lifetime `'new` defined here
-LL |                          -> VacantEntry<'a, (), &'new ()> {
-LL |     v
-   |     ^ returning this value requires that `'new` must outlive `'static`
-   |
-   = note: requirement occurs because of the type `std::collections::btree_map::VacantEntry<'_, (), &()>`, which makes the generic argument `()` invariant
-   = note: the struct `std::collections::btree_map::VacantEntry<'a, K, V, A>` is invariant over the parameter `K`
-   = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
-
-error: lifetime may not live long enough
-  --> $DIR/variance-btree-invariant-types.rs:70:5
-   |
-LL | fn vac_contra_key<'a, 'new>(v: VacantEntry<'a, &'new (), ()>)
-   |                       ---- lifetime `'new` defined here
-LL |                             -> VacantEntry<'a, &'static (), ()> {
-LL |     v
-   |     ^ returning this value requires that `'new` must outlive `'static`
-   |
-   = note: requirement occurs because of the type `std::collections::btree_map::VacantEntry<'_, &(), ()>`, which makes the generic argument `&()` invariant
-   = note: the struct `std::collections::btree_map::VacantEntry<'a, K, V, A>` is invariant over the parameter `K`
-   = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
-
-error: lifetime may not live long enough
-  --> $DIR/variance-btree-invariant-types.rs:75:5
-   |
-LL | fn vac_contra_val<'a, 'new>(v: VacantEntry<'a, (), &'new ()>)
-   |                       ---- lifetime `'new` defined here
-LL |                             -> VacantEntry<'a, (), &'static ()> {
-LL |     v
-   |     ^ returning this value requires that `'new` must outlive `'static`
-   |
-   = note: requirement occurs because of the type `std::collections::btree_map::VacantEntry<'_, (), &()>`, which makes the generic argument `()` invariant
-   = note: the struct `std::collections::btree_map::VacantEntry<'a, K, V, A>` is invariant over the parameter `K`
-   = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
-
-error: aborting due to 16 previous errors
-
diff --git a/src/test/ui/variance/variance-cell-is-invariant.rs b/src/test/ui/variance/variance-cell-is-invariant.rs
deleted file mode 100644
index 62ce4f91fe8..00000000000
--- a/src/test/ui/variance/variance-cell-is-invariant.rs
+++ /dev/null
@@ -1,19 +0,0 @@
-// Test that Cell is considered invariant with respect to its
-// type.
-
-use std::cell::Cell;
-
-struct Foo<'a> {
-    x: Cell<Option<&'a isize>>,
-}
-
-fn use_<'short,'long>(c: Foo<'short>,
-                      s: &'short isize,
-                      l: &'long isize,
-                      _where:Option<&'short &'long ()>) {
-    let _: Foo<'long> = c;
-    //~^ ERROR lifetime may not live long enough
-}
-
-fn main() {
-}
diff --git a/src/test/ui/variance/variance-cell-is-invariant.stderr b/src/test/ui/variance/variance-cell-is-invariant.stderr
deleted file mode 100644
index ab5435d1656..00000000000
--- a/src/test/ui/variance/variance-cell-is-invariant.stderr
+++ /dev/null
@@ -1,18 +0,0 @@
-error: lifetime may not live long enough
-  --> $DIR/variance-cell-is-invariant.rs:14:12
-   |
-LL | fn use_<'short,'long>(c: Foo<'short>,
-   |         ------ ----- lifetime `'long` defined here
-   |         |
-   |         lifetime `'short` defined here
-...
-LL |     let _: Foo<'long> = c;
-   |            ^^^^^^^^^^ type annotation requires that `'short` must outlive `'long`
-   |
-   = help: consider adding the following bound: `'short: 'long`
-   = note: requirement occurs because of the type `Foo<'_>`, which makes the generic argument `'_` invariant
-   = note: the struct `Foo<'a>` is invariant over the parameter `'a`
-   = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/variance/variance-contravariant-arg-object.rs b/src/test/ui/variance/variance-contravariant-arg-object.rs
deleted file mode 100644
index 701fcaf6925..00000000000
--- a/src/test/ui/variance/variance-contravariant-arg-object.rs
+++ /dev/null
@@ -1,27 +0,0 @@
-#![allow(dead_code)]
-
-// Test that even when `T` is only used in contravariant position, it
-// is treated as invariant.
-
-trait Get<T> : 'static {
-    fn get(&self, t: T);
-}
-
-fn get_min_from_max<'min, 'max>(v: Box<dyn Get<&'max i32>>)
-                                -> Box<dyn Get<&'min i32>>
-    where 'max : 'min
-{
-    v
-    //~^ ERROR lifetime may not live long enough
-}
-
-fn get_max_from_min<'min, 'max>(v: Box<dyn Get<&'min i32>>)
-                                -> Box<dyn Get<&'max i32>>
-    where 'max : 'min
-{
-    // Previously OK:
-    v
-    //~^ ERROR lifetime may not live long enough
-}
-
-fn main() { }
diff --git a/src/test/ui/variance/variance-contravariant-arg-object.stderr b/src/test/ui/variance/variance-contravariant-arg-object.stderr
deleted file mode 100644
index ab28315e11e..00000000000
--- a/src/test/ui/variance/variance-contravariant-arg-object.stderr
+++ /dev/null
@@ -1,28 +0,0 @@
-error: lifetime may not live long enough
-  --> $DIR/variance-contravariant-arg-object.rs:14:5
-   |
-LL | fn get_min_from_max<'min, 'max>(v: Box<dyn Get<&'max i32>>)
-   |                     ----  ---- lifetime `'max` defined here
-   |                     |
-   |                     lifetime `'min` defined here
-...
-LL |     v
-   |     ^ function was supposed to return data with lifetime `'max` but it is returning data with lifetime `'min`
-   |
-   = help: consider adding the following bound: `'min: 'max`
-
-error: lifetime may not live long enough
-  --> $DIR/variance-contravariant-arg-object.rs:23:5
-   |
-LL | fn get_max_from_min<'min, 'max>(v: Box<dyn Get<&'min i32>>)
-   |                     ----  ---- lifetime `'max` defined here
-   |                     |
-   |                     lifetime `'min` defined here
-...
-LL |     v
-   |     ^ function was supposed to return data with lifetime `'max` but it is returning data with lifetime `'min`
-   |
-   = help: consider adding the following bound: `'min: 'max`
-
-error: aborting due to 2 previous errors
-
diff --git a/src/test/ui/variance/variance-contravariant-arg-trait-match.rs b/src/test/ui/variance/variance-contravariant-arg-trait-match.rs
deleted file mode 100644
index e0b28010561..00000000000
--- a/src/test/ui/variance/variance-contravariant-arg-trait-match.rs
+++ /dev/null
@@ -1,28 +0,0 @@
-#![allow(dead_code)]
-
-// Test that even when `T` is only used in contravariant position, it
-// is treated as invariant.
-
-trait Get<T> {
-    fn get(&self, t: T);
-}
-
-fn get_min_from_max<'min, 'max, G>()
-    where 'max : 'min, G : Get<&'max i32>
-{
-    impls_get::<G,&'min i32>()
-    //~^ ERROR lifetime may not live long enough
-}
-
-fn get_max_from_min<'min, 'max, G>()
-    where 'max : 'min, G : Get<&'min i32>
-{
-    // Previously OK, but now an error because traits are invariant:
-
-    impls_get::<G,&'max i32>()
-    //~^ ERROR lifetime may not live long enough
-}
-
-fn impls_get<G,T>() where G : Get<T> { }
-
-fn main() { }
diff --git a/src/test/ui/variance/variance-contravariant-arg-trait-match.stderr b/src/test/ui/variance/variance-contravariant-arg-trait-match.stderr
deleted file mode 100644
index df9d93907cf..00000000000
--- a/src/test/ui/variance/variance-contravariant-arg-trait-match.stderr
+++ /dev/null
@@ -1,28 +0,0 @@
-error: lifetime may not live long enough
-  --> $DIR/variance-contravariant-arg-trait-match.rs:13:5
-   |
-LL | fn get_min_from_max<'min, 'max, G>()
-   |                     ----  ---- lifetime `'max` defined here
-   |                     |
-   |                     lifetime `'min` defined here
-...
-LL |     impls_get::<G,&'min i32>()
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'min` must outlive `'max`
-   |
-   = help: consider adding the following bound: `'min: 'max`
-
-error: lifetime may not live long enough
-  --> $DIR/variance-contravariant-arg-trait-match.rs:22:5
-   |
-LL | fn get_max_from_min<'min, 'max, G>()
-   |                     ----  ---- lifetime `'max` defined here
-   |                     |
-   |                     lifetime `'min` defined here
-...
-LL |     impls_get::<G,&'max i32>()
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'min` must outlive `'max`
-   |
-   = help: consider adding the following bound: `'min: 'max`
-
-error: aborting due to 2 previous errors
-
diff --git a/src/test/ui/variance/variance-contravariant-self-trait-match.rs b/src/test/ui/variance/variance-contravariant-self-trait-match.rs
deleted file mode 100644
index 8a10554f30c..00000000000
--- a/src/test/ui/variance/variance-contravariant-self-trait-match.rs
+++ /dev/null
@@ -1,29 +0,0 @@
-#![allow(dead_code)]
-
-// Test that even when `Self` is only used in contravariant position, it
-// is treated as invariant.
-
-trait Get {
-    fn get(&self);
-}
-
-fn get_min_from_max<'min, 'max, G>()
-    where 'max : 'min, G : 'max, &'max G : Get
-{
-    impls_get::<&'min G>();
-    //~^ ERROR lifetime may not live long enough
-}
-
-fn get_max_from_min<'min, 'max, G>()
-    where 'max : 'min, G : 'max, &'min G : Get
-{
-    // Previously OK, but now error because traits are invariant with
-    // respect to all inputs.
-
-    impls_get::<&'max G>();
-    //~^ ERROR lifetime may not live long enough
-}
-
-fn impls_get<G>() where G : Get { }
-
-fn main() { }
diff --git a/src/test/ui/variance/variance-contravariant-self-trait-match.stderr b/src/test/ui/variance/variance-contravariant-self-trait-match.stderr
deleted file mode 100644
index bfea1b1b380..00000000000
--- a/src/test/ui/variance/variance-contravariant-self-trait-match.stderr
+++ /dev/null
@@ -1,28 +0,0 @@
-error: lifetime may not live long enough
-  --> $DIR/variance-contravariant-self-trait-match.rs:13:5
-   |
-LL | fn get_min_from_max<'min, 'max, G>()
-   |                     ----  ---- lifetime `'max` defined here
-   |                     |
-   |                     lifetime `'min` defined here
-...
-LL |     impls_get::<&'min G>();
-   |     ^^^^^^^^^^^^^^^^^^^^ requires that `'min` must outlive `'max`
-   |
-   = help: consider adding the following bound: `'min: 'max`
-
-error: lifetime may not live long enough
-  --> $DIR/variance-contravariant-self-trait-match.rs:23:5
-   |
-LL | fn get_max_from_min<'min, 'max, G>()
-   |                     ----  ---- lifetime `'max` defined here
-   |                     |
-   |                     lifetime `'min` defined here
-...
-LL |     impls_get::<&'max G>();
-   |     ^^^^^^^^^^^^^^^^^^^^ requires that `'min` must outlive `'max`
-   |
-   = help: consider adding the following bound: `'min: 'max`
-
-error: aborting due to 2 previous errors
-
diff --git a/src/test/ui/variance/variance-covariant-arg-object.rs b/src/test/ui/variance/variance-covariant-arg-object.rs
deleted file mode 100644
index 89cf3117afe..00000000000
--- a/src/test/ui/variance/variance-covariant-arg-object.rs
+++ /dev/null
@@ -1,27 +0,0 @@
-#![allow(dead_code)]
-
-// Test that even when `T` is only used in covariant position, it
-// is treated as invariant.
-
-trait Get<T> : 'static {
-    fn get(&self) -> T;
-}
-
-fn get_min_from_max<'min, 'max>(v: Box<dyn Get<&'max i32>>)
-                                -> Box<dyn Get<&'min i32>>
-    where 'max : 'min
-{
-    // Previously OK, now an error as traits are invariant.
-    v
-    //~^ ERROR lifetime may not live long enough
-}
-
-fn get_max_from_min<'min, 'max>(v: Box<dyn Get<&'min i32>>)
-                                -> Box<dyn Get<&'max i32>>
-    where 'max : 'min
-{
-    v
-    //~^ ERROR lifetime may not live long enough
-}
-
-fn main() { }
diff --git a/src/test/ui/variance/variance-covariant-arg-object.stderr b/src/test/ui/variance/variance-covariant-arg-object.stderr
deleted file mode 100644
index 51f8cb3ec75..00000000000
--- a/src/test/ui/variance/variance-covariant-arg-object.stderr
+++ /dev/null
@@ -1,28 +0,0 @@
-error: lifetime may not live long enough
-  --> $DIR/variance-covariant-arg-object.rs:15:5
-   |
-LL | fn get_min_from_max<'min, 'max>(v: Box<dyn Get<&'max i32>>)
-   |                     ----  ---- lifetime `'max` defined here
-   |                     |
-   |                     lifetime `'min` defined here
-...
-LL |     v
-   |     ^ function was supposed to return data with lifetime `'max` but it is returning data with lifetime `'min`
-   |
-   = help: consider adding the following bound: `'min: 'max`
-
-error: lifetime may not live long enough
-  --> $DIR/variance-covariant-arg-object.rs:23:5
-   |
-LL | fn get_max_from_min<'min, 'max>(v: Box<dyn Get<&'min i32>>)
-   |                     ----  ---- lifetime `'max` defined here
-   |                     |
-   |                     lifetime `'min` defined here
-...
-LL |     v
-   |     ^ function was supposed to return data with lifetime `'max` but it is returning data with lifetime `'min`
-   |
-   = help: consider adding the following bound: `'min: 'max`
-
-error: aborting due to 2 previous errors
-
diff --git a/src/test/ui/variance/variance-covariant-arg-trait-match.rs b/src/test/ui/variance/variance-covariant-arg-trait-match.rs
deleted file mode 100644
index 68dd449d567..00000000000
--- a/src/test/ui/variance/variance-covariant-arg-trait-match.rs
+++ /dev/null
@@ -1,27 +0,0 @@
-#![allow(dead_code)]
-
-// Test that even when `T` is only used in covariant position, it
-// is treated as invariant.
-
-trait Get<T> {
-    fn get(&self) -> T;
-}
-
-fn get_min_from_max<'min, 'max, G>()
-    where 'max : 'min, G : Get<&'max i32>
-{
-    // Previously OK, now an error as traits are invariant.
-    impls_get::<G,&'min i32>()
-    //~^ ERROR lifetime may not live long enough
-}
-
-fn get_max_from_min<'min, 'max, G>()
-    where 'max : 'min, G : Get<&'min i32>
-{
-    impls_get::<G,&'max i32>()
-    //~^ ERROR lifetime may not live long enough
-}
-
-fn impls_get<G,T>() where G : Get<T> { }
-
-fn main() { }
diff --git a/src/test/ui/variance/variance-covariant-arg-trait-match.stderr b/src/test/ui/variance/variance-covariant-arg-trait-match.stderr
deleted file mode 100644
index 4c7b6cf7ce9..00000000000
--- a/src/test/ui/variance/variance-covariant-arg-trait-match.stderr
+++ /dev/null
@@ -1,28 +0,0 @@
-error: lifetime may not live long enough
-  --> $DIR/variance-covariant-arg-trait-match.rs:14:5
-   |
-LL | fn get_min_from_max<'min, 'max, G>()
-   |                     ----  ---- lifetime `'max` defined here
-   |                     |
-   |                     lifetime `'min` defined here
-...
-LL |     impls_get::<G,&'min i32>()
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'min` must outlive `'max`
-   |
-   = help: consider adding the following bound: `'min: 'max`
-
-error: lifetime may not live long enough
-  --> $DIR/variance-covariant-arg-trait-match.rs:21:5
-   |
-LL | fn get_max_from_min<'min, 'max, G>()
-   |                     ----  ---- lifetime `'max` defined here
-   |                     |
-   |                     lifetime `'min` defined here
-...
-LL |     impls_get::<G,&'max i32>()
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'min` must outlive `'max`
-   |
-   = help: consider adding the following bound: `'min: 'max`
-
-error: aborting due to 2 previous errors
-
diff --git a/src/test/ui/variance/variance-covariant-self-trait-match.rs b/src/test/ui/variance/variance-covariant-self-trait-match.rs
deleted file mode 100644
index 93c25e9808f..00000000000
--- a/src/test/ui/variance/variance-covariant-self-trait-match.rs
+++ /dev/null
@@ -1,27 +0,0 @@
-#![allow(dead_code)]
-
-// Test that even when `Self` is only used in covariant position, it
-// is treated as invariant.
-
-trait Get {
-    fn get() -> Self;
-}
-
-fn get_min_from_max<'min, 'max, G>()
-    where 'max : 'min, G : 'max, &'max G : Get
-{
-    // Previously OK, now an error as traits are invariant.
-    impls_get::<&'min G>();
-    //~^ ERROR lifetime may not live long enough
-}
-
-fn get_max_from_min<'min, 'max, G>()
-    where 'max : 'min, G : 'max, &'min G : Get
-{
-    impls_get::<&'max G>();
-    //~^ ERROR lifetime may not live long enough
-}
-
-fn impls_get<G>() where G : Get { }
-
-fn main() { }
diff --git a/src/test/ui/variance/variance-covariant-self-trait-match.stderr b/src/test/ui/variance/variance-covariant-self-trait-match.stderr
deleted file mode 100644
index 9b7ba3b66b8..00000000000
--- a/src/test/ui/variance/variance-covariant-self-trait-match.stderr
+++ /dev/null
@@ -1,28 +0,0 @@
-error: lifetime may not live long enough
-  --> $DIR/variance-covariant-self-trait-match.rs:14:5
-   |
-LL | fn get_min_from_max<'min, 'max, G>()
-   |                     ----  ---- lifetime `'max` defined here
-   |                     |
-   |                     lifetime `'min` defined here
-...
-LL |     impls_get::<&'min G>();
-   |     ^^^^^^^^^^^^^^^^^^^^ requires that `'min` must outlive `'max`
-   |
-   = help: consider adding the following bound: `'min: 'max`
-
-error: lifetime may not live long enough
-  --> $DIR/variance-covariant-self-trait-match.rs:21:5
-   |
-LL | fn get_max_from_min<'min, 'max, G>()
-   |                     ----  ---- lifetime `'max` defined here
-   |                     |
-   |                     lifetime `'min` defined here
-...
-LL |     impls_get::<&'max G>();
-   |     ^^^^^^^^^^^^^^^^^^^^ requires that `'min` must outlive `'max`
-   |
-   = help: consider adding the following bound: `'min: 'max`
-
-error: aborting due to 2 previous errors
-
diff --git a/src/test/ui/variance/variance-invariant-arg-object.rs b/src/test/ui/variance/variance-invariant-arg-object.rs
deleted file mode 100644
index 7381b4130f8..00000000000
--- a/src/test/ui/variance/variance-invariant-arg-object.rs
+++ /dev/null
@@ -1,23 +0,0 @@
-#![allow(dead_code)]
-
-trait Get<T> : 'static {
-    fn get(&self, t: T) -> T;
-}
-
-fn get_min_from_max<'min, 'max>(v: Box<dyn Get<&'max i32>>)
-                                -> Box<dyn Get<&'min i32>>
-    where 'max : 'min
-{
-    v
-    //~^ ERROR lifetime may not live long enough
-}
-
-fn get_max_from_min<'min, 'max>(v: Box<dyn Get<&'min i32>>)
-                                -> Box<dyn Get<&'max i32>>
-    where 'max : 'min
-{
-    v
-    //~^ ERROR lifetime may not live long enough
-}
-
-fn main() { }
diff --git a/src/test/ui/variance/variance-invariant-arg-object.stderr b/src/test/ui/variance/variance-invariant-arg-object.stderr
deleted file mode 100644
index 9793a36be06..00000000000
--- a/src/test/ui/variance/variance-invariant-arg-object.stderr
+++ /dev/null
@@ -1,28 +0,0 @@
-error: lifetime may not live long enough
-  --> $DIR/variance-invariant-arg-object.rs:11:5
-   |
-LL | fn get_min_from_max<'min, 'max>(v: Box<dyn Get<&'max i32>>)
-   |                     ----  ---- lifetime `'max` defined here
-   |                     |
-   |                     lifetime `'min` defined here
-...
-LL |     v
-   |     ^ function was supposed to return data with lifetime `'max` but it is returning data with lifetime `'min`
-   |
-   = help: consider adding the following bound: `'min: 'max`
-
-error: lifetime may not live long enough
-  --> $DIR/variance-invariant-arg-object.rs:19:5
-   |
-LL | fn get_max_from_min<'min, 'max>(v: Box<dyn Get<&'min i32>>)
-   |                     ----  ---- lifetime `'max` defined here
-   |                     |
-   |                     lifetime `'min` defined here
-...
-LL |     v
-   |     ^ function was supposed to return data with lifetime `'max` but it is returning data with lifetime `'min`
-   |
-   = help: consider adding the following bound: `'min: 'max`
-
-error: aborting due to 2 previous errors
-
diff --git a/src/test/ui/variance/variance-invariant-arg-trait-match.rs b/src/test/ui/variance/variance-invariant-arg-trait-match.rs
deleted file mode 100644
index fbcc2438716..00000000000
--- a/src/test/ui/variance/variance-invariant-arg-trait-match.rs
+++ /dev/null
@@ -1,23 +0,0 @@
-#![allow(dead_code)]
-
-trait Get<T> {
-    fn get(&self, t: T) -> T;
-}
-
-fn get_min_from_max<'min, 'max, G>()
-    where 'max : 'min, G : Get<&'max i32>
-{
-    impls_get::<G,&'min i32>()
-    //~^ ERROR lifetime may not live long enough
-}
-
-fn get_max_from_min<'min, 'max, G>()
-    where 'max : 'min, G : Get<&'min i32>
-{
-    impls_get::<G,&'max i32>()
-    //~^ ERROR lifetime may not live long enough
-}
-
-fn impls_get<G,T>() where G : Get<T> { }
-
-fn main() { }
diff --git a/src/test/ui/variance/variance-invariant-arg-trait-match.stderr b/src/test/ui/variance/variance-invariant-arg-trait-match.stderr
deleted file mode 100644
index 60ffdd02952..00000000000
--- a/src/test/ui/variance/variance-invariant-arg-trait-match.stderr
+++ /dev/null
@@ -1,28 +0,0 @@
-error: lifetime may not live long enough
-  --> $DIR/variance-invariant-arg-trait-match.rs:10:5
-   |
-LL | fn get_min_from_max<'min, 'max, G>()
-   |                     ----  ---- lifetime `'max` defined here
-   |                     |
-   |                     lifetime `'min` defined here
-...
-LL |     impls_get::<G,&'min i32>()
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'min` must outlive `'max`
-   |
-   = help: consider adding the following bound: `'min: 'max`
-
-error: lifetime may not live long enough
-  --> $DIR/variance-invariant-arg-trait-match.rs:17:5
-   |
-LL | fn get_max_from_min<'min, 'max, G>()
-   |                     ----  ---- lifetime `'max` defined here
-   |                     |
-   |                     lifetime `'min` defined here
-...
-LL |     impls_get::<G,&'max i32>()
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'min` must outlive `'max`
-   |
-   = help: consider adding the following bound: `'min: 'max`
-
-error: aborting due to 2 previous errors
-
diff --git a/src/test/ui/variance/variance-invariant-self-trait-match.rs b/src/test/ui/variance/variance-invariant-self-trait-match.rs
deleted file mode 100644
index 95c4c24032c..00000000000
--- a/src/test/ui/variance/variance-invariant-self-trait-match.rs
+++ /dev/null
@@ -1,23 +0,0 @@
-#![allow(dead_code)]
-
-trait Get {
-    fn get(&self) -> Self;
-}
-
-fn get_min_from_max<'min, 'max, G>()
-    where 'max : 'min, &'max G : Get, G : 'max
-{
-    impls_get::<&'min G>();
-    //~^ ERROR lifetime may not live long enough
-}
-
-fn get_max_from_min<'min, 'max, G>()
-    where 'max : 'min, &'min G : Get, G : 'min
-{
-    impls_get::<&'max G>();
-    //~^ ERROR lifetime may not live long enough
-}
-
-fn impls_get<G>() where G : Get { }
-
-fn main() { }
diff --git a/src/test/ui/variance/variance-invariant-self-trait-match.stderr b/src/test/ui/variance/variance-invariant-self-trait-match.stderr
deleted file mode 100644
index 5b64bd0913a..00000000000
--- a/src/test/ui/variance/variance-invariant-self-trait-match.stderr
+++ /dev/null
@@ -1,28 +0,0 @@
-error: lifetime may not live long enough
-  --> $DIR/variance-invariant-self-trait-match.rs:10:5
-   |
-LL | fn get_min_from_max<'min, 'max, G>()
-   |                     ----  ---- lifetime `'max` defined here
-   |                     |
-   |                     lifetime `'min` defined here
-...
-LL |     impls_get::<&'min G>();
-   |     ^^^^^^^^^^^^^^^^^^^^ requires that `'min` must outlive `'max`
-   |
-   = help: consider adding the following bound: `'min: 'max`
-
-error: lifetime may not live long enough
-  --> $DIR/variance-invariant-self-trait-match.rs:17:5
-   |
-LL | fn get_max_from_min<'min, 'max, G>()
-   |                     ----  ---- lifetime `'max` defined here
-   |                     |
-   |                     lifetime `'min` defined here
-...
-LL |     impls_get::<&'max G>();
-   |     ^^^^^^^^^^^^^^^^^^^^ requires that `'min` must outlive `'max`
-   |
-   = help: consider adding the following bound: `'min: 'max`
-
-error: aborting due to 2 previous errors
-
diff --git a/src/test/ui/variance/variance-issue-20533.rs b/src/test/ui/variance/variance-issue-20533.rs
deleted file mode 100644
index a2459f8730c..00000000000
--- a/src/test/ui/variance/variance-issue-20533.rs
+++ /dev/null
@@ -1,43 +0,0 @@
-// Regression test for issue #20533. At some point, only 1 out of the
-// 3 errors below were being reported.
-
-use std::marker::PhantomData;
-
-fn foo<'a, T>(_x: &'a T) -> PhantomData<&'a ()> {
-    PhantomData
-}
-
-struct Wrap<T>(T);
-
-fn bar<'a, T>(_x: &'a T) -> Wrap<PhantomData<&'a ()>> {
-    Wrap(PhantomData)
-}
-
-struct Baked<'a>(PhantomData<&'a ()>);
-
-fn baz<'a, T>(_x: &'a T) -> Baked<'a> {
-    Baked(PhantomData)
-}
-
-struct AffineU32(u32);
-
-fn main() {
-    {
-        let a = AffineU32(1);
-        let x = foo(&a);
-        drop(a); //~ ERROR cannot move out of `a`
-        drop(x);
-    }
-    {
-        let a = AffineU32(1);
-        let x = bar(&a);
-        drop(a); //~ ERROR cannot move out of `a`
-        drop(x);
-    }
-    {
-        let a = AffineU32(1);
-        let x = baz(&a);
-        drop(a); //~ ERROR cannot move out of `a`
-        drop(x);
-    }
-}
diff --git a/src/test/ui/variance/variance-issue-20533.stderr b/src/test/ui/variance/variance-issue-20533.stderr
deleted file mode 100644
index 008e2a002bb..00000000000
--- a/src/test/ui/variance/variance-issue-20533.stderr
+++ /dev/null
@@ -1,33 +0,0 @@
-error[E0505]: cannot move out of `a` because it is borrowed
-  --> $DIR/variance-issue-20533.rs:28:14
-   |
-LL |         let x = foo(&a);
-   |                     -- borrow of `a` occurs here
-LL |         drop(a);
-   |              ^ move out of `a` occurs here
-LL |         drop(x);
-   |              - borrow later used here
-
-error[E0505]: cannot move out of `a` because it is borrowed
-  --> $DIR/variance-issue-20533.rs:34:14
-   |
-LL |         let x = bar(&a);
-   |                     -- borrow of `a` occurs here
-LL |         drop(a);
-   |              ^ move out of `a` occurs here
-LL |         drop(x);
-   |              - borrow later used here
-
-error[E0505]: cannot move out of `a` because it is borrowed
-  --> $DIR/variance-issue-20533.rs:40:14
-   |
-LL |         let x = baz(&a);
-   |                     -- borrow of `a` occurs here
-LL |         drop(a);
-   |              ^ move out of `a` occurs here
-LL |         drop(x);
-   |              - borrow later used here
-
-error: aborting due to 3 previous errors
-
-For more information about this error, try `rustc --explain E0505`.
diff --git a/src/test/ui/variance/variance-object-types.rs b/src/test/ui/variance/variance-object-types.rs
deleted file mode 100644
index 6ded24cd1e9..00000000000
--- a/src/test/ui/variance/variance-object-types.rs
+++ /dev/null
@@ -1,12 +0,0 @@
-#![feature(rustc_attrs)]
-
-
-// For better or worse, associated types are invariant, and hence we
-// get an invariant result for `'a`.
-#[rustc_variance]
-struct Foo<'a> { //~ ERROR [o]
-    x: Box<dyn Fn(i32) -> &'a i32 + 'static>
-}
-
-fn main() {
-}
diff --git a/src/test/ui/variance/variance-object-types.stderr b/src/test/ui/variance/variance-object-types.stderr
deleted file mode 100644
index 1c3c1a6d1f2..00000000000
--- a/src/test/ui/variance/variance-object-types.stderr
+++ /dev/null
@@ -1,9 +0,0 @@
-error[E0208]: [o]
-  --> $DIR/variance-object-types.rs:7:1
-   |
-LL | struct Foo<'a> {
-   | ^^^^^^^^^^^^^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0208`.
diff --git a/src/test/ui/variance/variance-regions-direct.rs b/src/test/ui/variance/variance-regions-direct.rs
deleted file mode 100644
index 3f34e7655f3..00000000000
--- a/src/test/ui/variance/variance-regions-direct.rs
+++ /dev/null
@@ -1,65 +0,0 @@
-// Test that we correctly infer variance for region parameters in
-// various self-contained types.
-
-#![feature(rustc_attrs)]
-
-// Regions that just appear in normal spots are contravariant:
-
-#[rustc_variance]
-struct Test2<'a, 'b, 'c> { //~ ERROR [-, -, -]
-    x: &'a isize,
-    y: &'b [isize],
-    c: &'c str
-}
-
-// Those same annotations in function arguments become covariant:
-
-#[rustc_variance]
-struct Test3<'a, 'b, 'c> { //~ ERROR [+, +, +]
-    x: extern "Rust" fn(&'a isize),
-    y: extern "Rust" fn(&'b [isize]),
-    c: extern "Rust" fn(&'c str),
-}
-
-// Mutability induces invariance:
-
-#[rustc_variance]
-struct Test4<'a, 'b:'a> { //~ ERROR [-, o]
-    x: &'a mut &'b isize,
-}
-
-// Mutability induces invariance, even when in a
-// contravariant context:
-
-#[rustc_variance]
-struct Test5<'a, 'b:'a> { //~ ERROR [+, o]
-    x: extern "Rust" fn(&'a mut &'b isize),
-}
-
-// Invariance is a trap from which NO ONE CAN ESCAPE.
-// In other words, even though the `&'b isize` occurs in
-// an argument list (which is contravariant), that
-// argument list occurs in an invariant context.
-
-#[rustc_variance]
-struct Test6<'a, 'b:'a> { //~ ERROR [-, o]
-    x: &'a mut extern "Rust" fn(&'b isize),
-}
-
-// No uses at all is bivariant:
-
-#[rustc_variance]
-struct Test7<'a> { //~ ERROR [*]
-    x: isize
-}
-
-// Try enums too.
-
-#[rustc_variance]
-enum Test8<'a, 'b, 'c:'b> { //~ ERROR [+, -, o]
-    Test8A(extern "Rust" fn(&'a isize)),
-    Test8B(&'b [isize]),
-    Test8C(&'b mut &'c str),
-}
-
-fn main() {}
diff --git a/src/test/ui/variance/variance-regions-direct.stderr b/src/test/ui/variance/variance-regions-direct.stderr
deleted file mode 100644
index 27d69b6e825..00000000000
--- a/src/test/ui/variance/variance-regions-direct.stderr
+++ /dev/null
@@ -1,45 +0,0 @@
-error[E0208]: [-, -, -]
-  --> $DIR/variance-regions-direct.rs:9:1
-   |
-LL | struct Test2<'a, 'b, 'c> {
-   | ^^^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0208]: [+, +, +]
-  --> $DIR/variance-regions-direct.rs:18:1
-   |
-LL | struct Test3<'a, 'b, 'c> {
-   | ^^^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0208]: [-, o]
-  --> $DIR/variance-regions-direct.rs:27:1
-   |
-LL | struct Test4<'a, 'b:'a> {
-   | ^^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0208]: [+, o]
-  --> $DIR/variance-regions-direct.rs:35:1
-   |
-LL | struct Test5<'a, 'b:'a> {
-   | ^^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0208]: [-, o]
-  --> $DIR/variance-regions-direct.rs:45:1
-   |
-LL | struct Test6<'a, 'b:'a> {
-   | ^^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0208]: [*]
-  --> $DIR/variance-regions-direct.rs:52:1
-   |
-LL | struct Test7<'a> {
-   | ^^^^^^^^^^^^^^^^
-
-error[E0208]: [+, -, o]
-  --> $DIR/variance-regions-direct.rs:59:1
-   |
-LL | enum Test8<'a, 'b, 'c:'b> {
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to 7 previous errors
-
-For more information about this error, try `rustc --explain E0208`.
diff --git a/src/test/ui/variance/variance-regions-indirect.rs b/src/test/ui/variance/variance-regions-indirect.rs
deleted file mode 100644
index f84f25ada14..00000000000
--- a/src/test/ui/variance/variance-regions-indirect.rs
+++ /dev/null
@@ -1,34 +0,0 @@
-// Test that we correctly infer variance for region parameters in
-// case that involve multiple intricate types.
-// Try enums too.
-
-#![feature(rustc_attrs)]
-
-#[rustc_variance]
-enum Base<'a, 'b, 'c:'b, 'd> { //~ ERROR [+, -, o, *]
-    Test8A(extern "Rust" fn(&'a isize)),
-    Test8B(&'b [isize]),
-    Test8C(&'b mut &'c str),
-}
-
-#[rustc_variance]
-struct Derived1<'w, 'x:'y, 'y, 'z> { //~ ERROR [*, o, -, +]
-    f: Base<'z, 'y, 'x, 'w>
-}
-
-#[rustc_variance] // Combine - and + to yield o
-struct Derived2<'a, 'b:'a, 'c> { //~ ERROR [o, o, *]
-    f: Base<'a, 'a, 'b, 'c>
-}
-
-#[rustc_variance] // Combine + and o to yield o (just pay attention to 'a here)
-struct Derived3<'a:'b, 'b, 'c> { //~ ERROR [o, -, *]
-    f: Base<'a, 'b, 'a, 'c>
-}
-
-#[rustc_variance] // Combine + and * to yield + (just pay attention to 'a here)
-struct Derived4<'a, 'b, 'c:'b> { //~ ERROR [+, -, o]
-    f: Base<'a, 'b, 'c, 'a>
-}
-
-fn main() {}
diff --git a/src/test/ui/variance/variance-regions-indirect.stderr b/src/test/ui/variance/variance-regions-indirect.stderr
deleted file mode 100644
index 535e97db3fb..00000000000
--- a/src/test/ui/variance/variance-regions-indirect.stderr
+++ /dev/null
@@ -1,33 +0,0 @@
-error[E0208]: [+, -, o, *]
-  --> $DIR/variance-regions-indirect.rs:8:1
-   |
-LL | enum Base<'a, 'b, 'c:'b, 'd> {
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0208]: [*, o, -, +]
-  --> $DIR/variance-regions-indirect.rs:15:1
-   |
-LL | struct Derived1<'w, 'x:'y, 'y, 'z> {
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0208]: [o, o, *]
-  --> $DIR/variance-regions-indirect.rs:20:1
-   |
-LL | struct Derived2<'a, 'b:'a, 'c> {
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0208]: [o, -, *]
-  --> $DIR/variance-regions-indirect.rs:25:1
-   |
-LL | struct Derived3<'a:'b, 'b, 'c> {
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0208]: [+, -, o]
-  --> $DIR/variance-regions-indirect.rs:30:1
-   |
-LL | struct Derived4<'a, 'b, 'c:'b> {
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to 5 previous errors
-
-For more information about this error, try `rustc --explain E0208`.
diff --git a/src/test/ui/variance/variance-regions-unused-direct.rs b/src/test/ui/variance/variance-regions-unused-direct.rs
deleted file mode 100644
index 2afe012bdf2..00000000000
--- a/src/test/ui/variance/variance-regions-unused-direct.rs
+++ /dev/null
@@ -1,15 +0,0 @@
-// Test that disallow lifetime parameters that are unused.
-
-use std::marker;
-
-struct Bivariant<'a>; //~ ERROR parameter `'a` is never used
-
-struct Struct<'a, 'd> { //~ ERROR parameter `'d` is never used
-    field: &'a [i32]
-}
-
-trait Trait<'a, 'd> { // OK on traits
-    fn method(&'a self);
-}
-
-fn main() {}
diff --git a/src/test/ui/variance/variance-regions-unused-direct.stderr b/src/test/ui/variance/variance-regions-unused-direct.stderr
deleted file mode 100644
index 1a600f5b058..00000000000
--- a/src/test/ui/variance/variance-regions-unused-direct.stderr
+++ /dev/null
@@ -1,19 +0,0 @@
-error[E0392]: parameter `'a` is never used
-  --> $DIR/variance-regions-unused-direct.rs:5:18
-   |
-LL | struct Bivariant<'a>;
-   |                  ^^ unused parameter
-   |
-   = help: consider removing `'a`, referring to it in a field, or using a marker such as `PhantomData`
-
-error[E0392]: parameter `'d` is never used
-  --> $DIR/variance-regions-unused-direct.rs:7:19
-   |
-LL | struct Struct<'a, 'd> {
-   |                   ^^ unused parameter
-   |
-   = help: consider removing `'d`, referring to it in a field, or using a marker such as `PhantomData`
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0392`.
diff --git a/src/test/ui/variance/variance-regions-unused-indirect.rs b/src/test/ui/variance/variance-regions-unused-indirect.rs
deleted file mode 100644
index 6c2c24ddbc7..00000000000
--- a/src/test/ui/variance/variance-regions-unused-indirect.rs
+++ /dev/null
@@ -1,12 +0,0 @@
-// 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>)
-}
-
-enum Bar<'a> { //~ ERROR parameter `'a` is never used
-    Bar1(Foo<'a>)
-}
-
-fn main() {}
diff --git a/src/test/ui/variance/variance-regions-unused-indirect.stderr b/src/test/ui/variance/variance-regions-unused-indirect.stderr
deleted file mode 100644
index 14fdd849294..00000000000
--- a/src/test/ui/variance/variance-regions-unused-indirect.stderr
+++ /dev/null
@@ -1,43 +0,0 @@
-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
-   |
-LL | enum Foo<'a> {
-   |          ^^ unused parameter
-   |
-   = 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: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 3 previous errors
-
-Some errors have detailed explanations: E0072, E0392.
-For more information about an error, try `rustc --explain E0072`.
diff --git a/src/test/ui/variance/variance-trait-bounds.rs b/src/test/ui/variance/variance-trait-bounds.rs
deleted file mode 100644
index ad5334602a2..00000000000
--- a/src/test/ui/variance/variance-trait-bounds.rs
+++ /dev/null
@@ -1,35 +0,0 @@
-#![allow(dead_code)]
-#![feature(rustc_attrs)]
-
-// Check that bounds on type parameters (other than `Self`) do not
-// influence variance.
-
-trait Getter<T> {
-    fn get(&self) -> T;
-}
-
-trait Setter<T> {
-    fn get(&self, _: T);
-}
-
-#[rustc_variance]
-struct TestStruct<U,T:Setter<U>> { //~ ERROR [+, +]
-    t: T, u: U
-}
-
-#[rustc_variance]
-enum TestEnum<U,T:Setter<U>> { //~ ERROR [*, +]
-    Foo(T)
-}
-
-#[rustc_variance]
-struct TestContraStruct<U,T:Setter<U>> { //~ ERROR [*, +]
-    t: T
-}
-
-#[rustc_variance]
-struct TestBox<U,T:Getter<U>+Setter<U>> { //~ ERROR [*, +]
-    t: T
-}
-
-pub fn main() { }
diff --git a/src/test/ui/variance/variance-trait-bounds.stderr b/src/test/ui/variance/variance-trait-bounds.stderr
deleted file mode 100644
index 3f6ca62a640..00000000000
--- a/src/test/ui/variance/variance-trait-bounds.stderr
+++ /dev/null
@@ -1,27 +0,0 @@
-error[E0208]: [+, +]
-  --> $DIR/variance-trait-bounds.rs:16:1
-   |
-LL | struct TestStruct<U,T:Setter<U>> {
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0208]: [*, +]
-  --> $DIR/variance-trait-bounds.rs:21:1
-   |
-LL | enum TestEnum<U,T:Setter<U>> {
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0208]: [*, +]
-  --> $DIR/variance-trait-bounds.rs:26:1
-   |
-LL | struct TestContraStruct<U,T:Setter<U>> {
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0208]: [*, +]
-  --> $DIR/variance-trait-bounds.rs:31:1
-   |
-LL | struct TestBox<U,T:Getter<U>+Setter<U>> {
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to 4 previous errors
-
-For more information about this error, try `rustc --explain E0208`.
diff --git a/src/test/ui/variance/variance-trait-matching.rs b/src/test/ui/variance/variance-trait-matching.rs
deleted file mode 100644
index b4efee7d604..00000000000
--- a/src/test/ui/variance/variance-trait-matching.rs
+++ /dev/null
@@ -1,38 +0,0 @@
-#![allow(dead_code)]
-
-// Get<T> is covariant in T
-trait Get<T> {
-    fn get(&self) -> T;
-}
-
-struct Cloner<T:Clone> {
-    t: T
-}
-
-impl<T:Clone> Get<T> for Cloner<T> {
-    fn get(&self) -> T {
-        self.t.clone()
-    }
-}
-
-fn get<'a, G>(get: &G) -> i32
-    where G : Get<&'a i32>
-{
-    // This fails to type-check because, without variance, we can't
-    // use `G : Get<&'a i32>` as evidence that `G : Get<&'b i32>`,
-    // even if `'a : 'b`.
-    pick(get, &22) //~ ERROR explicit lifetime required in the type of `get` [E0621]
-}
-
-fn pick<'b, G>(get: &'b G, if_odd: &'b i32) -> i32
-    where G : Get<&'b i32>
-{
-    let v = *get.get();
-    if v % 2 != 0 { v } else { *if_odd }
-}
-
-fn main() {
-    let x = Cloner { t: &23 };
-    let y = get(&x);
-    assert_eq!(y, 23);
-}
diff --git a/src/test/ui/variance/variance-trait-matching.stderr b/src/test/ui/variance/variance-trait-matching.stderr
deleted file mode 100644
index 3308cc6d250..00000000000
--- a/src/test/ui/variance/variance-trait-matching.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-error[E0621]: explicit lifetime required in the type of `get`
-  --> $DIR/variance-trait-matching.rs:24:5
-   |
-LL | fn get<'a, G>(get: &G) -> i32
-   |                    -- help: add explicit lifetime `'a` to the type of `get`: `&'a G`
-...
-LL |     pick(get, &22)
-   |     ^^^^^^^^^^^^^^ lifetime `'a` required
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0621`.
diff --git a/src/test/ui/variance/variance-trait-object-bound.rs b/src/test/ui/variance/variance-trait-object-bound.rs
deleted file mode 100644
index ec3c973bc76..00000000000
--- a/src/test/ui/variance/variance-trait-object-bound.rs
+++ /dev/null
@@ -1,18 +0,0 @@
-// Checks that regions which appear in a trait object type are
-// observed by the variance inference algorithm (and hence
-// `TOption` is contavariant w/r/t `'a` and not bivariant).
-//
-// Issue #18262.
-
-#![feature(rustc_attrs)]
-
-use std::mem;
-
-trait T { fn foo(&self); }
-
-#[rustc_variance]
-struct TOption<'a> { //~ ERROR [-]
-    v: Option<Box<dyn T + 'a>>,
-}
-
-fn main() { }
diff --git a/src/test/ui/variance/variance-trait-object-bound.stderr b/src/test/ui/variance/variance-trait-object-bound.stderr
deleted file mode 100644
index 9a2c924b96a..00000000000
--- a/src/test/ui/variance/variance-trait-object-bound.stderr
+++ /dev/null
@@ -1,9 +0,0 @@
-error[E0208]: [-]
-  --> $DIR/variance-trait-object-bound.rs:14:1
-   |
-LL | struct TOption<'a> {
-   | ^^^^^^^^^^^^^^^^^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0208`.
diff --git a/src/test/ui/variance/variance-types-bounds.rs b/src/test/ui/variance/variance-types-bounds.rs
deleted file mode 100644
index d1814dd97a0..00000000000
--- a/src/test/ui/variance/variance-types-bounds.rs
+++ /dev/null
@@ -1,43 +0,0 @@
-// Test that we correctly infer variance for type parameters in
-// various types and traits.
-
-#![feature(rustc_attrs)]
-
-#[rustc_variance]
-struct TestImm<A, B> { //~ ERROR [+, +]
-    x: A,
-    y: B,
-}
-
-#[rustc_variance]
-struct TestMut<A, B:'static> { //~ ERROR [+, o]
-    x: A,
-    y: &'static mut B,
-}
-
-#[rustc_variance]
-struct TestIndirect<A:'static, B:'static> { //~ ERROR [+, o]
-    m: TestMut<A, B>
-}
-
-#[rustc_variance]
-struct TestIndirect2<A:'static, B:'static> { //~ ERROR [o, o]
-    n: TestMut<A, B>,
-    m: TestMut<B, A>
-}
-
-trait Getter<A> {
-    fn get(&self) -> A;
-}
-
-trait Setter<A> {
-    fn set(&mut self, a: A);
-}
-
-#[rustc_variance]
-struct TestObject<A, R> { //~ ERROR [o, o]
-    n: Box<dyn Setter<A>+Send>,
-    m: Box<dyn Getter<R>+Send>,
-}
-
-fn main() {}
diff --git a/src/test/ui/variance/variance-types-bounds.stderr b/src/test/ui/variance/variance-types-bounds.stderr
deleted file mode 100644
index 523763b8a07..00000000000
--- a/src/test/ui/variance/variance-types-bounds.stderr
+++ /dev/null
@@ -1,33 +0,0 @@
-error[E0208]: [+, +]
-  --> $DIR/variance-types-bounds.rs:7:1
-   |
-LL | struct TestImm<A, B> {
-   | ^^^^^^^^^^^^^^^^^^^^
-
-error[E0208]: [+, o]
-  --> $DIR/variance-types-bounds.rs:13:1
-   |
-LL | struct TestMut<A, B:'static> {
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0208]: [+, o]
-  --> $DIR/variance-types-bounds.rs:19:1
-   |
-LL | struct TestIndirect<A:'static, B:'static> {
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0208]: [o, o]
-  --> $DIR/variance-types-bounds.rs:24:1
-   |
-LL | struct TestIndirect2<A:'static, B:'static> {
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0208]: [o, o]
-  --> $DIR/variance-types-bounds.rs:38:1
-   |
-LL | struct TestObject<A, R> {
-   | ^^^^^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to 5 previous errors
-
-For more information about this error, try `rustc --explain E0208`.
diff --git a/src/test/ui/variance/variance-types.rs b/src/test/ui/variance/variance-types.rs
deleted file mode 100644
index b9b6d9c9bb5..00000000000
--- a/src/test/ui/variance/variance-types.rs
+++ /dev/null
@@ -1,41 +0,0 @@
-#![allow(dead_code)]
-#![feature(rustc_attrs)]
-
-use std::cell::Cell;
-
-// Check that a type parameter which is only used in a trait bound is
-// not considered bivariant.
-
-#[rustc_variance]
-struct InvariantMut<'a,A:'a,B:'a> { //~ ERROR [-, o, o]
-    t: &'a mut (A,B)
-}
-
-#[rustc_variance]
-struct InvariantCell<A> { //~ ERROR [o]
-    t: Cell<A>
-}
-
-#[rustc_variance]
-struct InvariantIndirect<A> { //~ ERROR [o]
-    t: InvariantCell<A>
-}
-
-#[rustc_variance]
-struct Covariant<A> { //~ ERROR [+]
-    t: A, u: fn() -> A
-}
-
-#[rustc_variance]
-struct Contravariant<A> { //~ ERROR [-]
-    t: fn(A)
-}
-
-#[rustc_variance]
-enum Enum<A,B,C> { //~ ERROR [+, -, o]
-    Foo(Covariant<A>),
-    Bar(Contravariant<B>),
-    Zed(Covariant<C>,Contravariant<C>)
-}
-
-pub fn main() { }
diff --git a/src/test/ui/variance/variance-types.stderr b/src/test/ui/variance/variance-types.stderr
deleted file mode 100644
index 5a5aaecffc5..00000000000
--- a/src/test/ui/variance/variance-types.stderr
+++ /dev/null
@@ -1,39 +0,0 @@
-error[E0208]: [-, o, o]
-  --> $DIR/variance-types.rs:10:1
-   |
-LL | struct InvariantMut<'a,A:'a,B:'a> {
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0208]: [o]
-  --> $DIR/variance-types.rs:15:1
-   |
-LL | struct InvariantCell<A> {
-   | ^^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0208]: [o]
-  --> $DIR/variance-types.rs:20:1
-   |
-LL | struct InvariantIndirect<A> {
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0208]: [+]
-  --> $DIR/variance-types.rs:25:1
-   |
-LL | struct Covariant<A> {
-   | ^^^^^^^^^^^^^^^^^^^
-
-error[E0208]: [-]
-  --> $DIR/variance-types.rs:30:1
-   |
-LL | struct Contravariant<A> {
-   | ^^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0208]: [+, -, o]
-  --> $DIR/variance-types.rs:35:1
-   |
-LL | enum Enum<A,B,C> {
-   | ^^^^^^^^^^^^^^^^
-
-error: aborting due to 6 previous errors
-
-For more information about this error, try `rustc --explain E0208`.
diff --git a/src/test/ui/variance/variance-unused-region-param.rs b/src/test/ui/variance/variance-unused-region-param.rs
deleted file mode 100644
index f0e4e03c9db..00000000000
--- a/src/test/ui/variance/variance-unused-region-param.rs
+++ /dev/null
@@ -1,7 +0,0 @@
-// Test that we report an error for unused type parameters in types.
-
-struct SomeStruct<'a> { x: u32 } //~ ERROR parameter `'a` is never used
-enum SomeEnum<'a> { Nothing } //~ ERROR parameter `'a` is never used
-trait SomeTrait<'a> { fn foo(&self); } // OK on traits.
-
-fn main() {}
diff --git a/src/test/ui/variance/variance-unused-region-param.stderr b/src/test/ui/variance/variance-unused-region-param.stderr
deleted file mode 100644
index 7c7ec40ba35..00000000000
--- a/src/test/ui/variance/variance-unused-region-param.stderr
+++ /dev/null
@@ -1,19 +0,0 @@
-error[E0392]: parameter `'a` is never used
-  --> $DIR/variance-unused-region-param.rs:3:19
-   |
-LL | struct SomeStruct<'a> { x: u32 }
-   |                   ^^ unused parameter
-   |
-   = 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-unused-region-param.rs:4:15
-   |
-LL | enum SomeEnum<'a> { Nothing }
-   |               ^^ 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
-
-For more information about this error, try `rustc --explain E0392`.
diff --git a/src/test/ui/variance/variance-unused-type-param.rs b/src/test/ui/variance/variance-unused-type-param.rs
deleted file mode 100644
index d1114064364..00000000000
--- a/src/test/ui/variance/variance-unused-type-param.rs
+++ /dev/null
@@ -1,28 +0,0 @@
-#![allow(dead_code)]
-
-// Test that we report an error for unused type parameters in types and traits,
-// and that we offer a helpful suggestion.
-
-struct SomeStruct<A> { x: u32 }
-//~^ ERROR parameter `A` is never used
-
-enum SomeEnum<A> { Nothing }
-//~^ ERROR parameter `A` is never used
-
-// Here T might *appear* used, but in fact it isn't.
-enum ListCell<T> {
-//~^ ERROR parameter `T` is never used
-    Cons(Box<ListCell<T>>),
-    Nil
-}
-
-struct WithBounds<T: Sized> {}
-//~^ ERROR parameter `T` is never used
-
-struct WithWhereBounds<T> where T: Sized {}
-//~^ ERROR parameter `T` is never used
-
-struct WithOutlivesBounds<T: 'static> {}
-//~^ ERROR parameter `T` is never used
-
-fn main() {}
diff --git a/src/test/ui/variance/variance-unused-type-param.stderr b/src/test/ui/variance/variance-unused-type-param.stderr
deleted file mode 100644
index e612da118f0..00000000000
--- a/src/test/ui/variance/variance-unused-type-param.stderr
+++ /dev/null
@@ -1,54 +0,0 @@
-error[E0392]: parameter `A` is never used
-  --> $DIR/variance-unused-type-param.rs:6:19
-   |
-LL | struct SomeStruct<A> { x: u32 }
-   |                   ^ unused parameter
-   |
-   = help: consider removing `A`, referring to it in a field, or using a marker such as `PhantomData`
-   = help: if you intended `A` to be a const parameter, use `const A: usize` instead
-
-error[E0392]: parameter `A` is never used
-  --> $DIR/variance-unused-type-param.rs:9:15
-   |
-LL | enum SomeEnum<A> { Nothing }
-   |               ^ unused parameter
-   |
-   = help: consider removing `A`, referring to it in a field, or using a marker such as `PhantomData`
-   = help: if you intended `A` to be a const parameter, use `const A: usize` instead
-
-error[E0392]: parameter `T` is never used
-  --> $DIR/variance-unused-type-param.rs:13:15
-   |
-LL | enum ListCell<T> {
-   |               ^ unused parameter
-   |
-   = help: consider removing `T`, referring to it in a field, or using a marker such as `PhantomData`
-   = help: if you intended `T` to be a const parameter, use `const T: usize` instead
-
-error[E0392]: parameter `T` is never used
-  --> $DIR/variance-unused-type-param.rs:19:19
-   |
-LL | struct WithBounds<T: Sized> {}
-   |                   ^ unused parameter
-   |
-   = help: consider removing `T`, referring to it in a field, or using a marker such as `PhantomData`
-
-error[E0392]: parameter `T` is never used
-  --> $DIR/variance-unused-type-param.rs:22:24
-   |
-LL | struct WithWhereBounds<T> where T: Sized {}
-   |                        ^ unused parameter
-   |
-   = help: consider removing `T`, referring to it in a field, or using a marker such as `PhantomData`
-
-error[E0392]: parameter `T` is never used
-  --> $DIR/variance-unused-type-param.rs:25:27
-   |
-LL | struct WithOutlivesBounds<T: 'static> {}
-   |                           ^ unused parameter
-   |
-   = help: consider removing `T`, referring to it in a field, or using a marker such as `PhantomData`
-
-error: aborting due to 6 previous errors
-
-For more information about this error, try `rustc --explain E0392`.
diff --git a/src/test/ui/variance/variance-use-contravariant-struct-1.rs b/src/test/ui/variance/variance-use-contravariant-struct-1.rs
deleted file mode 100644
index 40781fbf082..00000000000
--- a/src/test/ui/variance/variance-use-contravariant-struct-1.rs
+++ /dev/null
@@ -1,15 +0,0 @@
-// Test various uses of structs with distinct variances to make sure
-// they permit lifetimes to be approximated as expected.
-
-struct SomeStruct<T>(fn(T));
-
-fn foo<'min,'max>(v: SomeStruct<&'max ()>)
-                  -> SomeStruct<&'min ()>
-    where 'max : 'min
-{
-    v
-    //~^ ERROR lifetime may not live long enough
-}
-
-
-fn main() { }
diff --git a/src/test/ui/variance/variance-use-contravariant-struct-1.stderr b/src/test/ui/variance/variance-use-contravariant-struct-1.stderr
deleted file mode 100644
index 50de7c90f13..00000000000
--- a/src/test/ui/variance/variance-use-contravariant-struct-1.stderr
+++ /dev/null
@@ -1,15 +0,0 @@
-error: lifetime may not live long enough
-  --> $DIR/variance-use-contravariant-struct-1.rs:10:5
-   |
-LL | fn foo<'min,'max>(v: SomeStruct<&'max ()>)
-   |        ---- ---- lifetime `'max` defined here
-   |        |
-   |        lifetime `'min` defined here
-...
-LL |     v
-   |     ^ function was supposed to return data with lifetime `'max` but it is returning data with lifetime `'min`
-   |
-   = help: consider adding the following bound: `'min: 'max`
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/variance/variance-use-contravariant-struct-2.rs b/src/test/ui/variance/variance-use-contravariant-struct-2.rs
deleted file mode 100644
index d4b2d08342a..00000000000
--- a/src/test/ui/variance/variance-use-contravariant-struct-2.rs
+++ /dev/null
@@ -1,17 +0,0 @@
-// Test various uses of structs with distinct variances to make sure
-// they permit lifetimes to be approximated as expected.
-
-#![allow(dead_code)]
-// build-pass (FIXME(62277): could be check-pass?)
-
-struct SomeStruct<T>(fn(T));
-
-fn bar<'min,'max>(v: SomeStruct<&'min ()>)
-                  -> SomeStruct<&'max ()>
-    where 'max : 'min
-{
-    v
-}
-
-
-fn main() { }
diff --git a/src/test/ui/variance/variance-use-covariant-struct-1.rs b/src/test/ui/variance/variance-use-covariant-struct-1.rs
deleted file mode 100644
index f0fd7b26e4e..00000000000
--- a/src/test/ui/variance/variance-use-covariant-struct-1.rs
+++ /dev/null
@@ -1,14 +0,0 @@
-// Test that a covariant struct does not permit the lifetime of a
-// reference to be enlarged.
-
-struct SomeStruct<T>(T);
-
-fn foo<'min,'max>(v: SomeStruct<&'min ()>)
-                  -> SomeStruct<&'max ()>
-    where 'max : 'min
-{
-    v
-    //~^ ERROR lifetime may not live long enough
-}
-
-fn main() { }
diff --git a/src/test/ui/variance/variance-use-covariant-struct-1.stderr b/src/test/ui/variance/variance-use-covariant-struct-1.stderr
deleted file mode 100644
index bab858c5acb..00000000000
--- a/src/test/ui/variance/variance-use-covariant-struct-1.stderr
+++ /dev/null
@@ -1,15 +0,0 @@
-error: lifetime may not live long enough
-  --> $DIR/variance-use-covariant-struct-1.rs:10:5
-   |
-LL | fn foo<'min,'max>(v: SomeStruct<&'min ()>)
-   |        ---- ---- lifetime `'max` defined here
-   |        |
-   |        lifetime `'min` defined here
-...
-LL |     v
-   |     ^ function was supposed to return data with lifetime `'max` but it is returning data with lifetime `'min`
-   |
-   = help: consider adding the following bound: `'min: 'max`
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/variance/variance-use-covariant-struct-2.rs b/src/test/ui/variance/variance-use-covariant-struct-2.rs
deleted file mode 100644
index ecd2204c991..00000000000
--- a/src/test/ui/variance/variance-use-covariant-struct-2.rs
+++ /dev/null
@@ -1,16 +0,0 @@
-// Test that a covariant struct permits the lifetime of a reference to
-// be shortened.
-
-#![allow(dead_code)]
-// build-pass (FIXME(62277): could be check-pass?)
-
-struct SomeStruct<T>(T);
-
-fn foo<'min,'max>(v: SomeStruct<&'max ()>)
-                  -> SomeStruct<&'min ()>
-    where 'max : 'min
-{
-    v
-}
-
-fn main() { }
diff --git a/src/test/ui/variance/variance-use-invariant-struct-1.rs b/src/test/ui/variance/variance-use-invariant-struct-1.rs
deleted file mode 100644
index 72f50f3459d..00000000000
--- a/src/test/ui/variance/variance-use-invariant-struct-1.rs
+++ /dev/null
@@ -1,23 +0,0 @@
-// Test various uses of structs with distinct variances to make sure
-// they permit lifetimes to be approximated as expected.
-
-struct SomeStruct<T>(*mut T);
-
-fn foo<'min,'max>(v: SomeStruct<&'max ()>)
-                  -> SomeStruct<&'min ()>
-    where 'max : 'min
-{
-    v
-    //~^ ERROR lifetime may not live long enough
-}
-
-fn bar<'min,'max>(v: SomeStruct<&'min ()>)
-                  -> SomeStruct<&'max ()>
-    where 'max : 'min
-{
-    v
-    //~^ ERROR lifetime may not live long enough
-}
-
-
-fn main() { }
diff --git a/src/test/ui/variance/variance-use-invariant-struct-1.stderr b/src/test/ui/variance/variance-use-invariant-struct-1.stderr
deleted file mode 100644
index b9ca6e7d596..00000000000
--- a/src/test/ui/variance/variance-use-invariant-struct-1.stderr
+++ /dev/null
@@ -1,34 +0,0 @@
-error: lifetime may not live long enough
-  --> $DIR/variance-use-invariant-struct-1.rs:10:5
-   |
-LL | fn foo<'min,'max>(v: SomeStruct<&'max ()>)
-   |        ---- ---- lifetime `'max` defined here
-   |        |
-   |        lifetime `'min` defined here
-...
-LL |     v
-   |     ^ function was supposed to return data with lifetime `'max` but it is returning data with lifetime `'min`
-   |
-   = help: consider adding the following bound: `'min: 'max`
-   = note: requirement occurs because of the type `SomeStruct<&()>`, which makes the generic argument `&()` invariant
-   = note: the struct `SomeStruct<T>` is invariant over the parameter `T`
-   = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
-
-error: lifetime may not live long enough
-  --> $DIR/variance-use-invariant-struct-1.rs:18:5
-   |
-LL | fn bar<'min,'max>(v: SomeStruct<&'min ()>)
-   |        ---- ---- lifetime `'max` defined here
-   |        |
-   |        lifetime `'min` defined here
-...
-LL |     v
-   |     ^ function was supposed to return data with lifetime `'max` but it is returning data with lifetime `'min`
-   |
-   = help: consider adding the following bound: `'min: 'max`
-   = note: requirement occurs because of the type `SomeStruct<&()>`, which makes the generic argument `&()` invariant
-   = note: the struct `SomeStruct<T>` is invariant over the parameter `T`
-   = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
-
-error: aborting due to 2 previous errors
-