summaryrefslogtreecommitdiffstats
path: root/src/test/ui/wf
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:03 +0000
commit64d98f8ee037282c35007b64c2649055c56af1db (patch)
tree5492bcf97fce41ee1c0b1cc2add283f3e66cdab0 /src/test/ui/wf
parentAdding debian version 1.67.1+dfsg1-1. (diff)
downloadrustc-64d98f8ee037282c35007b64c2649055c56af1db.tar.xz
rustc-64d98f8ee037282c35007b64c2649055c56af1db.zip
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/wf')
-rw-r--r--src/test/ui/wf/hir-wf-check-erase-regions.rs14
-rw-r--r--src/test/ui/wf/hir-wf-check-erase-regions.stderr33
-rw-r--r--src/test/ui/wf/issue-103573.rs22
-rw-r--r--src/test/ui/wf/issue-103573.stderr14
-rw-r--r--src/test/ui/wf/issue-48638.rs21
-rw-r--r--src/test/ui/wf/issue-87495.rs8
-rw-r--r--src/test/ui/wf/issue-87495.stderr18
-rw-r--r--src/test/ui/wf/issue-95665.rs18
-rw-r--r--src/test/ui/wf/issue-95665.stderr15
-rw-r--r--src/test/ui/wf/issue-96810.rs12
-rw-r--r--src/test/ui/wf/issue-96810.stderr19
-rw-r--r--src/test/ui/wf/wf-array-elem-sized.rs11
-rw-r--r--src/test/ui/wf/wf-array-elem-sized.stderr12
-rw-r--r--src/test/ui/wf/wf-complex-assoc-type.rs12
-rw-r--r--src/test/ui/wf/wf-complex-assoc-type.stderr15
-rw-r--r--src/test/ui/wf/wf-const-type.rs14
-rw-r--r--src/test/ui/wf/wf-const-type.stderr20
-rw-r--r--src/test/ui/wf/wf-convert-unsafe-trait-obj-box.rs18
-rw-r--r--src/test/ui/wf/wf-convert-unsafe-trait-obj-box.stderr51
-rw-r--r--src/test/ui/wf/wf-convert-unsafe-trait-obj.rs18
-rw-r--r--src/test/ui/wf/wf-convert-unsafe-trait-obj.stderr51
-rw-r--r--src/test/ui/wf/wf-enum-bound.rs16
-rw-r--r--src/test/ui/wf/wf-enum-bound.stderr19
-rw-r--r--src/test/ui/wf/wf-enum-fields-struct-variant.rs18
-rw-r--r--src/test/ui/wf/wf-enum-fields-struct-variant.stderr19
-rw-r--r--src/test/ui/wf/wf-enum-fields.rs16
-rw-r--r--src/test/ui/wf/wf-enum-fields.stderr19
-rw-r--r--src/test/ui/wf/wf-fn-where-clause.rs20
-rw-r--r--src/test/ui/wf/wf-fn-where-clause.stderr49
-rw-r--r--src/test/ui/wf/wf-foreign-fn-decl-ret.rs18
-rw-r--r--src/test/ui/wf/wf-foreign-fn-decl-ret.stderr21
-rw-r--r--src/test/ui/wf/wf-impl-associated-type-region.rs14
-rw-r--r--src/test/ui/wf/wf-impl-associated-type-region.stderr14
-rw-r--r--src/test/ui/wf/wf-impl-associated-type-trait.rs22
-rw-r--r--src/test/ui/wf/wf-impl-associated-type-trait.stderr19
-rw-r--r--src/test/ui/wf/wf-impl-self-type.rs7
-rw-r--r--src/test/ui/wf/wf-impl-self-type.stderr16
-rw-r--r--src/test/ui/wf/wf-in-fn-arg.rs14
-rw-r--r--src/test/ui/wf/wf-in-fn-arg.stderr19
-rw-r--r--src/test/ui/wf/wf-in-fn-ret.rs14
-rw-r--r--src/test/ui/wf/wf-in-fn-ret.stderr19
-rw-r--r--src/test/ui/wf/wf-in-fn-type-arg.rs12
-rw-r--r--src/test/ui/wf/wf-in-fn-type-arg.stderr19
-rw-r--r--src/test/ui/wf/wf-in-fn-type-ret.rs12
-rw-r--r--src/test/ui/wf/wf-in-fn-type-ret.stderr19
-rw-r--r--src/test/ui/wf/wf-in-fn-type-static.rs22
-rw-r--r--src/test/ui/wf/wf-in-fn-type-static.stderr25
-rw-r--r--src/test/ui/wf/wf-in-fn-where-clause.rs15
-rw-r--r--src/test/ui/wf/wf-in-fn-where-clause.stderr19
-rw-r--r--src/test/ui/wf/wf-in-foreign-fn-decls-issue-80468.rs17
-rw-r--r--src/test/ui/wf/wf-in-foreign-fn-decls-issue-80468.stderr37
-rw-r--r--src/test/ui/wf/wf-in-obj-type-static.rs18
-rw-r--r--src/test/ui/wf/wf-in-obj-type-static.stderr14
-rw-r--r--src/test/ui/wf/wf-in-obj-type-trait.rs14
-rw-r--r--src/test/ui/wf/wf-in-obj-type-trait.stderr19
-rw-r--r--src/test/ui/wf/wf-inherent-impl-method-where-clause.rs17
-rw-r--r--src/test/ui/wf/wf-inherent-impl-method-where-clause.stderr19
-rw-r--r--src/test/ui/wf/wf-inherent-impl-where-clause.rs16
-rw-r--r--src/test/ui/wf/wf-inherent-impl-where-clause.stderr19
-rw-r--r--src/test/ui/wf/wf-misc-methods-issue-28609.rs74
-rw-r--r--src/test/ui/wf/wf-misc-methods-issue-28609.stderr55
-rw-r--r--src/test/ui/wf/wf-object-safe.rs10
-rw-r--r--src/test/ui/wf/wf-object-safe.stderr18
-rw-r--r--src/test/ui/wf/wf-outlives-ty-in-fn-or-trait.rs22
-rw-r--r--src/test/ui/wf/wf-outlives-ty-in-fn-or-trait.stderr25
-rw-r--r--src/test/ui/wf/wf-packed-on-proj-of-type-as-unimpl-trait.rs31
-rw-r--r--src/test/ui/wf/wf-packed-on-proj-of-type-as-unimpl-trait.stderr9
-rw-r--r--src/test/ui/wf/wf-static-method.rs59
-rw-r--r--src/test/ui/wf/wf-static-method.stderr77
-rw-r--r--src/test/ui/wf/wf-static-type.rs14
-rw-r--r--src/test/ui/wf/wf-static-type.stderr20
-rw-r--r--src/test/ui/wf/wf-struct-bound.rs16
-rw-r--r--src/test/ui/wf/wf-struct-bound.stderr19
-rw-r--r--src/test/ui/wf/wf-struct-field.rs16
-rw-r--r--src/test/ui/wf/wf-struct-field.stderr19
-rw-r--r--src/test/ui/wf/wf-trait-associated-type-bound.rs14
-rw-r--r--src/test/ui/wf/wf-trait-associated-type-bound.stderr19
-rw-r--r--src/test/ui/wf/wf-trait-associated-type-region.rs14
-rw-r--r--src/test/ui/wf/wf-trait-associated-type-region.stderr12
-rw-r--r--src/test/ui/wf/wf-trait-associated-type-trait.rs16
-rw-r--r--src/test/ui/wf/wf-trait-associated-type-trait.stderr19
-rw-r--r--src/test/ui/wf/wf-trait-bound.rs15
-rw-r--r--src/test/ui/wf/wf-trait-bound.stderr19
-rw-r--r--src/test/ui/wf/wf-trait-default-fn-arg.rs19
-rw-r--r--src/test/ui/wf/wf-trait-default-fn-arg.stderr19
-rw-r--r--src/test/ui/wf/wf-trait-default-fn-ret.rs19
-rw-r--r--src/test/ui/wf/wf-trait-default-fn-ret.stderr19
-rw-r--r--src/test/ui/wf/wf-trait-default-fn-where-clause.rs19
-rw-r--r--src/test/ui/wf/wf-trait-default-fn-where-clause.stderr19
-rw-r--r--src/test/ui/wf/wf-trait-fn-arg.rs16
-rw-r--r--src/test/ui/wf/wf-trait-fn-arg.stderr19
-rw-r--r--src/test/ui/wf/wf-trait-fn-ret.rs16
-rw-r--r--src/test/ui/wf/wf-trait-fn-ret.stderr19
-rw-r--r--src/test/ui/wf/wf-trait-fn-where-clause.rs17
-rw-r--r--src/test/ui/wf/wf-trait-fn-where-clause.stderr19
-rw-r--r--src/test/ui/wf/wf-trait-superbound.rs12
-rw-r--r--src/test/ui/wf/wf-trait-superbound.stderr19
-rw-r--r--src/test/ui/wf/wf-unsafe-trait-obj-match.rs29
-rw-r--r--src/test/ui/wf/wf-unsafe-trait-obj-match.stderr54
99 files changed, 0 insertions, 2068 deletions
diff --git a/src/test/ui/wf/hir-wf-check-erase-regions.rs b/src/test/ui/wf/hir-wf-check-erase-regions.rs
deleted file mode 100644
index 2b4b480df..000000000
--- a/src/test/ui/wf/hir-wf-check-erase-regions.rs
+++ /dev/null
@@ -1,14 +0,0 @@
-// Regression test for #87549.
-// incremental
-
-pub struct Table<T, const N: usize>([Option<T>; N]);
-
-impl<'a, T, const N: usize> IntoIterator for &'a Table<T, N> {
- type IntoIter = std::iter::Flatten<std::slice::Iter<'a, T>>; //~ ERROR `&T` is not an iterator
- type Item = &'a T;
-
- fn into_iter(self) -> Self::IntoIter { //~ ERROR `&T` is not an iterator
- unimplemented!()
- }
-}
-fn main() {}
diff --git a/src/test/ui/wf/hir-wf-check-erase-regions.stderr b/src/test/ui/wf/hir-wf-check-erase-regions.stderr
deleted file mode 100644
index b04588c57..000000000
--- a/src/test/ui/wf/hir-wf-check-erase-regions.stderr
+++ /dev/null
@@ -1,33 +0,0 @@
-error[E0277]: `&T` is not an iterator
- --> $DIR/hir-wf-check-erase-regions.rs:7:21
- |
-LL | type IntoIter = std::iter::Flatten<std::slice::Iter<'a, T>>;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `&T` is not an iterator
- |
- = help: the trait `Iterator` is not implemented for `&T`
- = help: the trait `Iterator` is implemented for `&mut I`
- = note: required for `&T` to implement `IntoIterator`
-note: required by a bound in `Flatten`
- --> $SRC_DIR/core/src/iter/adapters/flatten.rs:LL:COL
- |
-LL | pub struct Flatten<I: Iterator<Item: IntoIterator>> {
- | ^^^^^^^^^^^^ required by this bound in `Flatten`
-
-error[E0277]: `&T` is not an iterator
- --> $DIR/hir-wf-check-erase-regions.rs:10:27
- |
-LL | fn into_iter(self) -> Self::IntoIter {
- | ^^^^^^^^^^^^^^ `&T` is not an iterator
- |
- = help: the trait `Iterator` is not implemented for `&T`
- = help: the trait `Iterator` is implemented for `&mut I`
- = note: required for `&T` to implement `IntoIterator`
-note: required by a bound in `Flatten`
- --> $SRC_DIR/core/src/iter/adapters/flatten.rs:LL:COL
- |
-LL | pub struct Flatten<I: Iterator<Item: IntoIterator>> {
- | ^^^^^^^^^^^^ required by this bound in `Flatten`
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/wf/issue-103573.rs b/src/test/ui/wf/issue-103573.rs
deleted file mode 100644
index bcbf4f941..000000000
--- a/src/test/ui/wf/issue-103573.rs
+++ /dev/null
@@ -1,22 +0,0 @@
-trait TraitA {
- type TypeA;
-}
-
-trait TraitD {
- type TypeD;
-}
-
-pub trait TraitB {
- type TypeB: TraitD;
-
- fn f(_: &<Self::TypeB as TraitD>::TypeD);
-}
-
-pub trait TraitC<E> {
- type TypeC<'a>: TraitB;
-
- fn g<'a>(_: &<<Self::TypeC<'a> as TraitB>::TypeB as TraitA>::TypeA);
- //~^ ERROR the trait bound `<<Self as TraitC<E>>::TypeC<'a> as TraitB>::TypeB: TraitA` is not satisfied
-}
-
-fn main() {}
diff --git a/src/test/ui/wf/issue-103573.stderr b/src/test/ui/wf/issue-103573.stderr
deleted file mode 100644
index fcf3f15e4..000000000
--- a/src/test/ui/wf/issue-103573.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error[E0277]: the trait bound `<<Self as TraitC<E>>::TypeC<'a> as TraitB>::TypeB: TraitA` is not satisfied
- --> $DIR/issue-103573.rs:18:5
- |
-LL | fn g<'a>(_: &<<Self::TypeC<'a> as TraitB>::TypeB as TraitA>::TypeA);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `TraitA` is not implemented for `<<Self as TraitC<E>>::TypeC<'a> as TraitB>::TypeB`
- |
-help: consider further restricting the associated type
- |
-LL | fn g<'a>(_: &<<Self::TypeC<'a> as TraitB>::TypeB as TraitA>::TypeA) where <<Self as TraitC<E>>::TypeC<'a> as TraitB>::TypeB: TraitA;
- | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/wf/issue-48638.rs b/src/test/ui/wf/issue-48638.rs
deleted file mode 100644
index f07843103..000000000
--- a/src/test/ui/wf/issue-48638.rs
+++ /dev/null
@@ -1,21 +0,0 @@
-// check-pass
-
-pub trait D {}
-pub struct DT;
-impl D for DT {}
-
-pub trait A<R: D>: Sized {
- type AS;
-}
-
-pub struct As<R: D>(R);
-
-pub struct AT;
-impl<R: D> A<R> for AT {
- type AS = As<R>;
-}
-
-#[repr(packed)]
-struct S(<AT as A<DT>>::AS);
-
-fn main() {}
diff --git a/src/test/ui/wf/issue-87495.rs b/src/test/ui/wf/issue-87495.rs
deleted file mode 100644
index 5aab74311..000000000
--- a/src/test/ui/wf/issue-87495.rs
+++ /dev/null
@@ -1,8 +0,0 @@
-// Regression test for the ICE described in #87495.
-
-trait T {
- const CONST: (bool, dyn T);
- //~^ ERROR: the trait `T` cannot be made into an object [E0038]
-}
-
-fn main() {}
diff --git a/src/test/ui/wf/issue-87495.stderr b/src/test/ui/wf/issue-87495.stderr
deleted file mode 100644
index c924cd879..000000000
--- a/src/test/ui/wf/issue-87495.stderr
+++ /dev/null
@@ -1,18 +0,0 @@
-error[E0038]: the trait `T` cannot be made into an object
- --> $DIR/issue-87495.rs:4:25
- |
-LL | const CONST: (bool, dyn T);
- | ^^^^^ `T` cannot be made into an object
- |
-note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
- --> $DIR/issue-87495.rs:4:11
- |
-LL | trait T {
- | - this trait cannot be made into an object...
-LL | const CONST: (bool, dyn T);
- | ^^^^^ ...because it contains this associated `const`
- = help: consider moving `CONST` to another trait
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0038`.
diff --git a/src/test/ui/wf/issue-95665.rs b/src/test/ui/wf/issue-95665.rs
deleted file mode 100644
index 67923cbb2..000000000
--- a/src/test/ui/wf/issue-95665.rs
+++ /dev/null
@@ -1,18 +0,0 @@
-// Regression test for the ICE described in #95665.
-// Ensure that the expected error is output (and thus that there is no ICE)
-
-pub trait Trait: {}
-
-pub struct Struct<T: Trait> {
- member: T,
-}
-
-// uncomment and bug goes away
-// impl Trait for u8 {}
-
-extern "C" {
- static VAR: Struct<u8>;
- //~^ 14:17: 14:27: the trait bound `u8: Trait` is not satisfied [E0277]
-}
-
-fn main() {}
diff --git a/src/test/ui/wf/issue-95665.stderr b/src/test/ui/wf/issue-95665.stderr
deleted file mode 100644
index b1cda59a9..000000000
--- a/src/test/ui/wf/issue-95665.stderr
+++ /dev/null
@@ -1,15 +0,0 @@
-error[E0277]: the trait bound `u8: Trait` is not satisfied
- --> $DIR/issue-95665.rs:14:17
- |
-LL | static VAR: Struct<u8>;
- | ^^^^^^^^^^ the trait `Trait` is not implemented for `u8`
- |
-note: required by a bound in `Struct`
- --> $DIR/issue-95665.rs:6:22
- |
-LL | pub struct Struct<T: Trait> {
- | ^^^^^ required by this bound in `Struct`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/wf/issue-96810.rs b/src/test/ui/wf/issue-96810.rs
deleted file mode 100644
index c2948086b..000000000
--- a/src/test/ui/wf/issue-96810.rs
+++ /dev/null
@@ -1,12 +0,0 @@
-struct S<T: Tr>(T::Assoc);
-
-trait Tr {
- type Assoc;
-}
-
-struct Hoge<K> {
- s: S<K>, //~ ERROR the trait bound `K: Tr` is not satisfied
- a: u32,
-}
-
-fn main() {}
diff --git a/src/test/ui/wf/issue-96810.stderr b/src/test/ui/wf/issue-96810.stderr
deleted file mode 100644
index 1407e62b1..000000000
--- a/src/test/ui/wf/issue-96810.stderr
+++ /dev/null
@@ -1,19 +0,0 @@
-error[E0277]: the trait bound `K: Tr` is not satisfied
- --> $DIR/issue-96810.rs:8:8
- |
-LL | s: S<K>,
- | ^^^^ the trait `Tr` is not implemented for `K`
- |
-note: required by a bound in `S`
- --> $DIR/issue-96810.rs:1:13
- |
-LL | struct S<T: Tr>(T::Assoc);
- | ^^ required by this bound in `S`
-help: consider restricting type parameter `K`
- |
-LL | struct Hoge<K: Tr> {
- | ++++
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/wf/wf-array-elem-sized.rs b/src/test/ui/wf/wf-array-elem-sized.rs
deleted file mode 100644
index 34bf22034..000000000
--- a/src/test/ui/wf/wf-array-elem-sized.rs
+++ /dev/null
@@ -1,11 +0,0 @@
-// Check that array element types must be Sized. Issue #25692.
-
-
-#![allow(dead_code)]
-
-struct Foo {
- foo: [[u8]], //~ ERROR E0277
-}
-
-
-fn main() { }
diff --git a/src/test/ui/wf/wf-array-elem-sized.stderr b/src/test/ui/wf/wf-array-elem-sized.stderr
deleted file mode 100644
index 7f3c58d6b..000000000
--- a/src/test/ui/wf/wf-array-elem-sized.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
- --> $DIR/wf-array-elem-sized.rs:7:10
- |
-LL | foo: [[u8]],
- | ^^^^^^ doesn't have a size known at compile-time
- |
- = help: the trait `Sized` is not implemented for `[u8]`
- = note: slice and array elements must have `Sized` type
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/wf/wf-complex-assoc-type.rs b/src/test/ui/wf/wf-complex-assoc-type.rs
deleted file mode 100644
index c3811e823..000000000
--- a/src/test/ui/wf/wf-complex-assoc-type.rs
+++ /dev/null
@@ -1,12 +0,0 @@
-trait MyTrait {}
-struct AssertMyTrait<T: MyTrait>(T);
-
-trait HelperTrait {
- type MyItem;
-}
-
-impl HelperTrait for () {
- type MyItem = Option<((AssertMyTrait<bool>, u8))>; //~ ERROR the trait bound
-}
-
-fn main() {}
diff --git a/src/test/ui/wf/wf-complex-assoc-type.stderr b/src/test/ui/wf/wf-complex-assoc-type.stderr
deleted file mode 100644
index ef613e313..000000000
--- a/src/test/ui/wf/wf-complex-assoc-type.stderr
+++ /dev/null
@@ -1,15 +0,0 @@
-error[E0277]: the trait bound `bool: MyTrait` is not satisfied
- --> $DIR/wf-complex-assoc-type.rs:9:28
- |
-LL | type MyItem = Option<((AssertMyTrait<bool>, u8))>;
- | ^^^^^^^^^^^^^^^^^^^ the trait `MyTrait` is not implemented for `bool`
- |
-note: required by a bound in `AssertMyTrait`
- --> $DIR/wf-complex-assoc-type.rs:2:25
- |
-LL | struct AssertMyTrait<T: MyTrait>(T);
- | ^^^^^^^ required by this bound in `AssertMyTrait`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/wf/wf-const-type.rs b/src/test/ui/wf/wf-const-type.rs
deleted file mode 100644
index df79aa267..000000000
--- a/src/test/ui/wf/wf-const-type.rs
+++ /dev/null
@@ -1,14 +0,0 @@
-// Test that we check the types of constants are well-formed.
-
-#![feature(associated_type_defaults)]
-
-#![allow(dead_code)]
-
-struct IsCopy<T:Copy> { t: T }
-struct NotCopy;
-
-const FOO: IsCopy<Option<NotCopy>> = IsCopy { t: None };
-//~^ ERROR E0277
-
-
-fn main() { }
diff --git a/src/test/ui/wf/wf-const-type.stderr b/src/test/ui/wf/wf-const-type.stderr
deleted file mode 100644
index 85938364e..000000000
--- a/src/test/ui/wf/wf-const-type.stderr
+++ /dev/null
@@ -1,20 +0,0 @@
-error[E0277]: the trait bound `NotCopy: Copy` is not satisfied
- --> $DIR/wf-const-type.rs:10:12
- |
-LL | const FOO: IsCopy<Option<NotCopy>> = IsCopy { t: None };
- | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `NotCopy`
- |
- = note: required for `Option<NotCopy>` to implement `Copy`
-note: required by a bound in `IsCopy`
- --> $DIR/wf-const-type.rs:7:17
- |
-LL | struct IsCopy<T:Copy> { t: T }
- | ^^^^ required by this bound in `IsCopy`
-help: consider annotating `NotCopy` with `#[derive(Copy)]`
- |
-LL | #[derive(Copy)]
- |
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/wf/wf-convert-unsafe-trait-obj-box.rs b/src/test/ui/wf/wf-convert-unsafe-trait-obj-box.rs
deleted file mode 100644
index ffdb49a3b..000000000
--- a/src/test/ui/wf/wf-convert-unsafe-trait-obj-box.rs
+++ /dev/null
@@ -1,18 +0,0 @@
-// Check that we do not allow casts or coercions
-// to object unsafe trait objects inside a Box
-
-#![feature(object_safe_for_dispatch)]
-
-trait Trait: Sized {}
-
-struct S;
-
-impl Trait for S {}
-
-fn takes_box(t: Box<dyn Trait>) {}
-
-fn main() {
- Box::new(S) as Box<dyn Trait>; //~ ERROR E0038
- let t_box: Box<dyn Trait> = Box::new(S); //~ ERROR E0038
- takes_box(Box::new(S)); //~ ERROR E0038
-}
diff --git a/src/test/ui/wf/wf-convert-unsafe-trait-obj-box.stderr b/src/test/ui/wf/wf-convert-unsafe-trait-obj-box.stderr
deleted file mode 100644
index 6cf4f33f9..000000000
--- a/src/test/ui/wf/wf-convert-unsafe-trait-obj-box.stderr
+++ /dev/null
@@ -1,51 +0,0 @@
-error[E0038]: the trait `Trait` cannot be made into an object
- --> $DIR/wf-convert-unsafe-trait-obj-box.rs:16:33
- |
-LL | let t_box: Box<dyn Trait> = Box::new(S);
- | ^^^^^^^^^^^ `Trait` cannot be made into an object
- |
-note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
- --> $DIR/wf-convert-unsafe-trait-obj-box.rs:6:14
- |
-LL | trait Trait: Sized {}
- | ----- ^^^^^ ...because it requires `Self: Sized`
- | |
- | this trait cannot be made into an object...
- = note: required for `Box<S>` to implement `CoerceUnsized<Box<dyn Trait>>`
- = note: required by cast to type `Box<dyn Trait>`
-
-error[E0038]: the trait `Trait` cannot be made into an object
- --> $DIR/wf-convert-unsafe-trait-obj-box.rs:17:15
- |
-LL | takes_box(Box::new(S));
- | ^^^^^^^^^^^ `Trait` cannot be made into an object
- |
-note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
- --> $DIR/wf-convert-unsafe-trait-obj-box.rs:6:14
- |
-LL | trait Trait: Sized {}
- | ----- ^^^^^ ...because it requires `Self: Sized`
- | |
- | this trait cannot be made into an object...
- = note: required for `Box<S>` to implement `CoerceUnsized<Box<dyn Trait>>`
- = note: required by cast to type `Box<(dyn Trait + 'static)>`
-
-error[E0038]: the trait `Trait` cannot be made into an object
- --> $DIR/wf-convert-unsafe-trait-obj-box.rs:15:5
- |
-LL | Box::new(S) as Box<dyn Trait>;
- | ^^^^^^^^^^^ `Trait` cannot be made into an object
- |
-note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
- --> $DIR/wf-convert-unsafe-trait-obj-box.rs:6:14
- |
-LL | trait Trait: Sized {}
- | ----- ^^^^^ ...because it requires `Self: Sized`
- | |
- | this trait cannot be made into an object...
- = note: required for `Box<S>` to implement `CoerceUnsized<Box<dyn Trait>>`
- = note: required by cast to type `Box<dyn Trait>`
-
-error: aborting due to 3 previous errors
-
-For more information about this error, try `rustc --explain E0038`.
diff --git a/src/test/ui/wf/wf-convert-unsafe-trait-obj.rs b/src/test/ui/wf/wf-convert-unsafe-trait-obj.rs
deleted file mode 100644
index 143b854ed..000000000
--- a/src/test/ui/wf/wf-convert-unsafe-trait-obj.rs
+++ /dev/null
@@ -1,18 +0,0 @@
-// Check that we do not allow casts or coercions
-// to object unsafe trait objects by ref
-
-#![feature(object_safe_for_dispatch)]
-
-trait Trait: Sized {}
-
-struct S;
-
-impl Trait for S {}
-
-fn takes_trait(t: &dyn Trait) {}
-
-fn main() {
- &S as &dyn Trait; //~ ERROR E0038
- let t: &dyn Trait = &S; //~ ERROR E0038
- takes_trait(&S); //~ ERROR E0038
-}
diff --git a/src/test/ui/wf/wf-convert-unsafe-trait-obj.stderr b/src/test/ui/wf/wf-convert-unsafe-trait-obj.stderr
deleted file mode 100644
index c9bd4549a..000000000
--- a/src/test/ui/wf/wf-convert-unsafe-trait-obj.stderr
+++ /dev/null
@@ -1,51 +0,0 @@
-error[E0038]: the trait `Trait` cannot be made into an object
- --> $DIR/wf-convert-unsafe-trait-obj.rs:16:25
- |
-LL | let t: &dyn Trait = &S;
- | ^^ `Trait` cannot be made into an object
- |
-note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
- --> $DIR/wf-convert-unsafe-trait-obj.rs:6:14
- |
-LL | trait Trait: Sized {}
- | ----- ^^^^^ ...because it requires `Self: Sized`
- | |
- | this trait cannot be made into an object...
- = note: required for `&S` to implement `CoerceUnsized<&dyn Trait>`
- = note: required by cast to type `&dyn Trait`
-
-error[E0038]: the trait `Trait` cannot be made into an object
- --> $DIR/wf-convert-unsafe-trait-obj.rs:17:17
- |
-LL | takes_trait(&S);
- | ^^ `Trait` cannot be made into an object
- |
-note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
- --> $DIR/wf-convert-unsafe-trait-obj.rs:6:14
- |
-LL | trait Trait: Sized {}
- | ----- ^^^^^ ...because it requires `Self: Sized`
- | |
- | this trait cannot be made into an object...
- = note: required for `&S` to implement `CoerceUnsized<&dyn Trait>`
- = note: required by cast to type `&dyn Trait`
-
-error[E0038]: the trait `Trait` cannot be made into an object
- --> $DIR/wf-convert-unsafe-trait-obj.rs:15:5
- |
-LL | &S as &dyn Trait;
- | ^^ `Trait` cannot be made into an object
- |
-note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
- --> $DIR/wf-convert-unsafe-trait-obj.rs:6:14
- |
-LL | trait Trait: Sized {}
- | ----- ^^^^^ ...because it requires `Self: Sized`
- | |
- | this trait cannot be made into an object...
- = note: required for `&S` to implement `CoerceUnsized<&dyn Trait>`
- = note: required by cast to type `&dyn Trait`
-
-error: aborting due to 3 previous errors
-
-For more information about this error, try `rustc --explain E0038`.
diff --git a/src/test/ui/wf/wf-enum-bound.rs b/src/test/ui/wf/wf-enum-bound.rs
deleted file mode 100644
index 042a2cb09..000000000
--- a/src/test/ui/wf/wf-enum-bound.rs
+++ /dev/null
@@ -1,16 +0,0 @@
-// Test that we check enum bounds for WFedness.
-
-#![feature(associated_type_defaults)]
-
-#![allow(dead_code)]
-
-trait ExtraCopy<T:Copy> { }
-
-enum SomeEnum<T,U>
- where T: ExtraCopy<U> //~ ERROR E0277
-{
- SomeVariant(T,U)
-}
-
-
-fn main() { }
diff --git a/src/test/ui/wf/wf-enum-bound.stderr b/src/test/ui/wf/wf-enum-bound.stderr
deleted file mode 100644
index d39fc0c6a..000000000
--- a/src/test/ui/wf/wf-enum-bound.stderr
+++ /dev/null
@@ -1,19 +0,0 @@
-error[E0277]: the trait bound `U: Copy` is not satisfied
- --> $DIR/wf-enum-bound.rs:10:14
- |
-LL | where T: ExtraCopy<U>
- | ^^^^^^^^^^^^ the trait `Copy` is not implemented for `U`
- |
-note: required by a bound in `ExtraCopy`
- --> $DIR/wf-enum-bound.rs:7:19
- |
-LL | trait ExtraCopy<T:Copy> { }
- | ^^^^ required by this bound in `ExtraCopy`
-help: consider further restricting type parameter `U`
- |
-LL | where T: ExtraCopy<U>, U: std::marker::Copy
- | ++++++++++++++++++++++
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/wf/wf-enum-fields-struct-variant.rs b/src/test/ui/wf/wf-enum-fields-struct-variant.rs
deleted file mode 100644
index c25622fa7..000000000
--- a/src/test/ui/wf/wf-enum-fields-struct-variant.rs
+++ /dev/null
@@ -1,18 +0,0 @@
-// Test that we check struct fields for WFedness.
-
-#![feature(associated_type_defaults)]
-
-#![allow(dead_code)]
-
-struct IsCopy<T:Copy> {
- value: T
-}
-
-enum AnotherEnum<A> {
- AnotherVariant {
- f: IsCopy<A> //~ ERROR E0277
- }
-}
-
-
-fn main() { }
diff --git a/src/test/ui/wf/wf-enum-fields-struct-variant.stderr b/src/test/ui/wf/wf-enum-fields-struct-variant.stderr
deleted file mode 100644
index c12d62521..000000000
--- a/src/test/ui/wf/wf-enum-fields-struct-variant.stderr
+++ /dev/null
@@ -1,19 +0,0 @@
-error[E0277]: the trait bound `A: Copy` is not satisfied
- --> $DIR/wf-enum-fields-struct-variant.rs:13:12
- |
-LL | f: IsCopy<A>
- | ^^^^^^^^^ the trait `Copy` is not implemented for `A`
- |
-note: required by a bound in `IsCopy`
- --> $DIR/wf-enum-fields-struct-variant.rs:7:17
- |
-LL | struct IsCopy<T:Copy> {
- | ^^^^ required by this bound in `IsCopy`
-help: consider restricting type parameter `A`
- |
-LL | enum AnotherEnum<A: std::marker::Copy> {
- | +++++++++++++++++++
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/wf/wf-enum-fields.rs b/src/test/ui/wf/wf-enum-fields.rs
deleted file mode 100644
index a465ffe5e..000000000
--- a/src/test/ui/wf/wf-enum-fields.rs
+++ /dev/null
@@ -1,16 +0,0 @@
-// Test that we check struct fields for WFedness.
-
-#![feature(associated_type_defaults)]
-
-#![allow(dead_code)]
-
-struct IsCopy<T:Copy> {
- value: T
-}
-
-enum SomeEnum<A> {
- SomeVariant(IsCopy<A>) //~ ERROR E0277
-}
-
-
-fn main() { }
diff --git a/src/test/ui/wf/wf-enum-fields.stderr b/src/test/ui/wf/wf-enum-fields.stderr
deleted file mode 100644
index ac3301a96..000000000
--- a/src/test/ui/wf/wf-enum-fields.stderr
+++ /dev/null
@@ -1,19 +0,0 @@
-error[E0277]: the trait bound `A: Copy` is not satisfied
- --> $DIR/wf-enum-fields.rs:12:17
- |
-LL | SomeVariant(IsCopy<A>)
- | ^^^^^^^^^ the trait `Copy` is not implemented for `A`
- |
-note: required by a bound in `IsCopy`
- --> $DIR/wf-enum-fields.rs:7:17
- |
-LL | struct IsCopy<T:Copy> {
- | ^^^^ required by this bound in `IsCopy`
-help: consider restricting type parameter `A`
- |
-LL | enum SomeEnum<A: std::marker::Copy> {
- | +++++++++++++++++++
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/wf/wf-fn-where-clause.rs b/src/test/ui/wf/wf-fn-where-clause.rs
deleted file mode 100644
index adae53613..000000000
--- a/src/test/ui/wf/wf-fn-where-clause.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-// Test that we check where-clauses on fn items.
-
-
-#![allow(dead_code)]
-
-trait ExtraCopy<T:Copy> { }
-
-fn foo<T,U>() where T: ExtraCopy<U> //~ ERROR E0277
-{
-}
-
-fn bar() where Vec<dyn Copy>:, {}
-//~^ ERROR E0277
-//~| ERROR E0038
-
-struct Vec<T> {
- t: T,
-}
-
-fn main() { }
diff --git a/src/test/ui/wf/wf-fn-where-clause.stderr b/src/test/ui/wf/wf-fn-where-clause.stderr
deleted file mode 100644
index 2aec641e7..000000000
--- a/src/test/ui/wf/wf-fn-where-clause.stderr
+++ /dev/null
@@ -1,49 +0,0 @@
-error[E0277]: the trait bound `U: Copy` is not satisfied
- --> $DIR/wf-fn-where-clause.rs:8:24
- |
-LL | fn foo<T,U>() where T: ExtraCopy<U>
- | ^^^^^^^^^^^^ the trait `Copy` is not implemented for `U`
- |
-note: required by a bound in `ExtraCopy`
- --> $DIR/wf-fn-where-clause.rs:6:19
- |
-LL | trait ExtraCopy<T:Copy> { }
- | ^^^^ required by this bound in `ExtraCopy`
-help: consider further restricting type parameter `U`
- |
-LL | fn foo<T,U>() where T: ExtraCopy<U>, U: std::marker::Copy
- | ++++++++++++++++++++++
-
-error[E0277]: the size for values of type `(dyn Copy + 'static)` cannot be known at compilation time
- --> $DIR/wf-fn-where-clause.rs:12:16
- |
-LL | fn bar() where Vec<dyn Copy>:, {}
- | ^^^^^^^^^^^^^ doesn't have a size known at compile-time
- |
- = help: the trait `Sized` is not implemented for `(dyn Copy + 'static)`
-note: required by a bound in `Vec`
- --> $DIR/wf-fn-where-clause.rs:16:12
- |
-LL | struct Vec<T> {
- | ^ required by this bound in `Vec`
-help: you could relax the implicit `Sized` bound on `T` if it were used through indirection like `&T` or `Box<T>`
- --> $DIR/wf-fn-where-clause.rs:16:12
- |
-LL | struct Vec<T> {
- | ^ this could be changed to `T: ?Sized`...
-LL | t: T,
- | - ...if indirection were used here: `Box<T>`
-
-error[E0038]: the trait `Copy` cannot be made into an object
- --> $DIR/wf-fn-where-clause.rs:12:16
- |
-LL | fn bar() where Vec<dyn Copy>:, {}
- | ^^^^^^^^^^^^^ `Copy` cannot be made into an object
- |
- = note: the trait cannot be made into an object because it requires `Self: Sized`
- = note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
-
-error: aborting due to 3 previous errors
-
-Some errors have detailed explanations: E0038, E0277.
-For more information about an error, try `rustc --explain E0038`.
diff --git a/src/test/ui/wf/wf-foreign-fn-decl-ret.rs b/src/test/ui/wf/wf-foreign-fn-decl-ret.rs
deleted file mode 100644
index b9d956c05..000000000
--- a/src/test/ui/wf/wf-foreign-fn-decl-ret.rs
+++ /dev/null
@@ -1,18 +0,0 @@
-pub trait Unsatisfied {}
-
-#[repr(transparent)]
-pub struct Bar<T: Unsatisfied>(T);
-
-pub trait Foo {
- type Assoc;
-}
-
-extern "C" {
- pub fn lint_me() -> <() as Foo>::Assoc;
- //~^ ERROR: the trait bound `(): Foo` is not satisfied [E0277]
-
- pub fn lint_me_aswell() -> Bar<u32>;
- //~^ ERROR: the trait bound `u32: Unsatisfied` is not satisfied [E0277]
-}
-
-fn main() {}
diff --git a/src/test/ui/wf/wf-foreign-fn-decl-ret.stderr b/src/test/ui/wf/wf-foreign-fn-decl-ret.stderr
deleted file mode 100644
index 78312a091..000000000
--- a/src/test/ui/wf/wf-foreign-fn-decl-ret.stderr
+++ /dev/null
@@ -1,21 +0,0 @@
-error[E0277]: the trait bound `(): Foo` is not satisfied
- --> $DIR/wf-foreign-fn-decl-ret.rs:11:5
- |
-LL | pub fn lint_me() -> <() as Foo>::Assoc;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `()`
-
-error[E0277]: the trait bound `u32: Unsatisfied` is not satisfied
- --> $DIR/wf-foreign-fn-decl-ret.rs:14:32
- |
-LL | pub fn lint_me_aswell() -> Bar<u32>;
- | ^^^^^^^^ the trait `Unsatisfied` is not implemented for `u32`
- |
-note: required by a bound in `Bar`
- --> $DIR/wf-foreign-fn-decl-ret.rs:4:19
- |
-LL | pub struct Bar<T: Unsatisfied>(T);
- | ^^^^^^^^^^^ required by this bound in `Bar`
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/wf/wf-impl-associated-type-region.rs b/src/test/ui/wf/wf-impl-associated-type-region.rs
deleted file mode 100644
index 1bf8d3663..000000000
--- a/src/test/ui/wf/wf-impl-associated-type-region.rs
+++ /dev/null
@@ -1,14 +0,0 @@
-// Check that we require that associated types in an impl are well-formed.
-
-
-
-pub trait Foo<'a> {
- type Bar;
-}
-
-impl<'a, T> Foo<'a> for T {
- type Bar = &'a T; //~ ERROR E0309
-}
-
-
-fn main() { }
diff --git a/src/test/ui/wf/wf-impl-associated-type-region.stderr b/src/test/ui/wf/wf-impl-associated-type-region.stderr
deleted file mode 100644
index b9d4857a3..000000000
--- a/src/test/ui/wf/wf-impl-associated-type-region.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error[E0309]: the parameter type `T` may not live long enough
- --> $DIR/wf-impl-associated-type-region.rs:10:16
- |
-LL | type Bar = &'a T;
- | ^^^^^ ...so that the reference type `&'a T` does not outlive the data it points at
- |
-help: consider adding an explicit lifetime bound...
- |
-LL | impl<'a, T: 'a> Foo<'a> for T {
- | ++++
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0309`.
diff --git a/src/test/ui/wf/wf-impl-associated-type-trait.rs b/src/test/ui/wf/wf-impl-associated-type-trait.rs
deleted file mode 100644
index 84e628e21..000000000
--- a/src/test/ui/wf/wf-impl-associated-type-trait.rs
+++ /dev/null
@@ -1,22 +0,0 @@
-// Check that we require that associated types in an impl are well-formed.
-
-
-#![allow(dead_code)]
-
-pub trait MyHash { }
-
-pub struct MySet<T:MyHash> {
- data: Vec<T>
-}
-
-pub trait Foo {
- type Bar;
-}
-
-impl<T> Foo for T {
- type Bar = MySet<T>;
- //~^ ERROR the trait bound `T: MyHash` is not satisfied
-}
-
-
-fn main() { }
diff --git a/src/test/ui/wf/wf-impl-associated-type-trait.stderr b/src/test/ui/wf/wf-impl-associated-type-trait.stderr
deleted file mode 100644
index bdf8bba5e..000000000
--- a/src/test/ui/wf/wf-impl-associated-type-trait.stderr
+++ /dev/null
@@ -1,19 +0,0 @@
-error[E0277]: the trait bound `T: MyHash` is not satisfied
- --> $DIR/wf-impl-associated-type-trait.rs:17:16
- |
-LL | type Bar = MySet<T>;
- | ^^^^^^^^ the trait `MyHash` is not implemented for `T`
- |
-note: required by a bound in `MySet`
- --> $DIR/wf-impl-associated-type-trait.rs:8:20
- |
-LL | pub struct MySet<T:MyHash> {
- | ^^^^^^ required by this bound in `MySet`
-help: consider restricting type parameter `T`
- |
-LL | impl<T: MyHash> Foo for T {
- | ++++++++
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/wf/wf-impl-self-type.rs b/src/test/ui/wf/wf-impl-self-type.rs
deleted file mode 100644
index 2dd9b4ef0..000000000
--- a/src/test/ui/wf/wf-impl-self-type.rs
+++ /dev/null
@@ -1,7 +0,0 @@
-// Tests that we point at the proper location for an error
-// involving the self-type of an impl
-
-trait Foo {}
-impl Foo for Option<[u8]> {} //~ ERROR the size for
-
-fn main() {}
diff --git a/src/test/ui/wf/wf-impl-self-type.stderr b/src/test/ui/wf/wf-impl-self-type.stderr
deleted file mode 100644
index 371321793..000000000
--- a/src/test/ui/wf/wf-impl-self-type.stderr
+++ /dev/null
@@ -1,16 +0,0 @@
-error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
- --> $DIR/wf-impl-self-type.rs:5:14
- |
-LL | impl Foo for Option<[u8]> {}
- | ^^^^^^^^^^^^ doesn't have a size known at compile-time
- |
- = help: the trait `Sized` is not implemented for `[u8]`
-note: required by a bound in `Option`
- --> $SRC_DIR/core/src/option.rs:LL:COL
- |
-LL | pub enum Option<T> {
- | ^ required by this bound in `Option`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/wf/wf-in-fn-arg.rs b/src/test/ui/wf/wf-in-fn-arg.rs
deleted file mode 100644
index 18df72336..000000000
--- a/src/test/ui/wf/wf-in-fn-arg.rs
+++ /dev/null
@@ -1,14 +0,0 @@
-// Check that we enforce WF conditions also for argument types in fn items.
-
-#![feature(rustc_attrs)]
-#![allow(dead_code)]
-
-struct MustBeCopy<T:Copy> {
- t: T
-}
-
-fn bar<T>(_: &MustBeCopy<T>) //~ ERROR E0277
-{
-}
-
-fn main() { }
diff --git a/src/test/ui/wf/wf-in-fn-arg.stderr b/src/test/ui/wf/wf-in-fn-arg.stderr
deleted file mode 100644
index 83a4a592a..000000000
--- a/src/test/ui/wf/wf-in-fn-arg.stderr
+++ /dev/null
@@ -1,19 +0,0 @@
-error[E0277]: the trait bound `T: Copy` is not satisfied
- --> $DIR/wf-in-fn-arg.rs:10:15
- |
-LL | fn bar<T>(_: &MustBeCopy<T>)
- | ^^^^^^^^^^^^^ the trait `Copy` is not implemented for `T`
- |
-note: required by a bound in `MustBeCopy`
- --> $DIR/wf-in-fn-arg.rs:6:21
- |
-LL | struct MustBeCopy<T:Copy> {
- | ^^^^ required by this bound in `MustBeCopy`
-help: consider restricting type parameter `T`
- |
-LL | fn bar<T: std::marker::Copy>(_: &MustBeCopy<T>)
- | +++++++++++++++++++
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/wf/wf-in-fn-ret.rs b/src/test/ui/wf/wf-in-fn-ret.rs
deleted file mode 100644
index 4c9535184..000000000
--- a/src/test/ui/wf/wf-in-fn-ret.rs
+++ /dev/null
@@ -1,14 +0,0 @@
-// Check that we enforce WF conditions also for return types in fn items.
-
-#![feature(rustc_attrs)]
-#![allow(dead_code)]
-
-struct MustBeCopy<T:Copy> {
- t: T
-}
-
-fn bar<T>() -> MustBeCopy<T> //~ ERROR E0277
-{
-}
-
-fn main() { }
diff --git a/src/test/ui/wf/wf-in-fn-ret.stderr b/src/test/ui/wf/wf-in-fn-ret.stderr
deleted file mode 100644
index 7eeb97472..000000000
--- a/src/test/ui/wf/wf-in-fn-ret.stderr
+++ /dev/null
@@ -1,19 +0,0 @@
-error[E0277]: the trait bound `T: Copy` is not satisfied
- --> $DIR/wf-in-fn-ret.rs:10:16
- |
-LL | fn bar<T>() -> MustBeCopy<T>
- | ^^^^^^^^^^^^^ the trait `Copy` is not implemented for `T`
- |
-note: required by a bound in `MustBeCopy`
- --> $DIR/wf-in-fn-ret.rs:6:21
- |
-LL | struct MustBeCopy<T:Copy> {
- | ^^^^ required by this bound in `MustBeCopy`
-help: consider restricting type parameter `T`
- |
-LL | fn bar<T: std::marker::Copy>() -> MustBeCopy<T>
- | +++++++++++++++++++
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/wf/wf-in-fn-type-arg.rs b/src/test/ui/wf/wf-in-fn-type-arg.rs
deleted file mode 100644
index 2917a8aa9..000000000
--- a/src/test/ui/wf/wf-in-fn-type-arg.rs
+++ /dev/null
@@ -1,12 +0,0 @@
-// Check that we enforce WF conditions also for types in fns.
-
-struct MustBeCopy<T:Copy> {
- t: T
-}
-
-struct Bar<T> {
- // needs T: Copy
- x: fn(MustBeCopy<T>) //~ ERROR E0277
-}
-
-fn main() { }
diff --git a/src/test/ui/wf/wf-in-fn-type-arg.stderr b/src/test/ui/wf/wf-in-fn-type-arg.stderr
deleted file mode 100644
index be5e9d418..000000000
--- a/src/test/ui/wf/wf-in-fn-type-arg.stderr
+++ /dev/null
@@ -1,19 +0,0 @@
-error[E0277]: the trait bound `T: Copy` is not satisfied
- --> $DIR/wf-in-fn-type-arg.rs:9:11
- |
-LL | x: fn(MustBeCopy<T>)
- | ^^^^^^^^^^^^^ the trait `Copy` is not implemented for `T`
- |
-note: required by a bound in `MustBeCopy`
- --> $DIR/wf-in-fn-type-arg.rs:3:21
- |
-LL | struct MustBeCopy<T:Copy> {
- | ^^^^ required by this bound in `MustBeCopy`
-help: consider restricting type parameter `T`
- |
-LL | struct Bar<T: std::marker::Copy> {
- | +++++++++++++++++++
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/wf/wf-in-fn-type-ret.rs b/src/test/ui/wf/wf-in-fn-type-ret.rs
deleted file mode 100644
index ab8e697e3..000000000
--- a/src/test/ui/wf/wf-in-fn-type-ret.rs
+++ /dev/null
@@ -1,12 +0,0 @@
-// Check that we enforce WF conditions also for types in fns.
-
-struct MustBeCopy<T:Copy> {
- t: T
-}
-
-struct Foo<T> {
- // needs T: 'static
- x: fn() -> MustBeCopy<T> //~ ERROR E0277
-}
-
-fn main() { }
diff --git a/src/test/ui/wf/wf-in-fn-type-ret.stderr b/src/test/ui/wf/wf-in-fn-type-ret.stderr
deleted file mode 100644
index 8fcfcb0b2..000000000
--- a/src/test/ui/wf/wf-in-fn-type-ret.stderr
+++ /dev/null
@@ -1,19 +0,0 @@
-error[E0277]: the trait bound `T: Copy` is not satisfied
- --> $DIR/wf-in-fn-type-ret.rs:9:16
- |
-LL | x: fn() -> MustBeCopy<T>
- | ^^^^^^^^^^^^^ the trait `Copy` is not implemented for `T`
- |
-note: required by a bound in `MustBeCopy`
- --> $DIR/wf-in-fn-type-ret.rs:3:21
- |
-LL | struct MustBeCopy<T:Copy> {
- | ^^^^ required by this bound in `MustBeCopy`
-help: consider restricting type parameter `T`
- |
-LL | struct Foo<T: std::marker::Copy> {
- | +++++++++++++++++++
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/wf/wf-in-fn-type-static.rs b/src/test/ui/wf/wf-in-fn-type-static.rs
deleted file mode 100644
index 73071dd23..000000000
--- a/src/test/ui/wf/wf-in-fn-type-static.rs
+++ /dev/null
@@ -1,22 +0,0 @@
-// Check that we enforce WF conditions related to regions also for
-// types in fns.
-
-#![allow(dead_code)]
-
-
-struct MustBeCopy<T:Copy> {
- t: T
-}
-
-struct Foo<T> {
- // needs T: 'static
- x: fn() -> &'static T //~ ERROR E0310
-}
-
-struct Bar<T> {
- // needs T: Copy
- x: fn(&'static T) //~ ERROR E0310
-}
-
-
-fn main() { }
diff --git a/src/test/ui/wf/wf-in-fn-type-static.stderr b/src/test/ui/wf/wf-in-fn-type-static.stderr
deleted file mode 100644
index 73fbb9ca6..000000000
--- a/src/test/ui/wf/wf-in-fn-type-static.stderr
+++ /dev/null
@@ -1,25 +0,0 @@
-error[E0310]: the parameter type `T` may not live long enough
- --> $DIR/wf-in-fn-type-static.rs:13:8
- |
-LL | x: fn() -> &'static T
- | ^^^^^^^^^^^^^^^^^^ ...so that the reference type `&'static T` does not outlive the data it points at
- |
-help: consider adding an explicit lifetime bound...
- |
-LL | struct Foo<T: 'static> {
- | +++++++++
-
-error[E0310]: the parameter type `T` may not live long enough
- --> $DIR/wf-in-fn-type-static.rs:18:8
- |
-LL | x: fn(&'static T)
- | ^^^^^^^^^^^^^^ ...so that the reference type `&'static T` does not outlive the data it points at
- |
-help: consider adding an explicit lifetime bound...
- |
-LL | struct Bar<T: 'static> {
- | +++++++++
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0310`.
diff --git a/src/test/ui/wf/wf-in-fn-where-clause.rs b/src/test/ui/wf/wf-in-fn-where-clause.rs
deleted file mode 100644
index e55295a3b..000000000
--- a/src/test/ui/wf/wf-in-fn-where-clause.rs
+++ /dev/null
@@ -1,15 +0,0 @@
-// Check that we enforce WF conditions also for where clauses in fn items.
-
-
-#![allow(dead_code)]
-
-trait MustBeCopy<T:Copy> {
-}
-
-fn bar<T,U>()
- where T: MustBeCopy<U> //~ ERROR E0277
-{
-}
-
-
-fn main() { }
diff --git a/src/test/ui/wf/wf-in-fn-where-clause.stderr b/src/test/ui/wf/wf-in-fn-where-clause.stderr
deleted file mode 100644
index 160a73840..000000000
--- a/src/test/ui/wf/wf-in-fn-where-clause.stderr
+++ /dev/null
@@ -1,19 +0,0 @@
-error[E0277]: the trait bound `U: Copy` is not satisfied
- --> $DIR/wf-in-fn-where-clause.rs:10:14
- |
-LL | where T: MustBeCopy<U>
- | ^^^^^^^^^^^^^ the trait `Copy` is not implemented for `U`
- |
-note: required by a bound in `MustBeCopy`
- --> $DIR/wf-in-fn-where-clause.rs:6:20
- |
-LL | trait MustBeCopy<T:Copy> {
- | ^^^^ required by this bound in `MustBeCopy`
-help: consider further restricting type parameter `U`
- |
-LL | where T: MustBeCopy<U>, U: std::marker::Copy
- | ++++++++++++++++++++++
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/wf/wf-in-foreign-fn-decls-issue-80468.rs b/src/test/ui/wf/wf-in-foreign-fn-decls-issue-80468.rs
deleted file mode 100644
index 4fcf8f403..000000000
--- a/src/test/ui/wf/wf-in-foreign-fn-decls-issue-80468.rs
+++ /dev/null
@@ -1,17 +0,0 @@
-// Regression test for #80468.
-
-#![crate_type = "lib"]
-
-pub trait Trait {}
-
-#[repr(transparent)]
-pub struct Wrapper<T: Trait>(T);
-
-#[repr(transparent)]
-pub struct Ref<'a>(&'a u8);
-
-impl Trait for Ref {} //~ ERROR: implicit elided lifetime not allowed here
-
-extern "C" {
- pub fn repro(_: Wrapper<Ref>); //~ ERROR: incompatible lifetime on type
-}
diff --git a/src/test/ui/wf/wf-in-foreign-fn-decls-issue-80468.stderr b/src/test/ui/wf/wf-in-foreign-fn-decls-issue-80468.stderr
deleted file mode 100644
index 94f6dc266..000000000
--- a/src/test/ui/wf/wf-in-foreign-fn-decls-issue-80468.stderr
+++ /dev/null
@@ -1,37 +0,0 @@
-error[E0726]: implicit elided lifetime not allowed here
- --> $DIR/wf-in-foreign-fn-decls-issue-80468.rs:13:16
- |
-LL | impl Trait for Ref {}
- | ^^^ expected lifetime parameter
- |
- = note: assuming a `'static` lifetime...
-help: indicate the anonymous lifetime
- |
-LL | impl Trait for Ref<'_> {}
- | ++++
-
-error: incompatible lifetime on type
- --> $DIR/wf-in-foreign-fn-decls-issue-80468.rs:16:21
- |
-LL | pub fn repro(_: Wrapper<Ref>);
- | ^^^^^^^^^^^^
- |
-note: because this has an unmet lifetime requirement
- --> $DIR/wf-in-foreign-fn-decls-issue-80468.rs:8:23
- |
-LL | pub struct Wrapper<T: Trait>(T);
- | ^^^^^ introduces a `'static` lifetime requirement
-note: the anonymous lifetime as defined here...
- --> $DIR/wf-in-foreign-fn-decls-issue-80468.rs:16:29
- |
-LL | pub fn repro(_: Wrapper<Ref>);
- | ^^^
-note: ...does not necessarily outlive the static lifetime introduced by the compatible `impl`
- --> $DIR/wf-in-foreign-fn-decls-issue-80468.rs:13:1
- |
-LL | impl Trait for Ref {}
- | ^^^^^^^^^^^^^^^^^^
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0726`.
diff --git a/src/test/ui/wf/wf-in-obj-type-static.rs b/src/test/ui/wf/wf-in-obj-type-static.rs
deleted file mode 100644
index 1ad2fd1ed..000000000
--- a/src/test/ui/wf/wf-in-obj-type-static.rs
+++ /dev/null
@@ -1,18 +0,0 @@
-// Check that we enforce WF conditions also for types in fns.
-
-
-#![allow(dead_code)]
-
-trait Object<T> { }
-
-struct MustBeCopy<T:Copy> {
- t: T
-}
-
-struct Foo<T> {
- // needs T: 'static
- x: dyn Object<&'static T> //~ ERROR E0310
-}
-
-
-fn main() { }
diff --git a/src/test/ui/wf/wf-in-obj-type-static.stderr b/src/test/ui/wf/wf-in-obj-type-static.stderr
deleted file mode 100644
index c3ad42dd5..000000000
--- a/src/test/ui/wf/wf-in-obj-type-static.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error[E0310]: the parameter type `T` may not live long enough
- --> $DIR/wf-in-obj-type-static.rs:14:8
- |
-LL | x: dyn Object<&'static T>
- | ^^^^^^^^^^^^^^^^^^^^^^ ...so that the reference type `&'static T` does not outlive the data it points at
- |
-help: consider adding an explicit lifetime bound...
- |
-LL | struct Foo<T: 'static> {
- | +++++++++
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0310`.
diff --git a/src/test/ui/wf/wf-in-obj-type-trait.rs b/src/test/ui/wf/wf-in-obj-type-trait.rs
deleted file mode 100644
index 170fad55f..000000000
--- a/src/test/ui/wf/wf-in-obj-type-trait.rs
+++ /dev/null
@@ -1,14 +0,0 @@
-// Check that we enforce WF conditions also for types in fns.
-
-trait Object<T> { }
-
-struct MustBeCopy<T:Copy> {
- t: T
-}
-
-struct Bar<T> {
- // needs T: Copy
- x: dyn Object<MustBeCopy<T>> //~ ERROR E0277
-}
-
-fn main() { }
diff --git a/src/test/ui/wf/wf-in-obj-type-trait.stderr b/src/test/ui/wf/wf-in-obj-type-trait.stderr
deleted file mode 100644
index f556b678e..000000000
--- a/src/test/ui/wf/wf-in-obj-type-trait.stderr
+++ /dev/null
@@ -1,19 +0,0 @@
-error[E0277]: the trait bound `T: Copy` is not satisfied
- --> $DIR/wf-in-obj-type-trait.rs:11:19
- |
-LL | x: dyn Object<MustBeCopy<T>>
- | ^^^^^^^^^^^^^ the trait `Copy` is not implemented for `T`
- |
-note: required by a bound in `MustBeCopy`
- --> $DIR/wf-in-obj-type-trait.rs:5:21
- |
-LL | struct MustBeCopy<T:Copy> {
- | ^^^^ required by this bound in `MustBeCopy`
-help: consider restricting type parameter `T`
- |
-LL | struct Bar<T: std::marker::Copy> {
- | +++++++++++++++++++
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/wf/wf-inherent-impl-method-where-clause.rs b/src/test/ui/wf/wf-inherent-impl-method-where-clause.rs
deleted file mode 100644
index eb50fc010..000000000
--- a/src/test/ui/wf/wf-inherent-impl-method-where-clause.rs
+++ /dev/null
@@ -1,17 +0,0 @@
-// Test that we check where-clauses on inherent impl methods.
-
-#![feature(associated_type_defaults)]
-
-#![allow(dead_code)]
-
-trait ExtraCopy<T:Copy> { }
-
-struct Foo<T,U>(T,U);
-
-impl<T,U> Foo<T,U> {
- fn foo(self) where T: ExtraCopy<U> //~ ERROR E0277
- {}
-}
-
-
-fn main() { }
diff --git a/src/test/ui/wf/wf-inherent-impl-method-where-clause.stderr b/src/test/ui/wf/wf-inherent-impl-method-where-clause.stderr
deleted file mode 100644
index e723d1ba7..000000000
--- a/src/test/ui/wf/wf-inherent-impl-method-where-clause.stderr
+++ /dev/null
@@ -1,19 +0,0 @@
-error[E0277]: the trait bound `U: Copy` is not satisfied
- --> $DIR/wf-inherent-impl-method-where-clause.rs:12:27
- |
-LL | fn foo(self) where T: ExtraCopy<U>
- | ^^^^^^^^^^^^ the trait `Copy` is not implemented for `U`
- |
-note: required by a bound in `ExtraCopy`
- --> $DIR/wf-inherent-impl-method-where-clause.rs:7:19
- |
-LL | trait ExtraCopy<T:Copy> { }
- | ^^^^ required by this bound in `ExtraCopy`
-help: consider restricting type parameter `U`
- |
-LL | impl<T,U: std::marker::Copy> Foo<T,U> {
- | +++++++++++++++++++
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/wf/wf-inherent-impl-where-clause.rs b/src/test/ui/wf/wf-inherent-impl-where-clause.rs
deleted file mode 100644
index ac194fb13..000000000
--- a/src/test/ui/wf/wf-inherent-impl-where-clause.rs
+++ /dev/null
@@ -1,16 +0,0 @@
-// Test that we check where-clauses on inherent impls.
-
-#![feature(associated_type_defaults)]
-
-#![allow(dead_code)]
-
-trait ExtraCopy<T:Copy> { }
-
-struct Foo<T,U>(T,U);
-
-impl<T,U> Foo<T,U> where T: ExtraCopy<U> //~ ERROR E0277
-{
-}
-
-
-fn main() { }
diff --git a/src/test/ui/wf/wf-inherent-impl-where-clause.stderr b/src/test/ui/wf/wf-inherent-impl-where-clause.stderr
deleted file mode 100644
index 39e0d348e..000000000
--- a/src/test/ui/wf/wf-inherent-impl-where-clause.stderr
+++ /dev/null
@@ -1,19 +0,0 @@
-error[E0277]: the trait bound `U: Copy` is not satisfied
- --> $DIR/wf-inherent-impl-where-clause.rs:11:29
- |
-LL | impl<T,U> Foo<T,U> where T: ExtraCopy<U>
- | ^^^^^^^^^^^^ the trait `Copy` is not implemented for `U`
- |
-note: required by a bound in `ExtraCopy`
- --> $DIR/wf-inherent-impl-where-clause.rs:7:19
- |
-LL | trait ExtraCopy<T:Copy> { }
- | ^^^^ required by this bound in `ExtraCopy`
-help: consider further restricting type parameter `U`
- |
-LL | impl<T,U> Foo<T,U> where T: ExtraCopy<U>, U: std::marker::Copy
- | ++++++++++++++++++++++
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/wf/wf-misc-methods-issue-28609.rs b/src/test/ui/wf/wf-misc-methods-issue-28609.rs
deleted file mode 100644
index 050f866e1..000000000
--- a/src/test/ui/wf/wf-misc-methods-issue-28609.rs
+++ /dev/null
@@ -1,74 +0,0 @@
-// check that misc. method calls are well-formed
-
-use std::marker::PhantomData;
-use std::ops::{Deref, Shl};
-
-#[derive(Copy, Clone)]
-struct S<'a, 'b: 'a> {
- marker: PhantomData<&'a &'b ()>,
- bomb: Option<&'b u32>
-}
-
-type S2<'a> = S<'a, 'a>;
-
-impl<'a, 'b> S<'a, 'b> {
- fn transmute_inherent(&self, a: &'b u32) -> &'a u32 {
- a
- }
-}
-
-fn return_dangling_pointer_inherent(s: S2) -> &u32 {
- let s = s;
- s.transmute_inherent(&mut 42) //~ ERROR cannot return value referencing temporary value
-}
-
-impl<'a, 'b> Deref for S<'a, 'b> {
- type Target = &'a u32;
- fn deref(&self) -> &&'a u32 {
- self.bomb.as_ref().unwrap()
- }
-}
-
-fn return_dangling_pointer_coerce(s: S2) -> &u32 {
- let four = 4;
- let mut s = s;
- s.bomb = Some(&four);
- &s //~ ERROR cannot return value referencing local variable `four`
-}
-
-fn return_dangling_pointer_unary_op(s: S2) -> &u32 {
- let four = 4;
- let mut s = s;
- s.bomb = Some(&four);
- &*s //~ ERROR cannot return value referencing local variable `four`
-}
-
-impl<'a, 'b> Shl<&'b u32> for S<'a, 'b> {
- type Output = &'a u32;
- fn shl(self, t: &'b u32) -> &'a u32 { t }
-}
-
-fn return_dangling_pointer_binary_op(s: S2) -> &u32 {
- let s = s;
- s << &mut 3 //~ ERROR cannot return value referencing temporary value
-}
-
-fn return_dangling_pointer_method(s: S2) -> &u32 {
- let s = s;
- s.shl(&mut 3) //~ ERROR cannot return value referencing temporary value
-}
-
-fn return_dangling_pointer_ufcs(s: S2) -> &u32 {
- let s = s;
- S2::shl(s, &mut 3) //~ ERROR cannot return value referencing temporary value
-}
-
-fn main() {
- let s = S { marker: PhantomData, bomb: None };
- let _inherent_dp = return_dangling_pointer_inherent(s);
- let _coerce_dp = return_dangling_pointer_coerce(s);
- let _unary_dp = return_dangling_pointer_unary_op(s);
- let _binary_dp = return_dangling_pointer_binary_op(s);
- let _method_dp = return_dangling_pointer_method(s);
- let _ufcs_dp = return_dangling_pointer_ufcs(s);
-}
diff --git a/src/test/ui/wf/wf-misc-methods-issue-28609.stderr b/src/test/ui/wf/wf-misc-methods-issue-28609.stderr
deleted file mode 100644
index fc5898434..000000000
--- a/src/test/ui/wf/wf-misc-methods-issue-28609.stderr
+++ /dev/null
@@ -1,55 +0,0 @@
-error[E0515]: cannot return value referencing temporary value
- --> $DIR/wf-misc-methods-issue-28609.rs:22:5
- |
-LL | s.transmute_inherent(&mut 42)
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^--^
- | | |
- | | temporary value created here
- | returns a value referencing data owned by the current function
-
-error[E0515]: cannot return value referencing local variable `four`
- --> $DIR/wf-misc-methods-issue-28609.rs:36:5
- |
-LL | s.bomb = Some(&four);
- | ----- `four` is borrowed here
-LL | &s
- | ^^ returns a value referencing data owned by the current function
-
-error[E0515]: cannot return value referencing local variable `four`
- --> $DIR/wf-misc-methods-issue-28609.rs:43:5
- |
-LL | s.bomb = Some(&four);
- | ----- `four` is borrowed here
-LL | &*s
- | ^^^ returns a value referencing data owned by the current function
-
-error[E0515]: cannot return value referencing temporary value
- --> $DIR/wf-misc-methods-issue-28609.rs:53:5
- |
-LL | s << &mut 3
- | ^^^^^^^^^^-
- | | |
- | | temporary value created here
- | returns a value referencing data owned by the current function
-
-error[E0515]: cannot return value referencing temporary value
- --> $DIR/wf-misc-methods-issue-28609.rs:58:5
- |
-LL | s.shl(&mut 3)
- | ^^^^^^^^^^^-^
- | | |
- | | temporary value created here
- | returns a value referencing data owned by the current function
-
-error[E0515]: cannot return value referencing temporary value
- --> $DIR/wf-misc-methods-issue-28609.rs:63:5
- |
-LL | S2::shl(s, &mut 3)
- | ^^^^^^^^^^^^^^^^-^
- | | |
- | | temporary value created here
- | returns a value referencing data owned by the current function
-
-error: aborting due to 6 previous errors
-
-For more information about this error, try `rustc --explain E0515`.
diff --git a/src/test/ui/wf/wf-object-safe.rs b/src/test/ui/wf/wf-object-safe.rs
deleted file mode 100644
index 42e691755..000000000
--- a/src/test/ui/wf/wf-object-safe.rs
+++ /dev/null
@@ -1,10 +0,0 @@
-// Check that object-safe traits are not WF when used as object types.
-// Issue #21953.
-
-trait A {
- fn foo(&self, _x: &Self);
-}
-
-fn main() {
- let _x: &dyn A; //~ ERROR E0038
-}
diff --git a/src/test/ui/wf/wf-object-safe.stderr b/src/test/ui/wf/wf-object-safe.stderr
deleted file mode 100644
index 64969fbe3..000000000
--- a/src/test/ui/wf/wf-object-safe.stderr
+++ /dev/null
@@ -1,18 +0,0 @@
-error[E0038]: the trait `A` cannot be made into an object
- --> $DIR/wf-object-safe.rs:9:13
- |
-LL | let _x: &dyn A;
- | ^^^^^^ `A` cannot be made into an object
- |
-note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
- --> $DIR/wf-object-safe.rs:5:23
- |
-LL | trait A {
- | - this trait cannot be made into an object...
-LL | fn foo(&self, _x: &Self);
- | ^^^^^ ...because method `foo` references the `Self` type in this parameter
- = help: consider moving `foo` to another trait
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0038`.
diff --git a/src/test/ui/wf/wf-outlives-ty-in-fn-or-trait.rs b/src/test/ui/wf/wf-outlives-ty-in-fn-or-trait.rs
deleted file mode 100644
index 85a332e24..000000000
--- a/src/test/ui/wf/wf-outlives-ty-in-fn-or-trait.rs
+++ /dev/null
@@ -1,22 +0,0 @@
-#![feature(rustc_attrs)]
-#![allow(dead_code)]
-
-trait Trait<'a, T> {
- type Out;
-}
-
-impl<'a, T> Trait<'a, T> for usize {
- type Out = &'a fn(T); //~ ERROR `T` may not live long enough
-}
-
-struct Foo<'a,T> {
- f: &'a fn(T),
-}
-
-trait Baz<T> { }
-
-impl<'a, T> Trait<'a, T> for u32 {
- type Out = &'a dyn Baz<T>; //~ ERROR `T` may not live long enough
-}
-
-fn main() { }
diff --git a/src/test/ui/wf/wf-outlives-ty-in-fn-or-trait.stderr b/src/test/ui/wf/wf-outlives-ty-in-fn-or-trait.stderr
deleted file mode 100644
index 4d4d8b2ab..000000000
--- a/src/test/ui/wf/wf-outlives-ty-in-fn-or-trait.stderr
+++ /dev/null
@@ -1,25 +0,0 @@
-error[E0309]: the parameter type `T` may not live long enough
- --> $DIR/wf-outlives-ty-in-fn-or-trait.rs:9:16
- |
-LL | type Out = &'a fn(T);
- | ^^^^^^^^^ ...so that the reference type `&'a fn(T)` does not outlive the data it points at
- |
-help: consider adding an explicit lifetime bound...
- |
-LL | impl<'a, T: 'a> Trait<'a, T> for usize {
- | ++++
-
-error[E0309]: the parameter type `T` may not live long enough
- --> $DIR/wf-outlives-ty-in-fn-or-trait.rs:19:16
- |
-LL | type Out = &'a dyn Baz<T>;
- | ^^^^^^^^^^^^^^ ...so that the reference type `&'a (dyn Baz<T> + 'a)` does not outlive the data it points at
- |
-help: consider adding an explicit lifetime bound...
- |
-LL | impl<'a, T: 'a> Trait<'a, T> for u32 {
- | ++++
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0309`.
diff --git a/src/test/ui/wf/wf-packed-on-proj-of-type-as-unimpl-trait.rs b/src/test/ui/wf/wf-packed-on-proj-of-type-as-unimpl-trait.rs
deleted file mode 100644
index d0167c8c2..000000000
--- a/src/test/ui/wf/wf-packed-on-proj-of-type-as-unimpl-trait.rs
+++ /dev/null
@@ -1,31 +0,0 @@
-// rust-lang/rust#58158: We have special-case code to deal with case
-// when a type is both packed and needs drop glue, (we move the fields
-// out of their potentially unaligned locations before dropping them,
-// which requires they be Sized; see PR #44884).
-//
-// So, we need to check if a given type needs drop-glue. That requires
-// that we actually know that the concrete type, and we guard against
-// the type having unknown parts (i.e. type variables) by ICE'ing in
-// that scenario.
-//
-// But in a case where we have a projection (`Type as Trait::Assoc`)
-// where `Type` does not actually implement `Trait`, we of course
-// cannot have a concrete type, because there is no impl to look up
-// the concrete type for the associated type `Assoc`.
-//
-// So, this test is just making sure that in such a case that we do
-// not immediately ICE, and instead allow the underlying type error to
-// surface.
-
-pub struct Matrix<S>(S);
-pub struct DefaultAllocator;
-
-pub trait Allocator { type Buffer; }
-
-// impl Allocator for DefaultAllocator { type Buffer = (); }
-
-#[repr(packed)]
-struct Foo(Matrix<<DefaultAllocator as Allocator>::Buffer>);
-//~^ ERROR the trait bound `DefaultAllocator: Allocator` is not satisfied
-
-fn main() { }
diff --git a/src/test/ui/wf/wf-packed-on-proj-of-type-as-unimpl-trait.stderr b/src/test/ui/wf/wf-packed-on-proj-of-type-as-unimpl-trait.stderr
deleted file mode 100644
index e460cdcd3..000000000
--- a/src/test/ui/wf/wf-packed-on-proj-of-type-as-unimpl-trait.stderr
+++ /dev/null
@@ -1,9 +0,0 @@
-error[E0277]: the trait bound `DefaultAllocator: Allocator` is not satisfied
- --> $DIR/wf-packed-on-proj-of-type-as-unimpl-trait.rs:28:12
- |
-LL | struct Foo(Matrix<<DefaultAllocator as Allocator>::Buffer>);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Allocator` is not implemented for `DefaultAllocator`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/wf/wf-static-method.rs b/src/test/ui/wf/wf-static-method.rs
deleted file mode 100644
index 7ff195230..000000000
--- a/src/test/ui/wf/wf-static-method.rs
+++ /dev/null
@@ -1,59 +0,0 @@
-// check that static methods don't get to assume their trait-ref
-// is well-formed.
-// FIXME(#27579): this is just a bug. However, our checking with
-// static inherent methods isn't quite working - need to
-// fix that before removing the check.
-
-trait Foo<'a, 'b, T>: Sized {
- fn make_me() -> Self { loop {} }
- fn static_evil(u: &'b u32) -> &'a u32;
-}
-
-struct Evil<'a, 'b: 'a>(Option<&'a &'b ()>);
-
-impl<'a, 'b> Foo<'a, 'b, Evil<'a, 'b>> for () {
- fn make_me() -> Self { }
- fn static_evil(u: &'b u32) -> &'a u32 {
- u
- //~^ ERROR lifetime may not live long enough
- }
-}
-
-struct IndirectEvil<'a, 'b: 'a>(Option<&'a &'b ()>);
-
-impl<'a, 'b> Foo<'a, 'b, ()> for IndirectEvil<'a, 'b> {
- fn make_me() -> Self { IndirectEvil(None) }
- fn static_evil(u: &'b u32) -> &'a u32 {
- let me = Self::make_me();
- //~^ ERROR lifetime may not live long enough
- loop {} // (`me` could be used for the lifetime transmute).
- }
-}
-
-impl<'a, 'b> Evil<'a, 'b> {
- fn inherent_evil(u: &'b u32) -> &'a u32 {
- u
- //~^ ERROR lifetime may not live long enough
- }
-}
-
-// while static methods don't get to *assume* this, we still
-// *check* that they hold.
-
-fn evil<'a, 'b>(b: &'b u32) -> &'a u32 {
- <()>::static_evil(b)
- //~^ ERROR lifetime may not live long enough
-}
-
-fn indirect_evil<'a, 'b>(b: &'b u32) -> &'a u32 {
- <IndirectEvil>::static_evil(b)
- //~^ ERROR lifetime may not live long enough
-}
-
-fn inherent_evil<'a, 'b>(b: &'b u32) -> &'a u32 {
- <Evil>::inherent_evil(b)
- //~^ ERROR lifetime may not live long enough
-}
-
-
-fn main() {}
diff --git a/src/test/ui/wf/wf-static-method.stderr b/src/test/ui/wf/wf-static-method.stderr
deleted file mode 100644
index 161609a5f..000000000
--- a/src/test/ui/wf/wf-static-method.stderr
+++ /dev/null
@@ -1,77 +0,0 @@
-error: lifetime may not live long enough
- --> $DIR/wf-static-method.rs:17:9
- |
-LL | impl<'a, 'b> Foo<'a, 'b, Evil<'a, 'b>> for () {
- | -- -- lifetime `'b` defined here
- | |
- | lifetime `'a` defined here
-...
-LL | u
- | ^ associated function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b`
- |
- = help: consider adding the following bound: `'b: 'a`
-
-error: lifetime may not live long enough
- --> $DIR/wf-static-method.rs:27:18
- |
-LL | impl<'a, 'b> Foo<'a, 'b, ()> for IndirectEvil<'a, 'b> {
- | -- -- lifetime `'b` defined here
- | |
- | lifetime `'a` defined here
-...
-LL | let me = Self::make_me();
- | ^^^^^^^^^^^^^ requires that `'b` must outlive `'a`
- |
- = help: consider adding the following bound: `'b: 'a`
-
-error: lifetime may not live long enough
- --> $DIR/wf-static-method.rs:35:9
- |
-LL | impl<'a, 'b> Evil<'a, 'b> {
- | -- -- lifetime `'b` defined here
- | |
- | lifetime `'a` defined here
-LL | fn inherent_evil(u: &'b u32) -> &'a u32 {
-LL | u
- | ^ associated function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b`
- |
- = help: consider adding the following bound: `'b: 'a`
-
-error: lifetime may not live long enough
- --> $DIR/wf-static-method.rs:44:5
- |
-LL | fn evil<'a, 'b>(b: &'b u32) -> &'a u32 {
- | -- -- lifetime `'b` defined here
- | |
- | lifetime `'a` defined here
-LL | <()>::static_evil(b)
- | ^^^^^^^^^^^^^^^^^^^^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b`
- |
- = help: consider adding the following bound: `'b: 'a`
-
-error: lifetime may not live long enough
- --> $DIR/wf-static-method.rs:49:5
- |
-LL | fn indirect_evil<'a, 'b>(b: &'b u32) -> &'a u32 {
- | -- -- lifetime `'b` defined here
- | |
- | lifetime `'a` defined here
-LL | <IndirectEvil>::static_evil(b)
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b`
- |
- = help: consider adding the following bound: `'b: 'a`
-
-error: lifetime may not live long enough
- --> $DIR/wf-static-method.rs:54:5
- |
-LL | fn inherent_evil<'a, 'b>(b: &'b u32) -> &'a u32 {
- | -- -- lifetime `'b` defined here
- | |
- | lifetime `'a` defined here
-LL | <Evil>::inherent_evil(b)
- | ^^^^^^^^^^^^^^^^^^^^^^^^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b`
- |
- = help: consider adding the following bound: `'b: 'a`
-
-error: aborting due to 6 previous errors
-
diff --git a/src/test/ui/wf/wf-static-type.rs b/src/test/ui/wf/wf-static-type.rs
deleted file mode 100644
index 1c35e1daf..000000000
--- a/src/test/ui/wf/wf-static-type.rs
+++ /dev/null
@@ -1,14 +0,0 @@
-// Test that we check the types of statics are well-formed.
-
-#![feature(associated_type_defaults)]
-
-#![allow(dead_code)]
-
-struct IsCopy<T:Copy> { t: T }
-struct NotCopy;
-
-static FOO: IsCopy<Option<NotCopy>> = IsCopy { t: None };
-//~^ ERROR E0277
-
-
-fn main() { }
diff --git a/src/test/ui/wf/wf-static-type.stderr b/src/test/ui/wf/wf-static-type.stderr
deleted file mode 100644
index 16c6124b6..000000000
--- a/src/test/ui/wf/wf-static-type.stderr
+++ /dev/null
@@ -1,20 +0,0 @@
-error[E0277]: the trait bound `NotCopy: Copy` is not satisfied
- --> $DIR/wf-static-type.rs:10:13
- |
-LL | static FOO: IsCopy<Option<NotCopy>> = IsCopy { t: None };
- | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `NotCopy`
- |
- = note: required for `Option<NotCopy>` to implement `Copy`
-note: required by a bound in `IsCopy`
- --> $DIR/wf-static-type.rs:7:17
- |
-LL | struct IsCopy<T:Copy> { t: T }
- | ^^^^ required by this bound in `IsCopy`
-help: consider annotating `NotCopy` with `#[derive(Copy)]`
- |
-LL | #[derive(Copy)]
- |
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/wf/wf-struct-bound.rs b/src/test/ui/wf/wf-struct-bound.rs
deleted file mode 100644
index 6e558ca8f..000000000
--- a/src/test/ui/wf/wf-struct-bound.rs
+++ /dev/null
@@ -1,16 +0,0 @@
-// Test that we check struct bounds for WFedness.
-
-#![feature(associated_type_defaults)]
-
-#![allow(dead_code)]
-
-trait ExtraCopy<T:Copy> { }
-
-struct SomeStruct<T,U>
- where T: ExtraCopy<U> //~ ERROR E0277
-{
- data: (T,U)
-}
-
-
-fn main() { }
diff --git a/src/test/ui/wf/wf-struct-bound.stderr b/src/test/ui/wf/wf-struct-bound.stderr
deleted file mode 100644
index 6248e3e4e..000000000
--- a/src/test/ui/wf/wf-struct-bound.stderr
+++ /dev/null
@@ -1,19 +0,0 @@
-error[E0277]: the trait bound `U: Copy` is not satisfied
- --> $DIR/wf-struct-bound.rs:10:14
- |
-LL | where T: ExtraCopy<U>
- | ^^^^^^^^^^^^ the trait `Copy` is not implemented for `U`
- |
-note: required by a bound in `ExtraCopy`
- --> $DIR/wf-struct-bound.rs:7:19
- |
-LL | trait ExtraCopy<T:Copy> { }
- | ^^^^ required by this bound in `ExtraCopy`
-help: consider further restricting type parameter `U`
- |
-LL | where T: ExtraCopy<U>, U: std::marker::Copy
- | ++++++++++++++++++++++
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/wf/wf-struct-field.rs b/src/test/ui/wf/wf-struct-field.rs
deleted file mode 100644
index 63f8b4382..000000000
--- a/src/test/ui/wf/wf-struct-field.rs
+++ /dev/null
@@ -1,16 +0,0 @@
-// Test that we check struct fields for WFedness.
-
-#![feature(associated_type_defaults)]
-
-#![allow(dead_code)]
-
-struct IsCopy<T:Copy> {
- value: T
-}
-
-struct SomeStruct<A> {
- data: IsCopy<A> //~ ERROR E0277
-}
-
-
-fn main() { }
diff --git a/src/test/ui/wf/wf-struct-field.stderr b/src/test/ui/wf/wf-struct-field.stderr
deleted file mode 100644
index 78a8da860..000000000
--- a/src/test/ui/wf/wf-struct-field.stderr
+++ /dev/null
@@ -1,19 +0,0 @@
-error[E0277]: the trait bound `A: Copy` is not satisfied
- --> $DIR/wf-struct-field.rs:12:11
- |
-LL | data: IsCopy<A>
- | ^^^^^^^^^ the trait `Copy` is not implemented for `A`
- |
-note: required by a bound in `IsCopy`
- --> $DIR/wf-struct-field.rs:7:17
- |
-LL | struct IsCopy<T:Copy> {
- | ^^^^ required by this bound in `IsCopy`
-help: consider restricting type parameter `A`
- |
-LL | struct SomeStruct<A: std::marker::Copy> {
- | +++++++++++++++++++
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/wf/wf-trait-associated-type-bound.rs b/src/test/ui/wf/wf-trait-associated-type-bound.rs
deleted file mode 100644
index 2f20e65e5..000000000
--- a/src/test/ui/wf/wf-trait-associated-type-bound.rs
+++ /dev/null
@@ -1,14 +0,0 @@
-// Test that we check associated type bounds for WFedness.
-
-#![feature(associated_type_defaults)]
-
-#![allow(dead_code)]
-
-trait ExtraCopy<T:Copy> { }
-
-trait SomeTrait<T> {
- type Type1: ExtraCopy<T>; //~ ERROR E0277
-}
-
-
-fn main() { }
diff --git a/src/test/ui/wf/wf-trait-associated-type-bound.stderr b/src/test/ui/wf/wf-trait-associated-type-bound.stderr
deleted file mode 100644
index 829770017..000000000
--- a/src/test/ui/wf/wf-trait-associated-type-bound.stderr
+++ /dev/null
@@ -1,19 +0,0 @@
-error[E0277]: the trait bound `T: Copy` is not satisfied
- --> $DIR/wf-trait-associated-type-bound.rs:10:17
- |
-LL | type Type1: ExtraCopy<T>;
- | ^^^^^^^^^^^^ the trait `Copy` is not implemented for `T`
- |
-note: required by a bound in `ExtraCopy`
- --> $DIR/wf-trait-associated-type-bound.rs:7:19
- |
-LL | trait ExtraCopy<T:Copy> { }
- | ^^^^ required by this bound in `ExtraCopy`
-help: consider restricting type parameter `T`
- |
-LL | trait SomeTrait<T: std::marker::Copy> {
- | +++++++++++++++++++
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/wf/wf-trait-associated-type-region.rs b/src/test/ui/wf/wf-trait-associated-type-region.rs
deleted file mode 100644
index 0dfc9f098..000000000
--- a/src/test/ui/wf/wf-trait-associated-type-region.rs
+++ /dev/null
@@ -1,14 +0,0 @@
-// Test that we check associated type default values for WFedness.
-
-#![feature(associated_type_defaults)]
-
-#![allow(dead_code)]
-
-trait SomeTrait<'a> {
- type Type1;
- type Type2 = &'a Self::Type1;
- //~^ ERROR E0309
-}
-
-
-fn main() { }
diff --git a/src/test/ui/wf/wf-trait-associated-type-region.stderr b/src/test/ui/wf/wf-trait-associated-type-region.stderr
deleted file mode 100644
index 6e2cc8aba..000000000
--- a/src/test/ui/wf/wf-trait-associated-type-region.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-error[E0309]: the associated type `<Self as SomeTrait<'a>>::Type1` may not live long enough
- --> $DIR/wf-trait-associated-type-region.rs:9:18
- |
-LL | type Type2 = &'a Self::Type1;
- | ^^^^^^^^^^^^^^^
- |
- = help: consider adding an explicit lifetime bound `<Self as SomeTrait<'a>>::Type1: 'a`...
- = note: ...so that the reference type `&'a <Self as SomeTrait<'a>>::Type1` does not outlive the data it points at
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0309`.
diff --git a/src/test/ui/wf/wf-trait-associated-type-trait.rs b/src/test/ui/wf/wf-trait-associated-type-trait.rs
deleted file mode 100644
index d67e110ed..000000000
--- a/src/test/ui/wf/wf-trait-associated-type-trait.rs
+++ /dev/null
@@ -1,16 +0,0 @@
-// Test that we check associated type default values for WFedness.
-
-#![feature(associated_type_defaults)]
-
-#![allow(dead_code)]
-
-struct IsCopy<T:Copy> { x: T }
-
-trait SomeTrait {
- type Type1;
- type Type2 = (IsCopy<Self::Type1>, bool);
- //~^ ERROR E0277
-}
-
-
-fn main() { }
diff --git a/src/test/ui/wf/wf-trait-associated-type-trait.stderr b/src/test/ui/wf/wf-trait-associated-type-trait.stderr
deleted file mode 100644
index a73c3a2ae..000000000
--- a/src/test/ui/wf/wf-trait-associated-type-trait.stderr
+++ /dev/null
@@ -1,19 +0,0 @@
-error[E0277]: the trait bound `<Self as SomeTrait>::Type1: Copy` is not satisfied
- --> $DIR/wf-trait-associated-type-trait.rs:11:19
- |
-LL | type Type2 = (IsCopy<Self::Type1>, bool);
- | ^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `<Self as SomeTrait>::Type1`
- |
-note: required by a bound in `IsCopy`
- --> $DIR/wf-trait-associated-type-trait.rs:7:17
- |
-LL | struct IsCopy<T:Copy> { x: T }
- | ^^^^ required by this bound in `IsCopy`
-help: consider further restricting the associated type
- |
-LL | trait SomeTrait where <Self as SomeTrait>::Type1: Copy {
- | ++++++++++++++++++++++++++++++++++++++
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/wf/wf-trait-bound.rs b/src/test/ui/wf/wf-trait-bound.rs
deleted file mode 100644
index 62a1eb5b0..000000000
--- a/src/test/ui/wf/wf-trait-bound.rs
+++ /dev/null
@@ -1,15 +0,0 @@
-// Test that we check supertrait bounds for WFedness.
-
-#![feature(associated_type_defaults)]
-
-#![allow(dead_code)]
-
-trait ExtraCopy<T:Copy> { }
-
-trait SomeTrait<T,U>
- where T: ExtraCopy<U> //~ ERROR E0277
-{
-}
-
-
-fn main() { }
diff --git a/src/test/ui/wf/wf-trait-bound.stderr b/src/test/ui/wf/wf-trait-bound.stderr
deleted file mode 100644
index bace3e3ef..000000000
--- a/src/test/ui/wf/wf-trait-bound.stderr
+++ /dev/null
@@ -1,19 +0,0 @@
-error[E0277]: the trait bound `U: Copy` is not satisfied
- --> $DIR/wf-trait-bound.rs:10:14
- |
-LL | where T: ExtraCopy<U>
- | ^^^^^^^^^^^^ the trait `Copy` is not implemented for `U`
- |
-note: required by a bound in `ExtraCopy`
- --> $DIR/wf-trait-bound.rs:7:19
- |
-LL | trait ExtraCopy<T:Copy> { }
- | ^^^^ required by this bound in `ExtraCopy`
-help: consider further restricting type parameter `U`
- |
-LL | where T: ExtraCopy<U>, U: std::marker::Copy
- | ++++++++++++++++++++++
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/wf/wf-trait-default-fn-arg.rs b/src/test/ui/wf/wf-trait-default-fn-arg.rs
deleted file mode 100644
index 64fc35aeb..000000000
--- a/src/test/ui/wf/wf-trait-default-fn-arg.rs
+++ /dev/null
@@ -1,19 +0,0 @@
-// Check that we test WF conditions for fn arguments. Because the
-// current code is so goofy, this is only a warning for now.
-
-
-#![allow(dead_code)]
-#![allow(unused_variables)]
-
-struct Bar<T:Eq+?Sized> { value: Box<T> }
-
-trait Foo {
- fn bar(&self, x: &Bar<Self>) {
- //~^ ERROR E0277
- //
- // Here, Eq ought to be implemented.
- }
-}
-
-
-fn main() { }
diff --git a/src/test/ui/wf/wf-trait-default-fn-arg.stderr b/src/test/ui/wf/wf-trait-default-fn-arg.stderr
deleted file mode 100644
index 8c3d0568f..000000000
--- a/src/test/ui/wf/wf-trait-default-fn-arg.stderr
+++ /dev/null
@@ -1,19 +0,0 @@
-error[E0277]: the trait bound `Self: Eq` is not satisfied
- --> $DIR/wf-trait-default-fn-arg.rs:11:23
- |
-LL | fn bar(&self, x: &Bar<Self>) {
- | ^^^^^^^^^ the trait `Eq` is not implemented for `Self`
- |
-note: required by a bound in `Bar`
- --> $DIR/wf-trait-default-fn-arg.rs:8:14
- |
-LL | struct Bar<T:Eq+?Sized> { value: Box<T> }
- | ^^ required by this bound in `Bar`
-help: consider further restricting `Self`
- |
-LL | fn bar(&self, x: &Bar<Self>) where Self: Eq {
- | ++++++++++++++
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/wf/wf-trait-default-fn-ret.rs b/src/test/ui/wf/wf-trait-default-fn-ret.rs
deleted file mode 100644
index 2103dae8d..000000000
--- a/src/test/ui/wf/wf-trait-default-fn-ret.rs
+++ /dev/null
@@ -1,19 +0,0 @@
-// Check that we test WF conditions for fn arguments. Because the
-// current code is so goofy, this is only a warning for now.
-
-#![feature(rustc_attrs)]
-#![allow(dead_code)]
-#![allow(unused_variables)]
-
-struct Bar<T:Eq+?Sized> { value: Box<T> }
-
-trait Foo {
- fn bar(&self) -> Bar<Self> {
- //~^ ERROR E0277
- //
- // Here, Eq ought to be implemented.
- loop { }
- }
-}
-
-fn main() { }
diff --git a/src/test/ui/wf/wf-trait-default-fn-ret.stderr b/src/test/ui/wf/wf-trait-default-fn-ret.stderr
deleted file mode 100644
index 6422e862d..000000000
--- a/src/test/ui/wf/wf-trait-default-fn-ret.stderr
+++ /dev/null
@@ -1,19 +0,0 @@
-error[E0277]: the trait bound `Self: Eq` is not satisfied
- --> $DIR/wf-trait-default-fn-ret.rs:11:22
- |
-LL | fn bar(&self) -> Bar<Self> {
- | ^^^^^^^^^ the trait `Eq` is not implemented for `Self`
- |
-note: required by a bound in `Bar`
- --> $DIR/wf-trait-default-fn-ret.rs:8:14
- |
-LL | struct Bar<T:Eq+?Sized> { value: Box<T> }
- | ^^ required by this bound in `Bar`
-help: consider further restricting `Self`
- |
-LL | fn bar(&self) -> Bar<Self> where Self: Eq {
- | ++++++++++++++
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/wf/wf-trait-default-fn-where-clause.rs b/src/test/ui/wf/wf-trait-default-fn-where-clause.rs
deleted file mode 100644
index ded97214f..000000000
--- a/src/test/ui/wf/wf-trait-default-fn-where-clause.rs
+++ /dev/null
@@ -1,19 +0,0 @@
-// Check that we test WF conditions for fn arguments. Because the
-// current code is so goofy, this is only a warning for now.
-
-
-#![allow(dead_code)]
-#![allow(unused_variables)]
-
-trait Bar<T:Eq+?Sized> { }
-
-trait Foo {
- fn bar<A>(&self) where A: Bar<Self> {
- //~^ ERROR E0277
- //
- // Here, Eq ought to be implemented.
- }
-}
-
-
-fn main() { }
diff --git a/src/test/ui/wf/wf-trait-default-fn-where-clause.stderr b/src/test/ui/wf/wf-trait-default-fn-where-clause.stderr
deleted file mode 100644
index f260d5750..000000000
--- a/src/test/ui/wf/wf-trait-default-fn-where-clause.stderr
+++ /dev/null
@@ -1,19 +0,0 @@
-error[E0277]: the trait bound `Self: Eq` is not satisfied
- --> $DIR/wf-trait-default-fn-where-clause.rs:11:31
- |
-LL | fn bar<A>(&self) where A: Bar<Self> {
- | ^^^^^^^^^ the trait `Eq` is not implemented for `Self`
- |
-note: required by a bound in `Bar`
- --> $DIR/wf-trait-default-fn-where-clause.rs:8:13
- |
-LL | trait Bar<T:Eq+?Sized> { }
- | ^^ required by this bound in `Bar`
-help: consider further restricting `Self`
- |
-LL | fn bar<A>(&self) where A: Bar<Self>, Self: Eq {
- | ++++++++++
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/wf/wf-trait-fn-arg.rs b/src/test/ui/wf/wf-trait-fn-arg.rs
deleted file mode 100644
index 044569942..000000000
--- a/src/test/ui/wf/wf-trait-fn-arg.rs
+++ /dev/null
@@ -1,16 +0,0 @@
-// Check that we test WF conditions for fn arguments in a trait definition.
-
-#![feature(rustc_attrs)]
-#![allow(dead_code)]
-#![allow(unused_variables)]
-
-struct Bar<T:Eq+?Sized> { value: Box<T> }
-
-trait Foo {
- fn bar(&self, x: &Bar<Self>);
- //~^ ERROR E0277
- //
- // Here, Eq ought to be implemented.
-}
-
-fn main() { }
diff --git a/src/test/ui/wf/wf-trait-fn-arg.stderr b/src/test/ui/wf/wf-trait-fn-arg.stderr
deleted file mode 100644
index 3bd1f4892..000000000
--- a/src/test/ui/wf/wf-trait-fn-arg.stderr
+++ /dev/null
@@ -1,19 +0,0 @@
-error[E0277]: the trait bound `Self: Eq` is not satisfied
- --> $DIR/wf-trait-fn-arg.rs:10:23
- |
-LL | fn bar(&self, x: &Bar<Self>);
- | ^^^^^^^^^ the trait `Eq` is not implemented for `Self`
- |
-note: required by a bound in `Bar`
- --> $DIR/wf-trait-fn-arg.rs:7:14
- |
-LL | struct Bar<T:Eq+?Sized> { value: Box<T> }
- | ^^ required by this bound in `Bar`
-help: consider further restricting `Self`
- |
-LL | fn bar(&self, x: &Bar<Self>) where Self: Eq;
- | ++++++++++++++
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/wf/wf-trait-fn-ret.rs b/src/test/ui/wf/wf-trait-fn-ret.rs
deleted file mode 100644
index f49e43087..000000000
--- a/src/test/ui/wf/wf-trait-fn-ret.rs
+++ /dev/null
@@ -1,16 +0,0 @@
-// Check that we test WF conditions for fn return types in a trait definition.
-
-#![feature(rustc_attrs)]
-#![allow(dead_code)]
-#![allow(unused_variables)]
-
-struct Bar<T:Eq+?Sized> { value: Box<T> }
-
-trait Foo {
- fn bar(&self) -> &Bar<Self>;
- //~^ ERROR E0277
- //
- // Here, Eq ought to be implemented.
-}
-
-fn main() { }
diff --git a/src/test/ui/wf/wf-trait-fn-ret.stderr b/src/test/ui/wf/wf-trait-fn-ret.stderr
deleted file mode 100644
index 9bd3cc771..000000000
--- a/src/test/ui/wf/wf-trait-fn-ret.stderr
+++ /dev/null
@@ -1,19 +0,0 @@
-error[E0277]: the trait bound `Self: Eq` is not satisfied
- --> $DIR/wf-trait-fn-ret.rs:10:23
- |
-LL | fn bar(&self) -> &Bar<Self>;
- | ^^^^^^^^^ the trait `Eq` is not implemented for `Self`
- |
-note: required by a bound in `Bar`
- --> $DIR/wf-trait-fn-ret.rs:7:14
- |
-LL | struct Bar<T:Eq+?Sized> { value: Box<T> }
- | ^^ required by this bound in `Bar`
-help: consider further restricting `Self`
- |
-LL | fn bar(&self) -> &Bar<Self> where Self: Eq;
- | ++++++++++++++
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/wf/wf-trait-fn-where-clause.rs b/src/test/ui/wf/wf-trait-fn-where-clause.rs
deleted file mode 100644
index 1d2427ff9..000000000
--- a/src/test/ui/wf/wf-trait-fn-where-clause.rs
+++ /dev/null
@@ -1,17 +0,0 @@
-// Check that we test WF conditions for fn where clauses in a trait definition.
-
-
-#![allow(dead_code)]
-#![allow(unused_variables)]
-
-struct Bar<T:Eq+?Sized> { value: Box<T> }
-
-trait Foo {
- fn bar(&self) where Self: Sized, Bar<Self>: Copy;
- //~^ ERROR E0277
- //
- // Here, Eq ought to be implemented.
-}
-
-
-fn main() { }
diff --git a/src/test/ui/wf/wf-trait-fn-where-clause.stderr b/src/test/ui/wf/wf-trait-fn-where-clause.stderr
deleted file mode 100644
index d064f7fc5..000000000
--- a/src/test/ui/wf/wf-trait-fn-where-clause.stderr
+++ /dev/null
@@ -1,19 +0,0 @@
-error[E0277]: the trait bound `Self: Eq` is not satisfied
- --> $DIR/wf-trait-fn-where-clause.rs:10:49
- |
-LL | fn bar(&self) where Self: Sized, Bar<Self>: Copy;
- | ^^^^ the trait `Eq` is not implemented for `Self`
- |
-note: required by a bound in `Bar`
- --> $DIR/wf-trait-fn-where-clause.rs:7:14
- |
-LL | struct Bar<T:Eq+?Sized> { value: Box<T> }
- | ^^ required by this bound in `Bar`
-help: consider further restricting `Self`
- |
-LL | fn bar(&self) where Self: Sized, Bar<Self>: Copy, Self: Eq;
- | ++++++++++
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/wf/wf-trait-superbound.rs b/src/test/ui/wf/wf-trait-superbound.rs
deleted file mode 100644
index 8905a8820..000000000
--- a/src/test/ui/wf/wf-trait-superbound.rs
+++ /dev/null
@@ -1,12 +0,0 @@
-// Test that we check supertrait bounds for WFedness.
-
-#![feature(associated_type_defaults)]
-#![feature(rustc_attrs)]
-#![allow(dead_code)]
-
-trait ExtraCopy<T:Copy> { }
-
-trait SomeTrait<T>: ExtraCopy<T> { //~ ERROR E0277
-}
-
-fn main() { }
diff --git a/src/test/ui/wf/wf-trait-superbound.stderr b/src/test/ui/wf/wf-trait-superbound.stderr
deleted file mode 100644
index cd49243a4..000000000
--- a/src/test/ui/wf/wf-trait-superbound.stderr
+++ /dev/null
@@ -1,19 +0,0 @@
-error[E0277]: the trait bound `T: Copy` is not satisfied
- --> $DIR/wf-trait-superbound.rs:9:21
- |
-LL | trait SomeTrait<T>: ExtraCopy<T> {
- | ^^^^^^^^^^^^ the trait `Copy` is not implemented for `T`
- |
-note: required by a bound in `ExtraCopy`
- --> $DIR/wf-trait-superbound.rs:7:19
- |
-LL | trait ExtraCopy<T:Copy> { }
- | ^^^^ required by this bound in `ExtraCopy`
-help: consider restricting type parameter `T`
- |
-LL | trait SomeTrait<T: std::marker::Copy>: ExtraCopy<T> {
- | +++++++++++++++++++
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/wf/wf-unsafe-trait-obj-match.rs b/src/test/ui/wf/wf-unsafe-trait-obj-match.rs
deleted file mode 100644
index c8731a8ec..000000000
--- a/src/test/ui/wf/wf-unsafe-trait-obj-match.rs
+++ /dev/null
@@ -1,29 +0,0 @@
-// Check that we do not allow coercions to object
-// unsafe trait objects in match arms
-
-#![feature(object_safe_for_dispatch)]
-
-trait Trait: Sized {}
-
-struct S;
-
-impl Trait for S {}
-
-struct R;
-
-impl Trait for R {}
-
-fn opt() -> Option<()> {
- Some(())
-}
-
-fn main() {
- match opt() {
- Some(()) => &S,
- None => &R, //~ ERROR E0308
- }
- let t: &dyn Trait = match opt() { //~ ERROR E0038
- Some(()) => &S, //~ ERROR E0038
- None => &R,
- };
-}
diff --git a/src/test/ui/wf/wf-unsafe-trait-obj-match.stderr b/src/test/ui/wf/wf-unsafe-trait-obj-match.stderr
deleted file mode 100644
index 96fc1d36b..000000000
--- a/src/test/ui/wf/wf-unsafe-trait-obj-match.stderr
+++ /dev/null
@@ -1,54 +0,0 @@
-error[E0308]: `match` arms have incompatible types
- --> $DIR/wf-unsafe-trait-obj-match.rs:23:17
- |
-LL | / match opt() {
-LL | | Some(()) => &S,
- | | -- this is found to be of type `&S`
-LL | | None => &R,
- | | ^^ expected struct `S`, found struct `R`
-LL | | }
- | |_____- `match` arms have incompatible types
- |
- = note: expected reference `&S`
- found reference `&R`
-
-error[E0038]: the trait `Trait` cannot be made into an object
- --> $DIR/wf-unsafe-trait-obj-match.rs:26:21
- |
-LL | Some(()) => &S,
- | ^^ `Trait` cannot be made into an object
- |
-note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
- --> $DIR/wf-unsafe-trait-obj-match.rs:6:14
- |
-LL | trait Trait: Sized {}
- | ----- ^^^^^ ...because it requires `Self: Sized`
- | |
- | this trait cannot be made into an object...
- = note: required for `&S` to implement `CoerceUnsized<&dyn Trait>`
- = note: required by cast to type `&dyn Trait`
-
-error[E0038]: the trait `Trait` cannot be made into an object
- --> $DIR/wf-unsafe-trait-obj-match.rs:25:25
- |
-LL | let t: &dyn Trait = match opt() {
- | _________________________^
-LL | | Some(()) => &S,
-LL | | None => &R,
-LL | | };
- | |_____^ `Trait` cannot be made into an object
- |
-note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
- --> $DIR/wf-unsafe-trait-obj-match.rs:6:14
- |
-LL | trait Trait: Sized {}
- | ----- ^^^^^ ...because it requires `Self: Sized`
- | |
- | this trait cannot be made into an object...
- = note: required for `&R` to implement `CoerceUnsized<&dyn Trait>`
- = note: required by cast to type `&dyn Trait`
-
-error: aborting due to 3 previous errors
-
-Some errors have detailed explanations: E0038, E0308.
-For more information about an error, try `rustc --explain E0038`.