From 64d98f8ee037282c35007b64c2649055c56af1db Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:03 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- src/test/ui/wf/hir-wf-check-erase-regions.rs | 14 ---- src/test/ui/wf/hir-wf-check-erase-regions.stderr | 33 ---------- src/test/ui/wf/issue-103573.rs | 22 ------- src/test/ui/wf/issue-103573.stderr | 14 ---- src/test/ui/wf/issue-48638.rs | 21 ------ src/test/ui/wf/issue-87495.rs | 8 --- src/test/ui/wf/issue-87495.stderr | 18 ----- src/test/ui/wf/issue-95665.rs | 18 ----- src/test/ui/wf/issue-95665.stderr | 15 ----- src/test/ui/wf/issue-96810.rs | 12 ---- src/test/ui/wf/issue-96810.stderr | 19 ------ src/test/ui/wf/wf-array-elem-sized.rs | 11 ---- src/test/ui/wf/wf-array-elem-sized.stderr | 12 ---- src/test/ui/wf/wf-complex-assoc-type.rs | 12 ---- src/test/ui/wf/wf-complex-assoc-type.stderr | 15 ----- src/test/ui/wf/wf-const-type.rs | 14 ---- src/test/ui/wf/wf-const-type.stderr | 20 ------ src/test/ui/wf/wf-convert-unsafe-trait-obj-box.rs | 18 ----- .../ui/wf/wf-convert-unsafe-trait-obj-box.stderr | 51 -------------- src/test/ui/wf/wf-convert-unsafe-trait-obj.rs | 18 ----- src/test/ui/wf/wf-convert-unsafe-trait-obj.stderr | 51 -------------- src/test/ui/wf/wf-enum-bound.rs | 16 ----- src/test/ui/wf/wf-enum-bound.stderr | 19 ------ src/test/ui/wf/wf-enum-fields-struct-variant.rs | 18 ----- .../ui/wf/wf-enum-fields-struct-variant.stderr | 19 ------ src/test/ui/wf/wf-enum-fields.rs | 16 ----- src/test/ui/wf/wf-enum-fields.stderr | 19 ------ src/test/ui/wf/wf-fn-where-clause.rs | 20 ------ src/test/ui/wf/wf-fn-where-clause.stderr | 49 -------------- src/test/ui/wf/wf-foreign-fn-decl-ret.rs | 18 ----- src/test/ui/wf/wf-foreign-fn-decl-ret.stderr | 21 ------ src/test/ui/wf/wf-impl-associated-type-region.rs | 14 ---- .../ui/wf/wf-impl-associated-type-region.stderr | 14 ---- src/test/ui/wf/wf-impl-associated-type-trait.rs | 22 ------- .../ui/wf/wf-impl-associated-type-trait.stderr | 19 ------ src/test/ui/wf/wf-impl-self-type.rs | 7 -- src/test/ui/wf/wf-impl-self-type.stderr | 16 ----- src/test/ui/wf/wf-in-fn-arg.rs | 14 ---- src/test/ui/wf/wf-in-fn-arg.stderr | 19 ------ src/test/ui/wf/wf-in-fn-ret.rs | 14 ---- src/test/ui/wf/wf-in-fn-ret.stderr | 19 ------ src/test/ui/wf/wf-in-fn-type-arg.rs | 12 ---- src/test/ui/wf/wf-in-fn-type-arg.stderr | 19 ------ src/test/ui/wf/wf-in-fn-type-ret.rs | 12 ---- src/test/ui/wf/wf-in-fn-type-ret.stderr | 19 ------ src/test/ui/wf/wf-in-fn-type-static.rs | 22 ------- src/test/ui/wf/wf-in-fn-type-static.stderr | 25 ------- src/test/ui/wf/wf-in-fn-where-clause.rs | 15 ----- src/test/ui/wf/wf-in-fn-where-clause.stderr | 19 ------ .../ui/wf/wf-in-foreign-fn-decls-issue-80468.rs | 17 ----- .../wf/wf-in-foreign-fn-decls-issue-80468.stderr | 37 ----------- src/test/ui/wf/wf-in-obj-type-static.rs | 18 ----- src/test/ui/wf/wf-in-obj-type-static.stderr | 14 ---- src/test/ui/wf/wf-in-obj-type-trait.rs | 14 ---- src/test/ui/wf/wf-in-obj-type-trait.stderr | 19 ------ .../ui/wf/wf-inherent-impl-method-where-clause.rs | 17 ----- .../wf/wf-inherent-impl-method-where-clause.stderr | 19 ------ src/test/ui/wf/wf-inherent-impl-where-clause.rs | 16 ----- .../ui/wf/wf-inherent-impl-where-clause.stderr | 19 ------ src/test/ui/wf/wf-misc-methods-issue-28609.rs | 74 --------------------- src/test/ui/wf/wf-misc-methods-issue-28609.stderr | 55 ---------------- src/test/ui/wf/wf-object-safe.rs | 10 --- src/test/ui/wf/wf-object-safe.stderr | 18 ----- src/test/ui/wf/wf-outlives-ty-in-fn-or-trait.rs | 22 ------- .../ui/wf/wf-outlives-ty-in-fn-or-trait.stderr | 25 ------- .../wf-packed-on-proj-of-type-as-unimpl-trait.rs | 31 --------- ...f-packed-on-proj-of-type-as-unimpl-trait.stderr | 9 --- src/test/ui/wf/wf-static-method.rs | 59 ----------------- src/test/ui/wf/wf-static-method.stderr | 77 ---------------------- src/test/ui/wf/wf-static-type.rs | 14 ---- src/test/ui/wf/wf-static-type.stderr | 20 ------ src/test/ui/wf/wf-struct-bound.rs | 16 ----- src/test/ui/wf/wf-struct-bound.stderr | 19 ------ src/test/ui/wf/wf-struct-field.rs | 16 ----- src/test/ui/wf/wf-struct-field.stderr | 19 ------ src/test/ui/wf/wf-trait-associated-type-bound.rs | 14 ---- .../ui/wf/wf-trait-associated-type-bound.stderr | 19 ------ src/test/ui/wf/wf-trait-associated-type-region.rs | 14 ---- .../ui/wf/wf-trait-associated-type-region.stderr | 12 ---- src/test/ui/wf/wf-trait-associated-type-trait.rs | 16 ----- .../ui/wf/wf-trait-associated-type-trait.stderr | 19 ------ src/test/ui/wf/wf-trait-bound.rs | 15 ----- src/test/ui/wf/wf-trait-bound.stderr | 19 ------ src/test/ui/wf/wf-trait-default-fn-arg.rs | 19 ------ src/test/ui/wf/wf-trait-default-fn-arg.stderr | 19 ------ src/test/ui/wf/wf-trait-default-fn-ret.rs | 19 ------ src/test/ui/wf/wf-trait-default-fn-ret.stderr | 19 ------ src/test/ui/wf/wf-trait-default-fn-where-clause.rs | 19 ------ .../ui/wf/wf-trait-default-fn-where-clause.stderr | 19 ------ src/test/ui/wf/wf-trait-fn-arg.rs | 16 ----- src/test/ui/wf/wf-trait-fn-arg.stderr | 19 ------ src/test/ui/wf/wf-trait-fn-ret.rs | 16 ----- src/test/ui/wf/wf-trait-fn-ret.stderr | 19 ------ src/test/ui/wf/wf-trait-fn-where-clause.rs | 17 ----- src/test/ui/wf/wf-trait-fn-where-clause.stderr | 19 ------ src/test/ui/wf/wf-trait-superbound.rs | 12 ---- src/test/ui/wf/wf-trait-superbound.stderr | 19 ------ src/test/ui/wf/wf-unsafe-trait-obj-match.rs | 29 -------- src/test/ui/wf/wf-unsafe-trait-obj-match.stderr | 54 --------------- 99 files changed, 2068 deletions(-) delete mode 100644 src/test/ui/wf/hir-wf-check-erase-regions.rs delete mode 100644 src/test/ui/wf/hir-wf-check-erase-regions.stderr delete mode 100644 src/test/ui/wf/issue-103573.rs delete mode 100644 src/test/ui/wf/issue-103573.stderr delete mode 100644 src/test/ui/wf/issue-48638.rs delete mode 100644 src/test/ui/wf/issue-87495.rs delete mode 100644 src/test/ui/wf/issue-87495.stderr delete mode 100644 src/test/ui/wf/issue-95665.rs delete mode 100644 src/test/ui/wf/issue-95665.stderr delete mode 100644 src/test/ui/wf/issue-96810.rs delete mode 100644 src/test/ui/wf/issue-96810.stderr delete mode 100644 src/test/ui/wf/wf-array-elem-sized.rs delete mode 100644 src/test/ui/wf/wf-array-elem-sized.stderr delete mode 100644 src/test/ui/wf/wf-complex-assoc-type.rs delete mode 100644 src/test/ui/wf/wf-complex-assoc-type.stderr delete mode 100644 src/test/ui/wf/wf-const-type.rs delete mode 100644 src/test/ui/wf/wf-const-type.stderr delete mode 100644 src/test/ui/wf/wf-convert-unsafe-trait-obj-box.rs delete mode 100644 src/test/ui/wf/wf-convert-unsafe-trait-obj-box.stderr delete mode 100644 src/test/ui/wf/wf-convert-unsafe-trait-obj.rs delete mode 100644 src/test/ui/wf/wf-convert-unsafe-trait-obj.stderr delete mode 100644 src/test/ui/wf/wf-enum-bound.rs delete mode 100644 src/test/ui/wf/wf-enum-bound.stderr delete mode 100644 src/test/ui/wf/wf-enum-fields-struct-variant.rs delete mode 100644 src/test/ui/wf/wf-enum-fields-struct-variant.stderr delete mode 100644 src/test/ui/wf/wf-enum-fields.rs delete mode 100644 src/test/ui/wf/wf-enum-fields.stderr delete mode 100644 src/test/ui/wf/wf-fn-where-clause.rs delete mode 100644 src/test/ui/wf/wf-fn-where-clause.stderr delete mode 100644 src/test/ui/wf/wf-foreign-fn-decl-ret.rs delete mode 100644 src/test/ui/wf/wf-foreign-fn-decl-ret.stderr delete mode 100644 src/test/ui/wf/wf-impl-associated-type-region.rs delete mode 100644 src/test/ui/wf/wf-impl-associated-type-region.stderr delete mode 100644 src/test/ui/wf/wf-impl-associated-type-trait.rs delete mode 100644 src/test/ui/wf/wf-impl-associated-type-trait.stderr delete mode 100644 src/test/ui/wf/wf-impl-self-type.rs delete mode 100644 src/test/ui/wf/wf-impl-self-type.stderr delete mode 100644 src/test/ui/wf/wf-in-fn-arg.rs delete mode 100644 src/test/ui/wf/wf-in-fn-arg.stderr delete mode 100644 src/test/ui/wf/wf-in-fn-ret.rs delete mode 100644 src/test/ui/wf/wf-in-fn-ret.stderr delete mode 100644 src/test/ui/wf/wf-in-fn-type-arg.rs delete mode 100644 src/test/ui/wf/wf-in-fn-type-arg.stderr delete mode 100644 src/test/ui/wf/wf-in-fn-type-ret.rs delete mode 100644 src/test/ui/wf/wf-in-fn-type-ret.stderr delete mode 100644 src/test/ui/wf/wf-in-fn-type-static.rs delete mode 100644 src/test/ui/wf/wf-in-fn-type-static.stderr delete mode 100644 src/test/ui/wf/wf-in-fn-where-clause.rs delete mode 100644 src/test/ui/wf/wf-in-fn-where-clause.stderr delete mode 100644 src/test/ui/wf/wf-in-foreign-fn-decls-issue-80468.rs delete mode 100644 src/test/ui/wf/wf-in-foreign-fn-decls-issue-80468.stderr delete mode 100644 src/test/ui/wf/wf-in-obj-type-static.rs delete mode 100644 src/test/ui/wf/wf-in-obj-type-static.stderr delete mode 100644 src/test/ui/wf/wf-in-obj-type-trait.rs delete mode 100644 src/test/ui/wf/wf-in-obj-type-trait.stderr delete mode 100644 src/test/ui/wf/wf-inherent-impl-method-where-clause.rs delete mode 100644 src/test/ui/wf/wf-inherent-impl-method-where-clause.stderr delete mode 100644 src/test/ui/wf/wf-inherent-impl-where-clause.rs delete mode 100644 src/test/ui/wf/wf-inherent-impl-where-clause.stderr delete mode 100644 src/test/ui/wf/wf-misc-methods-issue-28609.rs delete mode 100644 src/test/ui/wf/wf-misc-methods-issue-28609.stderr delete mode 100644 src/test/ui/wf/wf-object-safe.rs delete mode 100644 src/test/ui/wf/wf-object-safe.stderr delete mode 100644 src/test/ui/wf/wf-outlives-ty-in-fn-or-trait.rs delete mode 100644 src/test/ui/wf/wf-outlives-ty-in-fn-or-trait.stderr delete mode 100644 src/test/ui/wf/wf-packed-on-proj-of-type-as-unimpl-trait.rs delete mode 100644 src/test/ui/wf/wf-packed-on-proj-of-type-as-unimpl-trait.stderr delete mode 100644 src/test/ui/wf/wf-static-method.rs delete mode 100644 src/test/ui/wf/wf-static-method.stderr delete mode 100644 src/test/ui/wf/wf-static-type.rs delete mode 100644 src/test/ui/wf/wf-static-type.stderr delete mode 100644 src/test/ui/wf/wf-struct-bound.rs delete mode 100644 src/test/ui/wf/wf-struct-bound.stderr delete mode 100644 src/test/ui/wf/wf-struct-field.rs delete mode 100644 src/test/ui/wf/wf-struct-field.stderr delete mode 100644 src/test/ui/wf/wf-trait-associated-type-bound.rs delete mode 100644 src/test/ui/wf/wf-trait-associated-type-bound.stderr delete mode 100644 src/test/ui/wf/wf-trait-associated-type-region.rs delete mode 100644 src/test/ui/wf/wf-trait-associated-type-region.stderr delete mode 100644 src/test/ui/wf/wf-trait-associated-type-trait.rs delete mode 100644 src/test/ui/wf/wf-trait-associated-type-trait.stderr delete mode 100644 src/test/ui/wf/wf-trait-bound.rs delete mode 100644 src/test/ui/wf/wf-trait-bound.stderr delete mode 100644 src/test/ui/wf/wf-trait-default-fn-arg.rs delete mode 100644 src/test/ui/wf/wf-trait-default-fn-arg.stderr delete mode 100644 src/test/ui/wf/wf-trait-default-fn-ret.rs delete mode 100644 src/test/ui/wf/wf-trait-default-fn-ret.stderr delete mode 100644 src/test/ui/wf/wf-trait-default-fn-where-clause.rs delete mode 100644 src/test/ui/wf/wf-trait-default-fn-where-clause.stderr delete mode 100644 src/test/ui/wf/wf-trait-fn-arg.rs delete mode 100644 src/test/ui/wf/wf-trait-fn-arg.stderr delete mode 100644 src/test/ui/wf/wf-trait-fn-ret.rs delete mode 100644 src/test/ui/wf/wf-trait-fn-ret.stderr delete mode 100644 src/test/ui/wf/wf-trait-fn-where-clause.rs delete mode 100644 src/test/ui/wf/wf-trait-fn-where-clause.stderr delete mode 100644 src/test/ui/wf/wf-trait-superbound.rs delete mode 100644 src/test/ui/wf/wf-trait-superbound.stderr delete mode 100644 src/test/ui/wf/wf-unsafe-trait-obj-match.rs delete mode 100644 src/test/ui/wf/wf-unsafe-trait-obj-match.stderr (limited to 'src/test/ui/wf') 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([Option; N]); - -impl<'a, T, const N: usize> IntoIterator for &'a Table { - type IntoIter = std::iter::Flatten>; //~ 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>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `&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> { - | ^^^^^^^^^^^^ 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> { - | ^^^^^^^^^^^^ 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(_: &::TypeD); -} - -pub trait TraitC { - type TypeC<'a>: TraitB; - - fn g<'a>(_: &< as TraitB>::TypeB as TraitA>::TypeA); - //~^ ERROR the trait bound `<>::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 `<>::TypeC<'a> as TraitB>::TypeB: TraitA` is not satisfied - --> $DIR/issue-103573.rs:18:5 - | -LL | fn g<'a>(_: &< as TraitB>::TypeB as TraitA>::TypeA); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `TraitA` is not implemented for `<>::TypeC<'a> as TraitB>::TypeB` - | -help: consider further restricting the associated type - | -LL | fn g<'a>(_: &< as TraitB>::TypeB as TraitA>::TypeA) where <>::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: Sized { - type AS; -} - -pub struct As(R); - -pub struct AT; -impl A for AT { - type AS = As; -} - -#[repr(packed)] -struct S(>::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 - --> $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 { - member: T, -} - -// uncomment and bug goes away -// impl Trait for u8 {} - -extern "C" { - static VAR: Struct; - //~^ 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; - | ^^^^^^^^^^ 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 { - | ^^^^^ 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::Assoc); - -trait Tr { - type Assoc; -} - -struct Hoge { - s: S, //~ 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, - | ^^^^ 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::Assoc); - | ^^ required by this bound in `S` -help: consider restricting type parameter `K` - | -LL | struct Hoge { - | ++++ - -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); - -trait HelperTrait { - type MyItem; -} - -impl HelperTrait for () { - type MyItem = Option<((AssertMyTrait, 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, 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); - | ^^^^^^^ 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: T } -struct NotCopy; - -const FOO: IsCopy> = 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> = IsCopy { t: None }; - | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `NotCopy` - | - = note: required for `Option` to implement `Copy` -note: required by a bound in `IsCopy` - --> $DIR/wf-const-type.rs:7:17 - | -LL | struct IsCopy { 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) {} - -fn main() { - Box::new(S) as Box; //~ ERROR E0038 - let t_box: Box = 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 = 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 - --> $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` to implement `CoerceUnsized>` - = note: required by cast to type `Box` - -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 - --> $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` to implement `CoerceUnsized>` - = 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; - | ^^^^^^^^^^^ `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 - --> $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` to implement `CoerceUnsized>` - = note: required by cast to type `Box` - -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 - --> $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 - --> $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 - --> $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 { } - -enum SomeEnum - where T: ExtraCopy //~ 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 - | ^^^^^^^^^^^^ 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 { } - | ^^^^ required by this bound in `ExtraCopy` -help: consider further restricting type parameter `U` - | -LL | where T: ExtraCopy, 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 { - value: T -} - -enum AnotherEnum { - AnotherVariant { - f: IsCopy //~ 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 - | ^^^^^^^^^ 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 { - | ^^^^ required by this bound in `IsCopy` -help: consider restricting type parameter `A` - | -LL | enum AnotherEnum { - | +++++++++++++++++++ - -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 { - value: T -} - -enum SomeEnum { - SomeVariant(IsCopy) //~ 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) - | ^^^^^^^^^ 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 { - | ^^^^ required by this bound in `IsCopy` -help: consider restricting type parameter `A` - | -LL | enum SomeEnum { - | +++++++++++++++++++ - -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 { } - -fn foo() where T: ExtraCopy //~ ERROR E0277 -{ -} - -fn bar() where Vec:, {} -//~^ ERROR E0277 -//~| ERROR E0038 - -struct Vec { - 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() where T: ExtraCopy - | ^^^^^^^^^^^^ 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 { } - | ^^^^ required by this bound in `ExtraCopy` -help: consider further restricting type parameter `U` - | -LL | fn foo() where T: ExtraCopy, 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:, {} - | ^^^^^^^^^^^^^ 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 { - | ^ 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` - --> $DIR/wf-fn-where-clause.rs:16:12 - | -LL | struct Vec { - | ^ this could be changed to `T: ?Sized`... -LL | t: T, - | - ...if indirection were used here: `Box` - -error[E0038]: the trait `Copy` cannot be made into an object - --> $DIR/wf-fn-where-clause.rs:12:16 - | -LL | fn bar() where Vec:, {} - | ^^^^^^^^^^^^^ `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 - -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); - -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; - //~^ 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; - | ^^^^^^^^ 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); - | ^^^^^^^^^^^ 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 { - data: Vec -} - -pub trait Foo { - type Bar; -} - -impl Foo for T { - type Bar = MySet; - //~^ 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; - | ^^^^^^^^ 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 { - | ^^^^^^ required by this bound in `MySet` -help: consider restricting type parameter `T` - | -LL | impl 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 { - | ^ 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: T -} - -fn bar(_: &MustBeCopy) //~ 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(_: &MustBeCopy) - | ^^^^^^^^^^^^^ 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 { - | ^^^^ required by this bound in `MustBeCopy` -help: consider restricting type parameter `T` - | -LL | fn bar(_: &MustBeCopy) - | +++++++++++++++++++ - -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: T -} - -fn bar() -> MustBeCopy //~ 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() -> MustBeCopy - | ^^^^^^^^^^^^^ 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 { - | ^^^^ required by this bound in `MustBeCopy` -help: consider restricting type parameter `T` - | -LL | fn bar() -> MustBeCopy - | +++++++++++++++++++ - -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: T -} - -struct Bar { - // needs T: Copy - x: fn(MustBeCopy) //~ 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) - | ^^^^^^^^^^^^^ 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 { - | ^^^^ required by this bound in `MustBeCopy` -help: consider restricting type parameter `T` - | -LL | struct Bar { - | +++++++++++++++++++ - -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: T -} - -struct Foo { - // needs T: 'static - x: fn() -> MustBeCopy //~ 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 - | ^^^^^^^^^^^^^ 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 { - | ^^^^ required by this bound in `MustBeCopy` -help: consider restricting type parameter `T` - | -LL | struct Foo { - | +++++++++++++++++++ - -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: T -} - -struct Foo { - // needs T: 'static - x: fn() -> &'static T //~ ERROR E0310 -} - -struct Bar { - // 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 { - | +++++++++ - -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 { - | +++++++++ - -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 { -} - -fn bar() - where T: MustBeCopy //~ 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 - | ^^^^^^^^^^^^^ 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 { - | ^^^^ required by this bound in `MustBeCopy` -help: consider further restricting type parameter `U` - | -LL | where T: MustBeCopy, 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); - -#[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); //~ 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); - | ^^^^^^^^^^^^ - | -note: because this has an unmet lifetime requirement - --> $DIR/wf-in-foreign-fn-decls-issue-80468.rs:8:23 - | -LL | pub struct Wrapper(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); - | ^^^ -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 { } - -struct MustBeCopy { - t: T -} - -struct Foo { - // 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 { - | +++++++++ - -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 { } - -struct MustBeCopy { - t: T -} - -struct Bar { - // needs T: Copy - x: dyn Object> //~ 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> - | ^^^^^^^^^^^^^ 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 { - | ^^^^ required by this bound in `MustBeCopy` -help: consider restricting type parameter `T` - | -LL | struct Bar { - | +++++++++++++++++++ - -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 { } - -struct Foo(T,U); - -impl Foo { - fn foo(self) where T: ExtraCopy //~ 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 - | ^^^^^^^^^^^^ 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 { } - | ^^^^ required by this bound in `ExtraCopy` -help: consider restricting type parameter `U` - | -LL | impl Foo { - | +++++++++++++++++++ - -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 { } - -struct Foo(T,U); - -impl Foo where T: ExtraCopy //~ 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 Foo where T: ExtraCopy - | ^^^^^^^^^^^^ 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 { } - | ^^^^ required by this bound in `ExtraCopy` -help: consider further restricting type parameter `U` - | -LL | impl Foo where T: ExtraCopy, 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 - --> $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 { } - -impl<'a, T> Trait<'a, T> for u32 { - type Out = &'a dyn Baz; //~ 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; - | ^^^^^^^^^^^^^^ ...so that the reference type `&'a (dyn Baz + '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); -pub struct DefaultAllocator; - -pub trait Allocator { type Buffer; } - -// impl Allocator for DefaultAllocator { type Buffer = (); } - -#[repr(packed)] -struct Foo(Matrix<::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<::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 { - ::static_evil(b) - //~^ ERROR lifetime may not live long enough -} - -fn inherent_evil<'a, 'b>(b: &'b u32) -> &'a u32 { - ::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 | ::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 | ::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: T } -struct NotCopy; - -static FOO: IsCopy> = 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> = IsCopy { t: None }; - | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `NotCopy` - | - = note: required for `Option` to implement `Copy` -note: required by a bound in `IsCopy` - --> $DIR/wf-static-type.rs:7:17 - | -LL | struct IsCopy { 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 { } - -struct SomeStruct - where T: ExtraCopy //~ 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 - | ^^^^^^^^^^^^ 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 { } - | ^^^^ required by this bound in `ExtraCopy` -help: consider further restricting type parameter `U` - | -LL | where T: ExtraCopy, 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 { - value: T -} - -struct SomeStruct { - data: IsCopy //~ 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 - | ^^^^^^^^^ 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 { - | ^^^^ required by this bound in `IsCopy` -help: consider restricting type parameter `A` - | -LL | struct SomeStruct { - | +++++++++++++++++++ - -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 { } - -trait SomeTrait { - type Type1: ExtraCopy; //~ 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; - | ^^^^^^^^^^^^ 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 { } - | ^^^^ required by this bound in `ExtraCopy` -help: consider restricting type parameter `T` - | -LL | trait SomeTrait { - | +++++++++++++++++++ - -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 `>::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 `>::Type1: 'a`... - = note: ...so that the reference type `&'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 { x: T } - -trait SomeTrait { - type Type1; - type Type2 = (IsCopy, 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 `::Type1: Copy` is not satisfied - --> $DIR/wf-trait-associated-type-trait.rs:11:19 - | -LL | type Type2 = (IsCopy, bool); - | ^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `::Type1` - | -note: required by a bound in `IsCopy` - --> $DIR/wf-trait-associated-type-trait.rs:7:17 - | -LL | struct IsCopy { x: T } - | ^^^^ required by this bound in `IsCopy` -help: consider further restricting the associated type - | -LL | trait SomeTrait where ::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 { } - -trait SomeTrait - where T: ExtraCopy //~ 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 - | ^^^^^^^^^^^^ 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 { } - | ^^^^ required by this bound in `ExtraCopy` -help: consider further restricting type parameter `U` - | -LL | where T: ExtraCopy, 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 { value: Box } - -trait Foo { - fn bar(&self, x: &Bar) { - //~^ 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) { - | ^^^^^^^^^ 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 { value: Box } - | ^^ required by this bound in `Bar` -help: consider further restricting `Self` - | -LL | fn bar(&self, x: &Bar) 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 { value: Box } - -trait Foo { - fn bar(&self) -> Bar { - //~^ 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 { - | ^^^^^^^^^ 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 { value: Box } - | ^^ required by this bound in `Bar` -help: consider further restricting `Self` - | -LL | fn bar(&self) -> Bar 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 { } - -trait Foo { - fn bar(&self) where A: Bar { - //~^ 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(&self) where A: Bar { - | ^^^^^^^^^ 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 { } - | ^^ required by this bound in `Bar` -help: consider further restricting `Self` - | -LL | fn bar(&self) where A: Bar, 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 { value: Box } - -trait Foo { - fn bar(&self, x: &Bar); - //~^ 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); - | ^^^^^^^^^ 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 { value: Box } - | ^^ required by this bound in `Bar` -help: consider further restricting `Self` - | -LL | fn bar(&self, x: &Bar) 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 { value: Box } - -trait Foo { - fn bar(&self) -> &Bar; - //~^ 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; - | ^^^^^^^^^ 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 { value: Box } - | ^^ required by this bound in `Bar` -help: consider further restricting `Self` - | -LL | fn bar(&self) -> &Bar 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 { value: Box } - -trait Foo { - fn bar(&self) where Self: Sized, Bar: 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: 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 { value: Box } - | ^^ required by this bound in `Bar` -help: consider further restricting `Self` - | -LL | fn bar(&self) where Self: Sized, Bar: 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 { } - -trait SomeTrait: ExtraCopy { //~ 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: ExtraCopy { - | ^^^^^^^^^^^^ 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 { } - | ^^^^ required by this bound in `ExtraCopy` -help: consider restricting type parameter `T` - | -LL | trait SomeTrait: ExtraCopy { - | +++++++++++++++++++ - -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 - --> $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 - --> $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`. -- cgit v1.2.3