diff options
Diffstat (limited to 'src/test/ui/on-unimplemented')
23 files changed, 0 insertions, 709 deletions
diff --git a/src/test/ui/on-unimplemented/auxiliary/no_debug.rs b/src/test/ui/on-unimplemented/auxiliary/no_debug.rs deleted file mode 100644 index fd3dc0abd..000000000 --- a/src/test/ui/on-unimplemented/auxiliary/no_debug.rs +++ /dev/null @@ -1,3 +0,0 @@ -#![crate_type = "lib"] - -pub struct Bar; diff --git a/src/test/ui/on-unimplemented/bad-annotation.rs b/src/test/ui/on-unimplemented/bad-annotation.rs deleted file mode 100644 index f05436b8c..000000000 --- a/src/test/ui/on-unimplemented/bad-annotation.rs +++ /dev/null @@ -1,64 +0,0 @@ -// ignore-tidy-linelength - -#![feature(rustc_attrs)] - -#![allow(unused)] - -#[rustc_on_unimplemented = "test error `{Self}` with `{Bar}` `{Baz}` `{Quux}`"] -trait Foo<Bar, Baz, Quux> -{} - -#[rustc_on_unimplemented="a collection of type `{Self}` cannot be built from an iterator over elements of type `{A}`"] -trait MyFromIterator<A> { - /// Builds a container with elements from an external iterator. - fn my_from_iter<T: Iterator<Item=A>>(iterator: T) -> Self; -} - -#[rustc_on_unimplemented] -//~^ ERROR malformed `rustc_on_unimplemented` attribute -trait BadAnnotation1 -{} - -#[rustc_on_unimplemented = "Unimplemented trait error on `{Self}` with params `<{A},{B},{C}>`"] -//~^ ERROR there is no parameter `C` on trait `BadAnnotation2` -trait BadAnnotation2<A,B> -{} - -#[rustc_on_unimplemented = "Unimplemented trait error on `{Self}` with params `<{A},{B},{}>`"] -//~^ only named substitution parameters are allowed -trait BadAnnotation3<A,B> -{} - -#[rustc_on_unimplemented(lorem="")] -//~^ this attribute must have a valid -trait BadAnnotation4 {} - -#[rustc_on_unimplemented(lorem(ipsum(dolor)))] -//~^ this attribute must have a valid -trait BadAnnotation5 {} - -#[rustc_on_unimplemented(message="x", message="y")] -//~^ this attribute must have a valid -trait BadAnnotation6 {} - -#[rustc_on_unimplemented(message="x", on(desugared, message="y"))] -//~^ this attribute must have a valid -trait BadAnnotation7 {} - -#[rustc_on_unimplemented(on(), message="y")] -//~^ empty `on`-clause -trait BadAnnotation8 {} - -#[rustc_on_unimplemented(on="x", message="y")] -//~^ this attribute must have a valid -trait BadAnnotation9 {} - -#[rustc_on_unimplemented(on(x="y"), message="y")] -trait BadAnnotation10 {} - -#[rustc_on_unimplemented(on(desugared, on(desugared, message="x")), message="y")] -//~^ this attribute must have a valid -trait BadAnnotation11 {} - -pub fn main() { -} diff --git a/src/test/ui/on-unimplemented/bad-annotation.stderr b/src/test/ui/on-unimplemented/bad-annotation.stderr deleted file mode 100644 index a8d3c8680..000000000 --- a/src/test/ui/on-unimplemented/bad-annotation.stderr +++ /dev/null @@ -1,83 +0,0 @@ -error: malformed `rustc_on_unimplemented` attribute input - --> $DIR/bad-annotation.rs:17:1 - | -LL | #[rustc_on_unimplemented] - | ^^^^^^^^^^^^^^^^^^^^^^^^^ - | -help: the following are the possible correct uses - | -LL | #[rustc_on_unimplemented = "message"] - | -LL | #[rustc_on_unimplemented(/*opt*/ message = "...", /*opt*/ label = "...", /*opt*/ note = "...")] - | - -error[E0230]: there is no parameter `C` on trait `BadAnnotation2` - --> $DIR/bad-annotation.rs:22:1 - | -LL | #[rustc_on_unimplemented = "Unimplemented trait error on `{Self}` with params `<{A},{B},{C}>`"] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error[E0231]: only named substitution parameters are allowed - --> $DIR/bad-annotation.rs:27:1 - | -LL | #[rustc_on_unimplemented = "Unimplemented trait error on `{Self}` with params `<{A},{B},{}>`"] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error[E0232]: this attribute must have a valid value - --> $DIR/bad-annotation.rs:32:26 - | -LL | #[rustc_on_unimplemented(lorem="")] - | ^^^^^^^^ expected value here - | - = note: eg `#[rustc_on_unimplemented(message="foo")]` - -error[E0232]: this attribute must have a valid value - --> $DIR/bad-annotation.rs:36:26 - | -LL | #[rustc_on_unimplemented(lorem(ipsum(dolor)))] - | ^^^^^^^^^^^^^^^^^^^ expected value here - | - = note: eg `#[rustc_on_unimplemented(message="foo")]` - -error[E0232]: this attribute must have a valid value - --> $DIR/bad-annotation.rs:40:39 - | -LL | #[rustc_on_unimplemented(message="x", message="y")] - | ^^^^^^^^^^^ expected value here - | - = note: eg `#[rustc_on_unimplemented(message="foo")]` - -error[E0232]: this attribute must have a valid value - --> $DIR/bad-annotation.rs:44:39 - | -LL | #[rustc_on_unimplemented(message="x", on(desugared, message="y"))] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected value here - | - = note: eg `#[rustc_on_unimplemented(message="foo")]` - -error[E0232]: empty `on`-clause in `#[rustc_on_unimplemented]` - --> $DIR/bad-annotation.rs:48:26 - | -LL | #[rustc_on_unimplemented(on(), message="y")] - | ^^^^ empty on-clause here - -error[E0232]: this attribute must have a valid value - --> $DIR/bad-annotation.rs:52:26 - | -LL | #[rustc_on_unimplemented(on="x", message="y")] - | ^^^^^^ expected value here - | - = note: eg `#[rustc_on_unimplemented(message="foo")]` - -error[E0232]: this attribute must have a valid value - --> $DIR/bad-annotation.rs:59:40 - | -LL | #[rustc_on_unimplemented(on(desugared, on(desugared, message="x")), message="y")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected value here - | - = note: eg `#[rustc_on_unimplemented(message="foo")]` - -error: aborting due to 10 previous errors - -Some errors have detailed explanations: E0230, E0231, E0232. -For more information about an error, try `rustc --explain E0230`. diff --git a/src/test/ui/on-unimplemented/expected-comma-found-token.rs b/src/test/ui/on-unimplemented/expected-comma-found-token.rs deleted file mode 100644 index 8fb34f211..000000000 --- a/src/test/ui/on-unimplemented/expected-comma-found-token.rs +++ /dev/null @@ -1,13 +0,0 @@ -// Tests that two closures cannot simultaneously have mutable -// access to the variable, whether that mutable access be used -// for direct assignment or for taking mutable ref. Issue #6801. - -#![feature(rustc_attrs)] - -#[rustc_on_unimplemented( - message="the message" - label="the label" //~ ERROR expected `,`, found `label` -)] -trait T {} - -fn main() { } diff --git a/src/test/ui/on-unimplemented/expected-comma-found-token.stderr b/src/test/ui/on-unimplemented/expected-comma-found-token.stderr deleted file mode 100644 index 048b72ee3..000000000 --- a/src/test/ui/on-unimplemented/expected-comma-found-token.stderr +++ /dev/null @@ -1,10 +0,0 @@ -error: expected `,`, found `label` - --> $DIR/expected-comma-found-token.rs:9:5 - | -LL | message="the message" - | - expected `,` -LL | label="the label" - | ^^^^^ unexpected token - -error: aborting due to previous error - diff --git a/src/test/ui/on-unimplemented/feature-gate-on-unimplemented.rs b/src/test/ui/on-unimplemented/feature-gate-on-unimplemented.rs deleted file mode 100644 index 3cc50e349..000000000 --- a/src/test/ui/on-unimplemented/feature-gate-on-unimplemented.rs +++ /dev/null @@ -1,8 +0,0 @@ -// Test that `#[rustc_on_unimplemented]` is gated by `rustc_attrs` feature gate. - -#[rustc_on_unimplemented = "test error `{Self}` with `{Bar}`"] -//~^ ERROR this is an internal attribute that will never be stable -trait Foo<Bar> -{} - -fn main() {} diff --git a/src/test/ui/on-unimplemented/feature-gate-on-unimplemented.stderr b/src/test/ui/on-unimplemented/feature-gate-on-unimplemented.stderr deleted file mode 100644 index a4b33963f..000000000 --- a/src/test/ui/on-unimplemented/feature-gate-on-unimplemented.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0658]: this is an internal attribute that will never be stable - --> $DIR/feature-gate-on-unimplemented.rs:3:1 - | -LL | #[rustc_on_unimplemented = "test error `{Self}` with `{Bar}`"] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: add `#![feature(rustc_attrs)]` to the crate attributes to enable - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/on-unimplemented/impl-substs.rs b/src/test/ui/on-unimplemented/impl-substs.rs deleted file mode 100644 index fe9c50ec3..000000000 --- a/src/test/ui/on-unimplemented/impl-substs.rs +++ /dev/null @@ -1,15 +0,0 @@ -#![feature(rustc_attrs)] - -trait Foo<A> { - fn foo(self); -} - -#[rustc_on_unimplemented = "an impl did not match: {A} {B} {C}"] -impl<A, B, C> Foo<A> for (A, B, C) { - fn foo(self) {} -} - -fn main() { - Foo::<usize>::foo((1i32, 1i32, 1i32)); - //~^ ERROR the trait bound `(i32, i32, i32): Foo<usize>` is not satisfied -} diff --git a/src/test/ui/on-unimplemented/impl-substs.stderr b/src/test/ui/on-unimplemented/impl-substs.stderr deleted file mode 100644 index a0fad0acd..000000000 --- a/src/test/ui/on-unimplemented/impl-substs.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0277]: the trait bound `(i32, i32, i32): Foo<usize>` is not satisfied - --> $DIR/impl-substs.rs:13:23 - | -LL | Foo::<usize>::foo((1i32, 1i32, 1i32)); - | ----------------- ^^^^^^^^^^^^^^^^^^ an impl did not match: usize _ _ - | | - | required by a bound introduced by this call - | - = help: the trait `Foo<usize>` is not implemented for `(i32, i32, i32)` - = help: the trait `Foo<A>` is implemented for `(A, B, C)` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/on-unimplemented/issue-104140.rs b/src/test/ui/on-unimplemented/issue-104140.rs deleted file mode 100644 index ade3f7270..000000000 --- a/src/test/ui/on-unimplemented/issue-104140.rs +++ /dev/null @@ -1,8 +0,0 @@ -#![feature(rustc_attrs)] - -trait Foo {} - -#[rustc_on_unimplemented] //~ ERROR malformed `rustc_on_unimplemented` attribute input -impl Foo for u32 {} - -fn main() {} diff --git a/src/test/ui/on-unimplemented/issue-104140.stderr b/src/test/ui/on-unimplemented/issue-104140.stderr deleted file mode 100644 index ddb1f50f0..000000000 --- a/src/test/ui/on-unimplemented/issue-104140.stderr +++ /dev/null @@ -1,15 +0,0 @@ -error: malformed `rustc_on_unimplemented` attribute input - --> $DIR/issue-104140.rs:5:1 - | -LL | #[rustc_on_unimplemented] - | ^^^^^^^^^^^^^^^^^^^^^^^^^ - | -help: the following are the possible correct uses - | -LL | #[rustc_on_unimplemented = "message"] - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -LL | #[rustc_on_unimplemented(/*opt*/ message = "...", /*opt*/ label = "...", /*opt*/ note = "...")] - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -error: aborting due to previous error - diff --git a/src/test/ui/on-unimplemented/multiple-impls.rs b/src/test/ui/on-unimplemented/multiple-impls.rs deleted file mode 100644 index a32fd4566..000000000 --- a/src/test/ui/on-unimplemented/multiple-impls.rs +++ /dev/null @@ -1,45 +0,0 @@ -// Test if the on_unimplemented message override works - -#![feature(rustc_attrs)] - - -struct Foo<T>(T); -struct Bar<T>(T); - -#[rustc_on_unimplemented = "trait message"] -trait Index<Idx: ?Sized> { - type Output: ?Sized; - fn index(&self, index: Idx) -> &Self::Output; -} - -#[rustc_on_unimplemented = "on impl for Foo"] -impl Index<Foo<usize>> for [i32] { - type Output = i32; - fn index(&self, _index: Foo<usize>) -> &i32 { - loop {} - } -} - -#[rustc_on_unimplemented = "on impl for Bar"] -impl Index<Bar<usize>> for [i32] { - type Output = i32; - fn index(&self, _index: Bar<usize>) -> &i32 { - loop {} - } -} - - -fn main() { - Index::index(&[] as &[i32], 2u32); - //~^ ERROR E0277 - //~| ERROR E0277 - //~| ERROR E0277 - Index::index(&[] as &[i32], Foo(2u32)); - //~^ ERROR E0277 - //~| ERROR E0277 - //~| ERROR E0277 - Index::index(&[] as &[i32], Bar(2u32)); - //~^ ERROR E0277 - //~| ERROR E0277 - //~| ERROR E0277 -} diff --git a/src/test/ui/on-unimplemented/multiple-impls.stderr b/src/test/ui/on-unimplemented/multiple-impls.stderr deleted file mode 100644 index d628b159a..000000000 --- a/src/test/ui/on-unimplemented/multiple-impls.stderr +++ /dev/null @@ -1,108 +0,0 @@ -error[E0277]: the trait bound `[i32]: Index<u32>` is not satisfied - --> $DIR/multiple-impls.rs:33:33 - | -LL | Index::index(&[] as &[i32], 2u32); - | ------------ ^^^^ trait message - | | - | required by a bound introduced by this call - | - = help: the trait `Index<u32>` is not implemented for `[i32]` - = help: the following other types implement trait `Index<Idx>`: - <[i32] as Index<Bar<usize>>> - <[i32] as Index<Foo<usize>>> - -error[E0277]: the trait bound `[i32]: Index<u32>` is not satisfied - --> $DIR/multiple-impls.rs:33:5 - | -LL | Index::index(&[] as &[i32], 2u32); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trait message - | - = help: the trait `Index<u32>` is not implemented for `[i32]` - = help: the following other types implement trait `Index<Idx>`: - <[i32] as Index<Bar<usize>>> - <[i32] as Index<Foo<usize>>> - -error[E0277]: the trait bound `[i32]: Index<Foo<u32>>` is not satisfied - --> $DIR/multiple-impls.rs:37:33 - | -LL | Index::index(&[] as &[i32], Foo(2u32)); - | ------------ ^^^^^^^^^ on impl for Foo - | | - | required by a bound introduced by this call - | - = help: the trait `Index<Foo<u32>>` is not implemented for `[i32]` - = help: the following other types implement trait `Index<Idx>`: - <[i32] as Index<Bar<usize>>> - <[i32] as Index<Foo<usize>>> - -error[E0277]: the trait bound `[i32]: Index<Foo<u32>>` is not satisfied - --> $DIR/multiple-impls.rs:37:5 - | -LL | Index::index(&[] as &[i32], Foo(2u32)); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ on impl for Foo - | - = help: the trait `Index<Foo<u32>>` is not implemented for `[i32]` - = help: the following other types implement trait `Index<Idx>`: - <[i32] as Index<Bar<usize>>> - <[i32] as Index<Foo<usize>>> - -error[E0277]: the trait bound `[i32]: Index<Bar<u32>>` is not satisfied - --> $DIR/multiple-impls.rs:41:33 - | -LL | Index::index(&[] as &[i32], Bar(2u32)); - | ------------ ^^^^^^^^^ on impl for Bar - | | - | required by a bound introduced by this call - | - = help: the trait `Index<Bar<u32>>` is not implemented for `[i32]` - = help: the following other types implement trait `Index<Idx>`: - <[i32] as Index<Bar<usize>>> - <[i32] as Index<Foo<usize>>> - -error[E0277]: the trait bound `[i32]: Index<Bar<u32>>` is not satisfied - --> $DIR/multiple-impls.rs:41:5 - | -LL | Index::index(&[] as &[i32], Bar(2u32)); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ on impl for Bar - | - = help: the trait `Index<Bar<u32>>` is not implemented for `[i32]` - = help: the following other types implement trait `Index<Idx>`: - <[i32] as Index<Bar<usize>>> - <[i32] as Index<Foo<usize>>> - -error[E0277]: the trait bound `[i32]: Index<u32>` is not satisfied - --> $DIR/multiple-impls.rs:33:5 - | -LL | Index::index(&[] as &[i32], 2u32); - | ^^^^^^^^^^^^ trait message - | - = help: the trait `Index<u32>` is not implemented for `[i32]` - = help: the following other types implement trait `Index<Idx>`: - <[i32] as Index<Bar<usize>>> - <[i32] as Index<Foo<usize>>> - -error[E0277]: the trait bound `[i32]: Index<Foo<u32>>` is not satisfied - --> $DIR/multiple-impls.rs:37:5 - | -LL | Index::index(&[] as &[i32], Foo(2u32)); - | ^^^^^^^^^^^^ on impl for Foo - | - = help: the trait `Index<Foo<u32>>` is not implemented for `[i32]` - = help: the following other types implement trait `Index<Idx>`: - <[i32] as Index<Bar<usize>>> - <[i32] as Index<Foo<usize>>> - -error[E0277]: the trait bound `[i32]: Index<Bar<u32>>` is not satisfied - --> $DIR/multiple-impls.rs:41:5 - | -LL | Index::index(&[] as &[i32], Bar(2u32)); - | ^^^^^^^^^^^^ on impl for Bar - | - = help: the trait `Index<Bar<u32>>` is not implemented for `[i32]` - = help: the following other types implement trait `Index<Idx>`: - <[i32] as Index<Bar<usize>>> - <[i32] as Index<Foo<usize>>> - -error: aborting due to 9 previous errors - -For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/on-unimplemented/no-debug.rs b/src/test/ui/on-unimplemented/no-debug.rs deleted file mode 100644 index bdc80c5b3..000000000 --- a/src/test/ui/on-unimplemented/no-debug.rs +++ /dev/null @@ -1,16 +0,0 @@ -// aux-build:no_debug.rs - -extern crate no_debug; - -use no_debug::Bar; - -struct Foo; - -fn main() { - println!("{:?} {:?}", Foo, Bar); - println!("{} {}", Foo, Bar); -} -//~^^^ ERROR `Foo` doesn't implement `Debug` -//~| ERROR `Bar` doesn't implement `Debug` -//~^^^^ ERROR `Foo` doesn't implement `std::fmt::Display` -//~| ERROR `Bar` doesn't implement `std::fmt::Display` diff --git a/src/test/ui/on-unimplemented/no-debug.stderr b/src/test/ui/on-unimplemented/no-debug.stderr deleted file mode 100644 index 1035da54d..000000000 --- a/src/test/ui/on-unimplemented/no-debug.stderr +++ /dev/null @@ -1,46 +0,0 @@ -error[E0277]: `Foo` doesn't implement `Debug` - --> $DIR/no-debug.rs:10:27 - | -LL | println!("{:?} {:?}", Foo, Bar); - | ^^^ `Foo` cannot be formatted using `{:?}` - | - = help: the trait `Debug` is not implemented for `Foo` - = note: add `#[derive(Debug)]` to `Foo` or manually `impl Debug for Foo` - = note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info) -help: consider annotating `Foo` with `#[derive(Debug)]` - | -LL | #[derive(Debug)] - | - -error[E0277]: `Bar` doesn't implement `Debug` - --> $DIR/no-debug.rs:10:32 - | -LL | println!("{:?} {:?}", Foo, Bar); - | ^^^ `Bar` cannot be formatted using `{:?}` because it doesn't implement `Debug` - | - = help: the trait `Debug` is not implemented for `Bar` - = note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info) - -error[E0277]: `Foo` doesn't implement `std::fmt::Display` - --> $DIR/no-debug.rs:11:23 - | -LL | println!("{} {}", Foo, Bar); - | ^^^ `Foo` cannot be formatted with the default formatter - | - = help: the trait `std::fmt::Display` is not implemented for `Foo` - = note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead - = note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info) - -error[E0277]: `Bar` doesn't implement `std::fmt::Display` - --> $DIR/no-debug.rs:11:28 - | -LL | println!("{} {}", Foo, Bar); - | ^^^ `Bar` cannot be formatted with the default formatter - | - = help: the trait `std::fmt::Display` is not implemented for `Bar` - = note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead - = note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: aborting due to 4 previous errors - -For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/on-unimplemented/on-impl.rs b/src/test/ui/on-unimplemented/on-impl.rs deleted file mode 100644 index d0537810c..000000000 --- a/src/test/ui/on-unimplemented/on-impl.rs +++ /dev/null @@ -1,26 +0,0 @@ -// Test if the on_unimplemented message override works - -#![feature(rustc_attrs)] - - -#[rustc_on_unimplemented = "invalid"] -trait Index<Idx: ?Sized> { - type Output: ?Sized; - fn index(&self, index: Idx) -> &Self::Output; -} - -#[rustc_on_unimplemented = "a usize is required to index into a slice"] -impl Index<usize> for [i32] { - type Output = i32; - fn index(&self, index: usize) -> &i32 { - &self[index] - } -} - - -fn main() { - Index::<u32>::index(&[1, 2, 3] as &[i32], 2u32); - //~^ ERROR E0277 - //~| ERROR E0277 - //~| ERROR E0277 -} diff --git a/src/test/ui/on-unimplemented/on-impl.stderr b/src/test/ui/on-unimplemented/on-impl.stderr deleted file mode 100644 index 2253c5992..000000000 --- a/src/test/ui/on-unimplemented/on-impl.stderr +++ /dev/null @@ -1,32 +0,0 @@ -error[E0277]: the trait bound `[i32]: Index<u32>` is not satisfied - --> $DIR/on-impl.rs:22:47 - | -LL | Index::<u32>::index(&[1, 2, 3] as &[i32], 2u32); - | ------------------- ^^^^ a usize is required to index into a slice - | | - | required by a bound introduced by this call - | - = help: the trait `Index<u32>` is not implemented for `[i32]` - = help: the trait `Index<usize>` is implemented for `[i32]` - -error[E0277]: the trait bound `[i32]: Index<u32>` is not satisfied - --> $DIR/on-impl.rs:22:5 - | -LL | Index::<u32>::index(&[1, 2, 3] as &[i32], 2u32); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ a usize is required to index into a slice - | - = help: the trait `Index<u32>` is not implemented for `[i32]` - = help: the trait `Index<usize>` is implemented for `[i32]` - -error[E0277]: the trait bound `[i32]: Index<u32>` is not satisfied - --> $DIR/on-impl.rs:22:5 - | -LL | Index::<u32>::index(&[1, 2, 3] as &[i32], 2u32); - | ^^^^^^^^^^^^^^^^^^^ a usize is required to index into a slice - | - = help: the trait `Index<u32>` is not implemented for `[i32]` - = help: the trait `Index<usize>` is implemented for `[i32]` - -error: aborting due to 3 previous errors - -For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/on-unimplemented/on-trait.rs b/src/test/ui/on-unimplemented/on-trait.rs deleted file mode 100644 index 556813cd4..000000000 --- a/src/test/ui/on-unimplemented/on-trait.rs +++ /dev/null @@ -1,32 +0,0 @@ -// ignore-tidy-linelength - -#![feature(rustc_attrs)] - -pub mod Bar { - #[rustc_on_unimplemented = "test error `{Self}` with `{Bar}` `{Baz}` `{Quux}` in `{Foo}`"] - pub trait Foo<Bar, Baz, Quux> {} -} - -use Bar::Foo; - -fn foobar<U: Clone, T: Foo<u8, U, u32>>() -> T { - panic!() -} - -#[rustc_on_unimplemented="a collection of type `{Self}` cannot be built from an iterator over elements of type `{A}`"] -trait MyFromIterator<A> { - /// Builds a container with elements from an external iterator. - fn my_from_iter<T: Iterator<Item=A>>(iterator: T) -> Self; -} - -fn collect<A, I: Iterator<Item=A>, B: MyFromIterator<A>>(it: I) -> B { - MyFromIterator::my_from_iter(it) -} - -pub fn main() { - let x = vec![1u8, 2, 3, 4]; - let y: Option<Vec<u8>> = collect(x.iter()); // this should give approximately the same error for x.iter().collect() - //~^ ERROR - - let x: String = foobar(); //~ ERROR -} diff --git a/src/test/ui/on-unimplemented/on-trait.stderr b/src/test/ui/on-unimplemented/on-trait.stderr deleted file mode 100644 index 4b040f1ac..000000000 --- a/src/test/ui/on-unimplemented/on-trait.stderr +++ /dev/null @@ -1,29 +0,0 @@ -error[E0277]: the trait bound `Option<Vec<u8>>: MyFromIterator<&u8>` is not satisfied - --> $DIR/on-trait.rs:28:30 - | -LL | let y: Option<Vec<u8>> = collect(x.iter()); // this should give approximately the same error for x.iter().collect() - | ^^^^^^^ a collection of type `Option<Vec<u8>>` cannot be built from an iterator over elements of type `&u8` - | - = help: the trait `MyFromIterator<&u8>` is not implemented for `Option<Vec<u8>>` -note: required by a bound in `collect` - --> $DIR/on-trait.rs:22:39 - | -LL | fn collect<A, I: Iterator<Item=A>, B: MyFromIterator<A>>(it: I) -> B { - | ^^^^^^^^^^^^^^^^^ required by this bound in `collect` - -error[E0277]: the trait bound `String: Foo<u8, _, u32>` is not satisfied - --> $DIR/on-trait.rs:31:21 - | -LL | let x: String = foobar(); - | ^^^^^^ test error `String` with `u8` `_` `u32` in `Foo` - | - = help: the trait `Foo<u8, _, u32>` is not implemented for `String` -note: required by a bound in `foobar` - --> $DIR/on-trait.rs:12:24 - | -LL | fn foobar<U: Clone, T: Foo<u8, U, u32>>() -> T { - | ^^^^^^^^^^^^^^^ required by this bound in `foobar` - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/on-unimplemented/parent-label.rs b/src/test/ui/on-unimplemented/parent-label.rs deleted file mode 100644 index b65f64968..000000000 --- a/src/test/ui/on-unimplemented/parent-label.rs +++ /dev/null @@ -1,27 +0,0 @@ -// Test scope annotations from `parent_label` parameter - -#![feature(rustc_attrs)] - -#[rustc_on_unimplemented(parent_label = "in this scope")] -trait Trait {} - -struct Foo; - -fn f<T: Trait>(x: T) {} - -fn main() { - let x = || { - f(Foo {}); //~ ERROR the trait bound `Foo: Trait` is not satisfied - let y = || { - f(Foo {}); //~ ERROR the trait bound `Foo: Trait` is not satisfied - }; - }; - - { - { - f(Foo {}); //~ ERROR the trait bound `Foo: Trait` is not satisfied - } - } - - f(Foo {}); //~ ERROR the trait bound `Foo: Trait` is not satisfied -} diff --git a/src/test/ui/on-unimplemented/parent-label.stderr b/src/test/ui/on-unimplemented/parent-label.stderr deleted file mode 100644 index 8cd7412fd..000000000 --- a/src/test/ui/on-unimplemented/parent-label.stderr +++ /dev/null @@ -1,69 +0,0 @@ -error[E0277]: the trait bound `Foo: Trait` is not satisfied - --> $DIR/parent-label.rs:14:11 - | -LL | let x = || { - | -- in this scope -LL | f(Foo {}); - | - ^^^^^^ the trait `Trait` is not implemented for `Foo` - | | - | required by a bound introduced by this call - | -note: required by a bound in `f` - --> $DIR/parent-label.rs:10:9 - | -LL | fn f<T: Trait>(x: T) {} - | ^^^^^ required by this bound in `f` - -error[E0277]: the trait bound `Foo: Trait` is not satisfied - --> $DIR/parent-label.rs:16:15 - | -LL | let y = || { - | -- in this scope -LL | f(Foo {}); - | - ^^^^^^ the trait `Trait` is not implemented for `Foo` - | | - | required by a bound introduced by this call - | -note: required by a bound in `f` - --> $DIR/parent-label.rs:10:9 - | -LL | fn f<T: Trait>(x: T) {} - | ^^^^^ required by this bound in `f` - -error[E0277]: the trait bound `Foo: Trait` is not satisfied - --> $DIR/parent-label.rs:22:15 - | -LL | fn main() { - | --------- in this scope -... -LL | f(Foo {}); - | - ^^^^^^ the trait `Trait` is not implemented for `Foo` - | | - | required by a bound introduced by this call - | -note: required by a bound in `f` - --> $DIR/parent-label.rs:10:9 - | -LL | fn f<T: Trait>(x: T) {} - | ^^^^^ required by this bound in `f` - -error[E0277]: the trait bound `Foo: Trait` is not satisfied - --> $DIR/parent-label.rs:26:7 - | -LL | fn main() { - | --------- in this scope -... -LL | f(Foo {}); - | - ^^^^^^ the trait `Trait` is not implemented for `Foo` - | | - | required by a bound introduced by this call - | -note: required by a bound in `f` - --> $DIR/parent-label.rs:10:9 - | -LL | fn f<T: Trait>(x: T) {} - | ^^^^^ required by this bound in `f` - -error: aborting due to 4 previous errors - -For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/on-unimplemented/slice-index.rs b/src/test/ui/on-unimplemented/slice-index.rs deleted file mode 100644 index 758220d3c..000000000 --- a/src/test/ui/on-unimplemented/slice-index.rs +++ /dev/null @@ -1,10 +0,0 @@ -// Test new Index error message for slices - -use std::ops::Index; - - -fn main() { - let x = &[1, 2, 3] as &[i32]; - x[1i32]; //~ ERROR E0277 - x[..1i32]; //~ ERROR E0277 -} diff --git a/src/test/ui/on-unimplemented/slice-index.stderr b/src/test/ui/on-unimplemented/slice-index.stderr deleted file mode 100644 index a7ec3bda8..000000000 --- a/src/test/ui/on-unimplemented/slice-index.stderr +++ /dev/null @@ -1,25 +0,0 @@ -error[E0277]: the type `[i32]` cannot be indexed by `i32` - --> $DIR/slice-index.rs:8:7 - | -LL | x[1i32]; - | ^^^^ slice indices are of type `usize` or ranges of `usize` - | - = help: the trait `SliceIndex<[i32]>` is not implemented for `i32` - = help: the trait `SliceIndex<[T]>` is implemented for `usize` - = note: required for `[i32]` to implement `Index<i32>` - -error[E0277]: the type `[i32]` cannot be indexed by `RangeTo<i32>` - --> $DIR/slice-index.rs:9:7 - | -LL | x[..1i32]; - | ^^^^^^ slice indices are of type `usize` or ranges of `usize` - | - = help: the trait `SliceIndex<[i32]>` is not implemented for `RangeTo<i32>` - = help: the following other types implement trait `SliceIndex<T>`: - <RangeTo<usize> as SliceIndex<[T]>> - <RangeTo<usize> as SliceIndex<str>> - = note: required for `[i32]` to implement `Index<RangeTo<i32>>` - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0277`. |