diff options
Diffstat (limited to 'src/test/ui/associated-item')
19 files changed, 0 insertions, 386 deletions
diff --git a/src/test/ui/associated-item/associated-item-duplicate-bounds.rs b/src/test/ui/associated-item/associated-item-duplicate-bounds.rs deleted file mode 100644 index 242a02353a1..00000000000 --- a/src/test/ui/associated-item/associated-item-duplicate-bounds.rs +++ /dev/null @@ -1,11 +0,0 @@ -trait Adapter { - const LINKS: usize; -} - -struct Foo<A: Adapter> { - adapter: A, - links: [u32; A::LINKS], // Shouldn't suggest bounds already there. - //~^ ERROR generic parameters may not be used in const operations -} - -fn main() {} diff --git a/src/test/ui/associated-item/associated-item-duplicate-bounds.stderr b/src/test/ui/associated-item/associated-item-duplicate-bounds.stderr deleted file mode 100644 index f2e4ca524a4..00000000000 --- a/src/test/ui/associated-item/associated-item-duplicate-bounds.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error: generic parameters may not be used in const operations - --> $DIR/associated-item-duplicate-bounds.rs:7:18 - | -LL | links: [u32; A::LINKS], // Shouldn't suggest bounds already there. - | ^^^^^^^^ cannot perform const operation using `A` - | - = note: type parameters may not be used in const expressions - = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions - -error: aborting due to previous error - diff --git a/src/test/ui/associated-item/associated-item-duplicate-names-2.rs b/src/test/ui/associated-item/associated-item-duplicate-names-2.rs deleted file mode 100644 index 550c7ae394b..00000000000 --- a/src/test/ui/associated-item/associated-item-duplicate-names-2.rs +++ /dev/null @@ -1,8 +0,0 @@ -struct Foo; - -impl Foo { - const bar: bool = true; - fn bar() {} //~ ERROR duplicate definitions -} - -fn main() {} diff --git a/src/test/ui/associated-item/associated-item-duplicate-names-2.stderr b/src/test/ui/associated-item/associated-item-duplicate-names-2.stderr deleted file mode 100644 index 0b96a6bd7c0..00000000000 --- a/src/test/ui/associated-item/associated-item-duplicate-names-2.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0592]: duplicate definitions with name `bar` - --> $DIR/associated-item-duplicate-names-2.rs:5:5 - | -LL | const bar: bool = true; - | --------------- other definition for `bar` -LL | fn bar() {} - | ^^^^^^^^ duplicate definitions for `bar` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0592`. diff --git a/src/test/ui/associated-item/associated-item-duplicate-names-3.rs b/src/test/ui/associated-item/associated-item-duplicate-names-3.rs deleted file mode 100644 index 3a70a2f943f..00000000000 --- a/src/test/ui/associated-item/associated-item-duplicate-names-3.rs +++ /dev/null @@ -1,20 +0,0 @@ -// -// Before the introduction of the "duplicate associated type" error, the -// program below used to result in the "ambiguous associated type" error E0223, -// which is unexpected. - -trait Foo { - type Bar; -} - -struct Baz; - -impl Foo for Baz { - type Bar = i16; - type Bar = u16; //~ ERROR duplicate definitions -} - -fn main() { - let x: Baz::Bar = 5; - //~^ ERROR ambiguous associated type -} diff --git a/src/test/ui/associated-item/associated-item-duplicate-names-3.stderr b/src/test/ui/associated-item/associated-item-duplicate-names-3.stderr deleted file mode 100644 index bf4bd634cf1..00000000000 --- a/src/test/ui/associated-item/associated-item-duplicate-names-3.stderr +++ /dev/null @@ -1,21 +0,0 @@ -error[E0201]: duplicate definitions with name `Bar`: - --> $DIR/associated-item-duplicate-names-3.rs:14:5 - | -LL | type Bar; - | --------- item in trait -... -LL | type Bar = i16; - | --------------- previous definition here -LL | type Bar = u16; - | ^^^^^^^^^^^^^^^ duplicate definition - -error[E0223]: ambiguous associated type - --> $DIR/associated-item-duplicate-names-3.rs:18:12 - | -LL | let x: Baz::Bar = 5; - | ^^^^^^^^ help: use fully-qualified syntax: `<Baz as Trait>::Bar` - -error: aborting due to 2 previous errors - -Some errors have detailed explanations: E0201, E0223. -For more information about an error, try `rustc --explain E0201`. diff --git a/src/test/ui/associated-item/associated-item-duplicate-names.rs b/src/test/ui/associated-item/associated-item-duplicate-names.rs deleted file mode 100644 index 6677fad6876..00000000000 --- a/src/test/ui/associated-item/associated-item-duplicate-names.rs +++ /dev/null @@ -1,19 +0,0 @@ -// Test for issue #23969 - - -trait Foo { - type Ty; - const BAR: u32; -} - -impl Foo for () { - type Ty = (); - type Ty = usize; //~ ERROR duplicate definitions - const BAR: u32 = 7; - const BAR: u32 = 8; //~ ERROR duplicate definitions -} - -fn main() { - let _: <() as Foo>::Ty = (); - let _: u32 = <() as Foo>::BAR; -} diff --git a/src/test/ui/associated-item/associated-item-duplicate-names.stderr b/src/test/ui/associated-item/associated-item-duplicate-names.stderr deleted file mode 100644 index f89ea6e57cc..00000000000 --- a/src/test/ui/associated-item/associated-item-duplicate-names.stderr +++ /dev/null @@ -1,25 +0,0 @@ -error[E0201]: duplicate definitions with name `Ty`: - --> $DIR/associated-item-duplicate-names.rs:11:5 - | -LL | type Ty; - | -------- item in trait -... -LL | type Ty = (); - | ------------- previous definition here -LL | type Ty = usize; - | ^^^^^^^^^^^^^^^^ duplicate definition - -error[E0201]: duplicate definitions with name `BAR`: - --> $DIR/associated-item-duplicate-names.rs:13:5 - | -LL | const BAR: u32; - | --------------- item in trait -... -LL | const BAR: u32 = 7; - | ------------------- previous definition here -LL | const BAR: u32 = 8; - | ^^^^^^^^^^^^^^^^^^^ duplicate definition - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0201`. diff --git a/src/test/ui/associated-item/associated-item-enum.rs b/src/test/ui/associated-item/associated-item-enum.rs deleted file mode 100644 index 30ba258155b..00000000000 --- a/src/test/ui/associated-item/associated-item-enum.rs +++ /dev/null @@ -1,20 +0,0 @@ -enum Enum { Variant } - -impl Enum { - const MISSPELLABLE: i32 = 0; - fn misspellable() {} -} - -trait Trait { - fn misspellable_trait() {} -} - -impl Trait for Enum { - fn misspellable_trait() {} -} - -fn main() { - Enum::mispellable(); //~ ERROR no variant or associated item - Enum::mispellable_trait(); //~ ERROR no variant or associated item - Enum::MISPELLABLE; //~ ERROR no variant or associated item -} diff --git a/src/test/ui/associated-item/associated-item-enum.stderr b/src/test/ui/associated-item/associated-item-enum.stderr deleted file mode 100644 index ebf3c5499a6..00000000000 --- a/src/test/ui/associated-item/associated-item-enum.stderr +++ /dev/null @@ -1,39 +0,0 @@ -error[E0599]: no variant or associated item named `mispellable` found for enum `Enum` in the current scope - --> $DIR/associated-item-enum.rs:17:11 - | -LL | enum Enum { Variant } - | --------- variant or associated item `mispellable` not found for this enum -... -LL | Enum::mispellable(); - | ^^^^^^^^^^^ - | | - | variant or associated item not found in `Enum` - | help: there is an associated function with a similar name: `misspellable` - -error[E0599]: no variant or associated item named `mispellable_trait` found for enum `Enum` in the current scope - --> $DIR/associated-item-enum.rs:18:11 - | -LL | enum Enum { Variant } - | --------- variant or associated item `mispellable_trait` not found for this enum -... -LL | Enum::mispellable_trait(); - | ^^^^^^^^^^^^^^^^^ - | | - | variant or associated item not found in `Enum` - | help: there is an associated function with a similar name: `misspellable` - -error[E0599]: no variant or associated item named `MISPELLABLE` found for enum `Enum` in the current scope - --> $DIR/associated-item-enum.rs:19:11 - | -LL | enum Enum { Variant } - | --------- variant or associated item `MISPELLABLE` not found for this enum -... -LL | Enum::MISPELLABLE; - | ^^^^^^^^^^^ - | | - | variant or associated item not found in `Enum` - | help: there is an associated constant with a similar name: `MISSPELLABLE` - -error: aborting due to 3 previous errors - -For more information about this error, try `rustc --explain E0599`. diff --git a/src/test/ui/associated-item/associated-item-two-bounds.rs b/src/test/ui/associated-item/associated-item-two-bounds.rs deleted file mode 100644 index 25b0d5a56bf..00000000000 --- a/src/test/ui/associated-item/associated-item-two-bounds.rs +++ /dev/null @@ -1,16 +0,0 @@ -// This test is a regression test for #34792 - -// check-pass - -pub struct A; -pub struct B; - -pub trait Foo { - type T: PartialEq<A> + PartialEq<B>; -} - -pub fn generic<F: Foo>(t: F::T, a: A, b: B) -> bool { - t == a && t == b -} - -pub fn main() {} diff --git a/src/test/ui/associated-item/impl-duplicate-methods.rs b/src/test/ui/associated-item/impl-duplicate-methods.rs deleted file mode 100644 index 328d54d5ac4..00000000000 --- a/src/test/ui/associated-item/impl-duplicate-methods.rs +++ /dev/null @@ -1,9 +0,0 @@ -struct Foo; - -impl Foo { - fn orange(&self) {} - fn orange(&self) {} - //~^ ERROR duplicate definitions with name `orange` [E0592] -} - -fn main() {} diff --git a/src/test/ui/associated-item/impl-duplicate-methods.stderr b/src/test/ui/associated-item/impl-duplicate-methods.stderr deleted file mode 100644 index 6f753845ac8..00000000000 --- a/src/test/ui/associated-item/impl-duplicate-methods.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0592]: duplicate definitions with name `orange` - --> $DIR/impl-duplicate-methods.rs:5:5 - | -LL | fn orange(&self) {} - | ---------------- other definition for `orange` -LL | fn orange(&self) {} - | ^^^^^^^^^^^^^^^^ duplicate definitions for `orange` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0592`. diff --git a/src/test/ui/associated-item/issue-105449.rs b/src/test/ui/associated-item/issue-105449.rs deleted file mode 100644 index dd14e05fd49..00000000000 --- a/src/test/ui/associated-item/issue-105449.rs +++ /dev/null @@ -1,59 +0,0 @@ -// check-pass -// compile-flags: -C debug_assertions=yes -Zunstable-options - -#[allow(dead_code)] -fn problematic_function<Space>() -where - DefaultAlloc: FinAllok<R1, Space>, -{ - let e = Edge2dElement; - let _ = Into::<Point>::into(e.map_reference_coords()); -} -impl<N> Allocator<N, R0> for DefaultAlloc { - type Buffer = MStorage; -} -impl<N> Allocator<N, R1> for DefaultAlloc { - type Buffer = MStorage; -} -impl<N, D> From<VectorN<N, D>> for Point -where - DefaultAlloc: Allocator<N, D>, -{ - fn from(_: VectorN<N, D>) -> Self { - unimplemented!() - } -} -impl<GeometryDim, NodalDim> FinAllok<GeometryDim, NodalDim> for DefaultAlloc -where - DefaultAlloc: Allocator<Ure, GeometryDim>, - DefaultAlloc: Allocator<Ure, NodalDim> -{ -} -impl FiniteElement<R1> for Edge2dElement { - fn map_reference_coords(&self) -> VectorN<Ure, R1> { - unimplemented!() - } -} -type VectorN<N, R> = (N, R, <DefaultAlloc as Allocator<N, R>>::Buffer); -struct DefaultAlloc; -struct R0; -struct R1; -struct MStorage; -struct Point; -struct Edge2dElement; -struct Ure; -trait Allocator<N, R> { - type Buffer; -} -trait FinAllok<GeometryDim, NodalDim>: - Allocator<Ure, GeometryDim> + - Allocator<Ure, NodalDim> + -{ -} -trait FiniteElement<Rau> -where - DefaultAlloc: FinAllok<Rau, Rau>, -{ - fn map_reference_coords(&self) -> VectorN<Ure, Rau>; -} -fn main() {} diff --git a/src/test/ui/associated-item/issue-48027.rs b/src/test/ui/associated-item/issue-48027.rs deleted file mode 100644 index d2b51184c99..00000000000 --- a/src/test/ui/associated-item/issue-48027.rs +++ /dev/null @@ -1,8 +0,0 @@ -trait Bar { - const X: usize; - fn return_n(&self) -> [u8; Bar::X]; //~ ERROR: E0790 -} - -impl dyn Bar {} //~ ERROR: the trait `Bar` cannot be made into an object - -fn main() {} diff --git a/src/test/ui/associated-item/issue-48027.stderr b/src/test/ui/associated-item/issue-48027.stderr deleted file mode 100644 index 45ea419336b..00000000000 --- a/src/test/ui/associated-item/issue-48027.stderr +++ /dev/null @@ -1,27 +0,0 @@ -error[E0038]: the trait `Bar` cannot be made into an object - --> $DIR/issue-48027.rs:6:6 - | -LL | impl dyn Bar {} - | ^^^^^^^ `Bar` 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-48027.rs:2:11 - | -LL | trait Bar { - | --- this trait cannot be made into an object... -LL | const X: usize; - | ^ ...because it contains this associated `const` - = help: consider moving `X` to another trait - -error[E0790]: cannot refer to the associated constant on trait without specifying the corresponding `impl` type - --> $DIR/issue-48027.rs:3:32 - | -LL | const X: usize; - | --------------- `Bar::X` defined here -LL | fn return_n(&self) -> [u8; Bar::X]; - | ^^^^^^ cannot refer to the associated constant of trait - -error: aborting due to 2 previous errors - -Some errors have detailed explanations: E0038, E0790. -For more information about an error, try `rustc --explain E0038`. diff --git a/src/test/ui/associated-item/issue-87638.fixed b/src/test/ui/associated-item/issue-87638.fixed deleted file mode 100644 index b689777685f..00000000000 --- a/src/test/ui/associated-item/issue-87638.fixed +++ /dev/null @@ -1,22 +0,0 @@ -// run-rustfix - -trait Trait { - const FOO: usize; - - type Target; -} - -struct S; - -impl Trait for S { - const FOO: usize = 0; - type Target = (); -} - -fn main() { - let _: <S as Trait>::Target; //~ ERROR cannot find associated type `Output` in trait `Trait` - //~^ HELP maybe you meant this associated type - - let _ = <S as Trait>::FOO; //~ ERROR cannot find method or associated constant `BAR` in trait `Trait` - //~^ HELP maybe you meant this associated constant -} diff --git a/src/test/ui/associated-item/issue-87638.rs b/src/test/ui/associated-item/issue-87638.rs deleted file mode 100644 index 5a60b20fdf3..00000000000 --- a/src/test/ui/associated-item/issue-87638.rs +++ /dev/null @@ -1,22 +0,0 @@ -// run-rustfix - -trait Trait { - const FOO: usize; - - type Target; -} - -struct S; - -impl Trait for S { - const FOO: usize = 0; - type Target = (); -} - -fn main() { - let _: <S as Trait>::Output; //~ ERROR cannot find associated type `Output` in trait `Trait` - //~^ HELP maybe you meant this associated type - - let _ = <S as Trait>::BAR; //~ ERROR cannot find method or associated constant `BAR` in trait `Trait` - //~^ HELP maybe you meant this associated constant -} diff --git a/src/test/ui/associated-item/issue-87638.stderr b/src/test/ui/associated-item/issue-87638.stderr deleted file mode 100644 index cf6083444b0..00000000000 --- a/src/test/ui/associated-item/issue-87638.stderr +++ /dev/null @@ -1,27 +0,0 @@ -error[E0576]: cannot find associated type `Output` in trait `Trait` - --> $DIR/issue-87638.rs:17:26 - | -LL | type Target; - | ------------ associated type `Target` defined here -... -LL | let _: <S as Trait>::Output; - | ^^^^^^ - | | - | not found in `Trait` - | help: maybe you meant this associated type: `Target` - -error[E0576]: cannot find method or associated constant `BAR` in trait `Trait` - --> $DIR/issue-87638.rs:20:27 - | -LL | const FOO: usize; - | ----------------- associated constant `FOO` defined here -... -LL | let _ = <S as Trait>::BAR; - | ^^^ - | | - | not found in `Trait` - | help: maybe you meant this associated constant: `FOO` - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0576`. |
