about summary refs log tree commit diff
diff options
context:
space:
mode:
authormejrs <59372212+mejrs@users.noreply.github.com>2025-04-10 16:06:59 +0200
committermejrs <59372212+mejrs@users.noreply.github.com>2025-04-14 00:12:37 +0200
commit4a5369b476fb17aa2db05b5b551eca0cfa6b2c6b (patch)
treee09c14c8127972486e20191376fa06e482d19f6e
parent40e76c157548442fce755ec9cc2274aef11454ba (diff)
downloadrust-4a5369b476fb17aa2db05b5b551eca0cfa6b2c6b.tar.gz
rust-4a5369b476fb17aa2db05b5b551eca0cfa6b2c6b.zip
Remove rustc_on_unimplemented on impl tests
-rw-r--r--src/tools/tidy/src/issues.txt1
-rw-r--r--tests/ui/on-unimplemented/impl-substs.rs15
-rw-r--r--tests/ui/on-unimplemented/impl-substs.stderr15
-rw-r--r--tests/ui/on-unimplemented/issue-104140.rs8
-rw-r--r--tests/ui/on-unimplemented/issue-104140.stderr15
-rw-r--r--tests/ui/on-unimplemented/multiple-impls.rs42
-rw-r--r--tests/ui/on-unimplemented/multiple-impls.stderr71
-rw-r--r--tests/ui/on-unimplemented/on-impl.rs25
-rw-r--r--tests/ui/on-unimplemented/on-impl.stderr25
9 files changed, 0 insertions, 217 deletions
diff --git a/src/tools/tidy/src/issues.txt b/src/tools/tidy/src/issues.txt
index d2ae9b1f6ef..5fa4a9fc2e3 100644
--- a/src/tools/tidy/src/issues.txt
+++ b/src/tools/tidy/src/issues.txt
@@ -3138,7 +3138,6 @@ ui/nll/user-annotations/issue-55241.rs
 ui/nll/user-annotations/issue-55748-pat-types-constrain-bindings.rs
 ui/nll/user-annotations/issue-57731-ascibed-coupled-types.rs
 ui/numbers-arithmetic/issue-8460.rs
-ui/on-unimplemented/issue-104140.rs
 ui/or-patterns/issue-64879-trailing-before-guard.rs
 ui/or-patterns/issue-67514-irrefutable-param.rs
 ui/or-patterns/issue-68785-irrefutable-param-with-at.rs
diff --git a/tests/ui/on-unimplemented/impl-substs.rs b/tests/ui/on-unimplemented/impl-substs.rs
deleted file mode 100644
index fe9c50ec3d4..00000000000
--- a/tests/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/tests/ui/on-unimplemented/impl-substs.stderr b/tests/ui/on-unimplemented/impl-substs.stderr
deleted file mode 100644
index 2d83845ecb8..00000000000
--- a/tests/ui/on-unimplemented/impl-substs.stderr
+++ /dev/null
@@ -1,15 +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));
-   |     ----------------- ^^^^^^^^^^^^^^^^^^ the trait `Foo<usize>` is not implemented for `(i32, i32, i32)`
-   |     |
-   |     required by a bound introduced by this call
-   |
-   = help: the trait `Foo<usize>` is not implemented for `(i32, i32, i32)`
-           but trait `Foo<i32>` is implemented for it
-   = help: for that trait implementation, expected `i32`, found `usize`
-
-error: aborting due to 1 previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/on-unimplemented/issue-104140.rs b/tests/ui/on-unimplemented/issue-104140.rs
deleted file mode 100644
index ade3f727004..00000000000
--- a/tests/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/tests/ui/on-unimplemented/issue-104140.stderr b/tests/ui/on-unimplemented/issue-104140.stderr
deleted file mode 100644
index 3c317135dd4..00000000000
--- a/tests/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 1 previous error
-
diff --git a/tests/ui/on-unimplemented/multiple-impls.rs b/tests/ui/on-unimplemented/multiple-impls.rs
deleted file mode 100644
index b74957ebcd4..00000000000
--- a/tests/ui/on-unimplemented/multiple-impls.rs
+++ /dev/null
@@ -1,42 +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
-    Index::index(&[] as &[i32], Foo(2u32));
-    //~^ ERROR E0277
-    //~| ERROR E0277
-    Index::index(&[] as &[i32], Bar(2u32));
-    //~^ ERROR E0277
-    //~| ERROR E0277
-}
diff --git a/tests/ui/on-unimplemented/multiple-impls.stderr b/tests/ui/on-unimplemented/multiple-impls.stderr
deleted file mode 100644
index 2afc9b1bf3b..00000000000
--- a/tests/ui/on-unimplemented/multiple-impls.stderr
+++ /dev/null
@@ -1,71 +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]` implements `Index<Bar<usize>>`
-             `[i32]` implements `Index<Foo<usize>>`
-
-error[E0277]: the trait bound `[i32]: Index<Foo<u32>>` is not satisfied
-  --> $DIR/multiple-impls.rs:36:33
-   |
-LL |     Index::index(&[] as &[i32], Foo(2u32));
-   |     ------------                ^^^^^^^^^ the trait `Index<Foo<u32>>` is not implemented for `[i32]`
-   |     |
-   |     required by a bound introduced by this call
-   |
-   = help: the following other types implement trait `Index<Idx>`:
-             `[i32]` implements `Index<Bar<usize>>`
-             `[i32]` implements `Index<Foo<usize>>`
-
-error[E0277]: the trait bound `[i32]: Index<Bar<u32>>` is not satisfied
-  --> $DIR/multiple-impls.rs:39:33
-   |
-LL |     Index::index(&[] as &[i32], Bar(2u32));
-   |     ------------                ^^^^^^^^^ the trait `Index<Bar<u32>>` is not implemented for `[i32]`
-   |     |
-   |     required by a bound introduced by this call
-   |
-   = help: the following other types implement trait `Index<Idx>`:
-             `[i32]` implements `Index<Bar<usize>>`
-             `[i32]` implements `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]` implements `Index<Bar<usize>>`
-             `[i32]` implements `Index<Foo<usize>>`
-
-error[E0277]: the trait bound `[i32]: Index<Foo<u32>>` is not satisfied
-  --> $DIR/multiple-impls.rs:36:5
-   |
-LL |     Index::index(&[] as &[i32], Foo(2u32));
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Index<Foo<u32>>` is not implemented for `[i32]`
-   |
-   = help: the following other types implement trait `Index<Idx>`:
-             `[i32]` implements `Index<Bar<usize>>`
-             `[i32]` implements `Index<Foo<usize>>`
-
-error[E0277]: the trait bound `[i32]: Index<Bar<u32>>` is not satisfied
-  --> $DIR/multiple-impls.rs:39:5
-   |
-LL |     Index::index(&[] as &[i32], Bar(2u32));
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Index<Bar<u32>>` is not implemented for `[i32]`
-   |
-   = help: the following other types implement trait `Index<Idx>`:
-             `[i32]` implements `Index<Bar<usize>>`
-             `[i32]` implements `Index<Foo<usize>>`
-
-error: aborting due to 6 previous errors
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/on-unimplemented/on-impl.rs b/tests/ui/on-unimplemented/on-impl.rs
deleted file mode 100644
index ab3e67d01fe..00000000000
--- a/tests/ui/on-unimplemented/on-impl.rs
+++ /dev/null
@@ -1,25 +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
-}
diff --git a/tests/ui/on-unimplemented/on-impl.stderr b/tests/ui/on-unimplemented/on-impl.stderr
deleted file mode 100644
index 922db9db116..00000000000
--- a/tests/ui/on-unimplemented/on-impl.stderr
+++ /dev/null
@@ -1,25 +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);
-   |     -------------------                       ^^^^ the trait `Index<u32>` is not implemented for `[i32]`
-   |     |
-   |     required by a bound introduced by this call
-   |
-   = help: the trait `Index<u32>` is not implemented for `[i32]`
-           but trait `Index<usize>` is implemented for it
-   = help: for that trait implementation, expected `usize`, found `u32`
-
-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);
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Index<u32>` is not implemented for `[i32]`
-   |
-   = help: the trait `Index<u32>` is not implemented for `[i32]`
-           but trait `Index<usize>` is implemented for it
-   = help: for that trait implementation, expected `usize`, found `u32`
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0277`.