]> git.lizzy.rs Git - rust.git/commitdiff
deduplicate tests
authorlcnr <rust@lcnr.de>
Fri, 18 Nov 2022 13:51:24 +0000 (14:51 +0100)
committerlcnr <rust@lcnr.de>
Fri, 18 Nov 2022 13:51:24 +0000 (14:51 +0100)
12 files changed:
src/test/ui/coherence/issue-100191-2.rs [deleted file]
src/test/ui/coherence/issue-100191-2.stderr [deleted file]
src/test/ui/coherence/issue-100191.rs [deleted file]
src/test/ui/coherence/issue-100191.stderr [deleted file]
src/test/ui/specialization/issue-43037.current.stderr [new file with mode: 0644]
src/test/ui/specialization/issue-43037.negative.stderr [new file with mode: 0644]
src/test/ui/specialization/issue-43037.rs
src/test/ui/specialization/issue-43037.stderr [deleted file]
src/test/ui/specialization/issue-45814.current.stderr [new file with mode: 0644]
src/test/ui/specialization/issue-45814.negative.stderr [new file with mode: 0644]
src/test/ui/specialization/issue-45814.rs
src/test/ui/specialization/issue-45814.stderr [deleted file]

diff --git a/src/test/ui/coherence/issue-100191-2.rs b/src/test/ui/coherence/issue-100191-2.rs
deleted file mode 100644 (file)
index 1c8316f..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-//~ ERROR overflow evaluating the requirement `T: Trait<_>`
-
-#![feature(specialization, with_negative_coherence)]
-#![allow(incomplete_features)]
-
-pub trait Trait<T> {}
-
-default impl<T, U> Trait<T> for U {}
-
-impl<T> Trait<<T as Iterator>::Item> for T {}
-
-fn main() {}
diff --git a/src/test/ui/coherence/issue-100191-2.stderr b/src/test/ui/coherence/issue-100191-2.stderr
deleted file mode 100644 (file)
index d50c220..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-error[E0275]: overflow evaluating the requirement `T: Trait<_>`
-   |
-   = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`issue_100191_2`)
-note: required for `T` to implement `Trait<_>`
-  --> $DIR/issue-100191-2.rs:8:20
-   |
-LL | default impl<T, U> Trait<T> for U {}
-   |                    ^^^^^^^^     ^
-   = note: 128 redundant requirements hidden
-   = note: required for `T` to implement `Trait<_>`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0275`.
diff --git a/src/test/ui/coherence/issue-100191.rs b/src/test/ui/coherence/issue-100191.rs
deleted file mode 100644 (file)
index e8597fd..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-#![crate_type = "lib"]
-#![feature(specialization, with_negative_coherence)]
-#![allow(incomplete_features)]
-
-trait X {}
-trait Y: X {}
-trait Z {
-    type Assoc: Y;
-}
-struct A<T>(T);
-
-impl<T> Y for T where T: X {}
-impl<T: X> Z for A<T> {
-    type Assoc = T;
-}
-
-// this impl is invalid, but causes an ICE anyway
-impl<T> From<<A<T> as Z>::Assoc> for T {}
-//~^ ERROR type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
-
-fn main() {}
diff --git a/src/test/ui/coherence/issue-100191.stderr b/src/test/ui/coherence/issue-100191.stderr
deleted file mode 100644 (file)
index 1adb0f1..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
-  --> $DIR/issue-100191.rs:18:6
-   |
-LL | impl<T> From<<A<T> as Z>::Assoc> for T {}
-   |      ^ type parameter `T` must be used as the type parameter for some local type
-   |
-   = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
-   = note: only traits defined in the current crate can be implemented for a type parameter
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0210`.
diff --git a/src/test/ui/specialization/issue-43037.current.stderr b/src/test/ui/specialization/issue-43037.current.stderr
new file mode 100644 (file)
index 0000000..26db9d7
--- /dev/null
@@ -0,0 +1,12 @@
+error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
+  --> $DIR/issue-43037.rs:19:6
+   |
+LL | impl<T> From<<A<T> as Z>::Assoc> for T {}
+   |      ^ type parameter `T` must be used as the type parameter for some local type
+   |
+   = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
+   = note: only traits defined in the current crate can be implemented for a type parameter
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0210`.
diff --git a/src/test/ui/specialization/issue-43037.negative.stderr b/src/test/ui/specialization/issue-43037.negative.stderr
new file mode 100644 (file)
index 0000000..26db9d7
--- /dev/null
@@ -0,0 +1,12 @@
+error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
+  --> $DIR/issue-43037.rs:19:6
+   |
+LL | impl<T> From<<A<T> as Z>::Assoc> for T {}
+   |      ^ type parameter `T` must be used as the type parameter for some local type
+   |
+   = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
+   = note: only traits defined in the current crate can be implemented for a type parameter
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0210`.
index c49119f9c095b73e07a3361c57e6d72bfeb69dd5..a1e3f998b23701c5a04d86fb76594c0d0d008d89 100644 (file)
@@ -1,4 +1,6 @@
+// revisions: current negative
 #![feature(specialization)]
+#![cfg_attr(negative, feature(with_negative_coherence))]
 #![allow(incomplete_features)]
 
 trait X {}
diff --git a/src/test/ui/specialization/issue-43037.stderr b/src/test/ui/specialization/issue-43037.stderr
deleted file mode 100644 (file)
index 4249cd8..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
-  --> $DIR/issue-43037.rs:17:6
-   |
-LL | impl<T> From<<A<T> as Z>::Assoc> for T {}
-   |      ^ type parameter `T` must be used as the type parameter for some local type
-   |
-   = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
-   = note: only traits defined in the current crate can be implemented for a type parameter
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0210`.
diff --git a/src/test/ui/specialization/issue-45814.current.stderr b/src/test/ui/specialization/issue-45814.current.stderr
new file mode 100644 (file)
index 0000000..5013559
--- /dev/null
@@ -0,0 +1,14 @@
+error[E0275]: overflow evaluating the requirement `T: Trait<_>`
+   |
+   = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`issue_45814`)
+note: required for `T` to implement `Trait<_>`
+  --> $DIR/issue-45814.rs:9:20
+   |
+LL | default impl<T, U> Trait<T> for U {}
+   |                    ^^^^^^^^     ^
+   = note: 128 redundant requirements hidden
+   = note: required for `T` to implement `Trait<_>`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0275`.
diff --git a/src/test/ui/specialization/issue-45814.negative.stderr b/src/test/ui/specialization/issue-45814.negative.stderr
new file mode 100644 (file)
index 0000000..5013559
--- /dev/null
@@ -0,0 +1,14 @@
+error[E0275]: overflow evaluating the requirement `T: Trait<_>`
+   |
+   = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`issue_45814`)
+note: required for `T` to implement `Trait<_>`
+  --> $DIR/issue-45814.rs:9:20
+   |
+LL | default impl<T, U> Trait<T> for U {}
+   |                    ^^^^^^^^     ^
+   = note: 128 redundant requirements hidden
+   = note: required for `T` to implement `Trait<_>`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0275`.
index 8ee5d3e2e58da627b5b3d942493867a70035300d..fce236390c2b0e78ef913361fbb234ac87f6d7b7 100644 (file)
@@ -1,6 +1,7 @@
 //~ ERROR overflow evaluating the requirement `T: Trait<_>`
-
+// revisions: current negative
 #![feature(specialization)]
+#![cfg_attr(negative, feature(with_negative_coherence))]
 #![allow(incomplete_features)]
 
 pub trait Trait<T> {}
diff --git a/src/test/ui/specialization/issue-45814.stderr b/src/test/ui/specialization/issue-45814.stderr
deleted file mode 100644 (file)
index 419345a..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-error[E0275]: overflow evaluating the requirement `T: Trait<_>`
-   |
-   = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`issue_45814`)
-note: required for `T` to implement `Trait<_>`
-  --> $DIR/issue-45814.rs:8:20
-   |
-LL | default impl<T, U> Trait<T> for U {}
-   |                    ^^^^^^^^     ^
-   = note: 128 redundant requirements hidden
-   = note: required for `T` to implement `Trait<_>`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0275`.