about summary refs log tree commit diff
path: root/src/test/ui/error-codes/e0119
diff options
context:
space:
mode:
authorAlbert Larsan <74931857+albertlarsan68@users.noreply.github.com>2023-01-05 09:13:28 +0100
committerAlbert Larsan <74931857+albertlarsan68@users.noreply.github.com>2023-01-11 09:32:08 +0000
commitcf2dff2b1e3fa55fa5415d524200070d0d7aacfe (patch)
tree40a88d9a46aaf3e8870676eb2538378b75a263eb /src/test/ui/error-codes/e0119
parentca855e6e42787ecd062d81d53336fe6788ef51a9 (diff)
downloadrust-cf2dff2b1e3fa55fa5415d524200070d0d7aacfe.tar.gz
rust-cf2dff2b1e3fa55fa5415d524200070d0d7aacfe.zip
Move /src/test to /tests
Diffstat (limited to 'src/test/ui/error-codes/e0119')
-rw-r--r--src/test/ui/error-codes/e0119/auxiliary/complex_impl_support.rs22
-rw-r--r--src/test/ui/error-codes/e0119/auxiliary/issue-23563-a.rs25
-rw-r--r--src/test/ui/error-codes/e0119/complex-impl.rs11
-rw-r--r--src/test/ui/error-codes/e0119/complex-impl.stderr14
-rw-r--r--src/test/ui/error-codes/e0119/conflict-with-std.rs26
-rw-r--r--src/test/ui/error-codes/e0119/conflict-with-std.stderr32
-rw-r--r--src/test/ui/error-codes/e0119/issue-23563.rs29
-rw-r--r--src/test/ui/error-codes/e0119/issue-23563.stderr13
-rw-r--r--src/test/ui/error-codes/e0119/issue-27403.rs11
-rw-r--r--src/test/ui/error-codes/e0119/issue-27403.stderr13
-rw-r--r--src/test/ui/error-codes/e0119/issue-28981.rs7
-rw-r--r--src/test/ui/error-codes/e0119/issue-28981.stderr12
-rw-r--r--src/test/ui/error-codes/e0119/so-37347311.rs17
-rw-r--r--src/test/ui/error-codes/e0119/so-37347311.stderr12
14 files changed, 0 insertions, 244 deletions
diff --git a/src/test/ui/error-codes/e0119/auxiliary/complex_impl_support.rs b/src/test/ui/error-codes/e0119/auxiliary/complex_impl_support.rs
deleted file mode 100644
index ad5bb107fc6..00000000000
--- a/src/test/ui/error-codes/e0119/auxiliary/complex_impl_support.rs
+++ /dev/null
@@ -1,22 +0,0 @@
-use std::marker::PhantomData;
-
-pub trait External {}
-
-pub struct M<'a, 'b, 'c, T, U, V> {
-    a: PhantomData<&'a ()>,
-    b: PhantomData<&'b ()>,
-    c: PhantomData<&'c ()>,
-    d: PhantomData<T>,
-    e: PhantomData<U>,
-    f: PhantomData<V>,
-}
-
-impl<'a, 'b, 'c, T, U, V, W> External for (T, M<'a, 'b, 'c, Box<U>, V, W>)
-where
-    'b: 'a,
-    T: 'a,
-    U: (FnOnce(T) -> V) + 'static,
-    V: Iterator<Item=T> + Clone,
-    W: std::ops::Add,
-    W::Output: Copy,
-{}
diff --git a/src/test/ui/error-codes/e0119/auxiliary/issue-23563-a.rs b/src/test/ui/error-codes/e0119/auxiliary/issue-23563-a.rs
deleted file mode 100644
index 141f363694a..00000000000
--- a/src/test/ui/error-codes/e0119/auxiliary/issue-23563-a.rs
+++ /dev/null
@@ -1,25 +0,0 @@
-// Ref: https://github.com/rust-lang/rust/issues/23563#issuecomment-260751672
-
-pub trait LolTo<T> {
-    fn convert_to(&self) -> T;
-}
-
-pub trait LolInto<T>: Sized {
-    fn convert_into(self) -> T;
-}
-
-pub trait LolFrom<T> {
-    fn from(_: T) -> Self;
-}
-
-impl<'a, T: ?Sized, U> LolInto<U> for &'a T where T: LolTo<U> {
-    fn convert_into(self) -> U {
-        self.convert_to()
-    }
-}
-
-impl<T, U> LolFrom<T> for U where T: LolInto<U> {
-    fn from(t: T) -> U {
-        t.convert_into()
-    }
-}
diff --git a/src/test/ui/error-codes/e0119/complex-impl.rs b/src/test/ui/error-codes/e0119/complex-impl.rs
deleted file mode 100644
index 9149e4ce58e..00000000000
--- a/src/test/ui/error-codes/e0119/complex-impl.rs
+++ /dev/null
@@ -1,11 +0,0 @@
-// aux-build:complex_impl_support.rs
-
-extern crate complex_impl_support;
-
-use complex_impl_support::{External, M};
-
-struct Q;
-
-impl<R> External for (Q, R) {} //~ ERROR only traits defined
-
-fn main() {}
diff --git a/src/test/ui/error-codes/e0119/complex-impl.stderr b/src/test/ui/error-codes/e0119/complex-impl.stderr
deleted file mode 100644
index 654073eec26..00000000000
--- a/src/test/ui/error-codes/e0119/complex-impl.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
-  --> $DIR/complex-impl.rs:9:1
-   |
-LL | impl<R> External for (Q, R) {}
-   | ^^^^^^^^^^^^^^^^^^^^^------
-   | |                    |
-   | |                    this is not defined in the current crate because tuples are always foreign
-   | impl doesn't use only types from inside the current crate
-   |
-   = note: define and implement a trait or new type instead
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0117`.
diff --git a/src/test/ui/error-codes/e0119/conflict-with-std.rs b/src/test/ui/error-codes/e0119/conflict-with-std.rs
deleted file mode 100644
index c9db2bab183..00000000000
--- a/src/test/ui/error-codes/e0119/conflict-with-std.rs
+++ /dev/null
@@ -1,26 +0,0 @@
-use std::marker::PhantomData;
-use std::convert::{TryFrom, AsRef};
-
-struct Q;
-impl AsRef<Q> for Box<Q> { //~ ERROR conflicting implementations
-    fn as_ref(&self) -> &Q {
-        &**self
-    }
-}
-
-struct S;
-impl From<S> for S { //~ ERROR conflicting implementations
-    fn from(s: S) -> S {
-        s
-    }
-}
-
-struct X;
-impl TryFrom<X> for X { //~ ERROR conflicting implementations
-    type Error = ();
-    fn try_from(u: X) -> Result<X, ()> {
-        Ok(u)
-    }
-}
-
-fn main() {}
diff --git a/src/test/ui/error-codes/e0119/conflict-with-std.stderr b/src/test/ui/error-codes/e0119/conflict-with-std.stderr
deleted file mode 100644
index ef888a1c287..00000000000
--- a/src/test/ui/error-codes/e0119/conflict-with-std.stderr
+++ /dev/null
@@ -1,32 +0,0 @@
-error[E0119]: conflicting implementations of trait `AsRef<Q>` for type `Box<Q>`
-  --> $DIR/conflict-with-std.rs:5:1
-   |
-LL | impl AsRef<Q> for Box<Q> {
-   | ^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: conflicting implementation in crate `alloc`:
-           - impl<T, A> AsRef<T> for Box<T, A>
-             where A: Allocator, T: ?Sized;
-
-error[E0119]: conflicting implementations of trait `From<S>` for type `S`
-  --> $DIR/conflict-with-std.rs:12:1
-   |
-LL | impl From<S> for S {
-   | ^^^^^^^^^^^^^^^^^^
-   |
-   = note: conflicting implementation in crate `core`:
-           - impl<T> From<T> for T;
-
-error[E0119]: conflicting implementations of trait `TryFrom<X>` for type `X`
-  --> $DIR/conflict-with-std.rs:19:1
-   |
-LL | impl TryFrom<X> for X {
-   | ^^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: conflicting implementation in crate `core`:
-           - impl<T, U> TryFrom<U> for T
-             where U: Into<T>;
-
-error: aborting due to 3 previous errors
-
-For more information about this error, try `rustc --explain E0119`.
diff --git a/src/test/ui/error-codes/e0119/issue-23563.rs b/src/test/ui/error-codes/e0119/issue-23563.rs
deleted file mode 100644
index f578560c552..00000000000
--- a/src/test/ui/error-codes/e0119/issue-23563.rs
+++ /dev/null
@@ -1,29 +0,0 @@
-// aux-build:issue-23563-a.rs
-
-// Ref: https://github.com/rust-lang/rust/issues/23563#issuecomment-260751672
-
-extern crate issue_23563_a as a;
-
-use a::LolFrom;
-use a::LolInto;
-use a::LolTo;
-
-struct LocalType<T>(Option<T>);
-
-impl<'a, T> LolFrom<&'a [T]> for LocalType<T> { //~ ERROR conflicting implementations of trait
-    fn from(_: &'a [T]) -> LocalType<T> { LocalType(None) }
-}
-
-impl<T> LolInto<LocalType<T>> for LocalType<T> {
-    fn convert_into(self) -> LocalType<T> {
-        self
-    }
-}
-
-impl LolTo<LocalType<u8>> for [u8] {
-    fn convert_to(&self) -> LocalType<u8> {
-        LocalType(None)
-    }
-}
-
-fn main() {}
diff --git a/src/test/ui/error-codes/e0119/issue-23563.stderr b/src/test/ui/error-codes/e0119/issue-23563.stderr
deleted file mode 100644
index 1b2d64282e1..00000000000
--- a/src/test/ui/error-codes/e0119/issue-23563.stderr
+++ /dev/null
@@ -1,13 +0,0 @@
-error[E0119]: conflicting implementations of trait `LolFrom<&[_]>` for type `LocalType<_>`
-  --> $DIR/issue-23563.rs:13:1
-   |
-LL | impl<'a, T> LolFrom<&'a [T]> for LocalType<T> {
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: conflicting implementation in crate `issue_23563_a`:
-           - impl<T, U> LolFrom<T> for U
-             where T: LolInto<U>;
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0119`.
diff --git a/src/test/ui/error-codes/e0119/issue-27403.rs b/src/test/ui/error-codes/e0119/issue-27403.rs
deleted file mode 100644
index b03a564ffd4..00000000000
--- a/src/test/ui/error-codes/e0119/issue-27403.rs
+++ /dev/null
@@ -1,11 +0,0 @@
-pub struct GenX<S> {
-    inner: S,
-}
-
-impl<S> Into<S> for GenX<S> { //~ ERROR conflicting implementations
-    fn into(self) -> S {
-        self.inner
-    }
-}
-
-fn main() {}
diff --git a/src/test/ui/error-codes/e0119/issue-27403.stderr b/src/test/ui/error-codes/e0119/issue-27403.stderr
deleted file mode 100644
index 9b3345c23bb..00000000000
--- a/src/test/ui/error-codes/e0119/issue-27403.stderr
+++ /dev/null
@@ -1,13 +0,0 @@
-error[E0119]: conflicting implementations of trait `Into<_>` for type `GenX<_>`
-  --> $DIR/issue-27403.rs:5:1
-   |
-LL | impl<S> Into<S> for GenX<S> {
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: conflicting implementation in crate `core`:
-           - impl<T, U> Into<U> for T
-             where U: From<T>;
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0119`.
diff --git a/src/test/ui/error-codes/e0119/issue-28981.rs b/src/test/ui/error-codes/e0119/issue-28981.rs
deleted file mode 100644
index 5fb7e9a9913..00000000000
--- a/src/test/ui/error-codes/e0119/issue-28981.rs
+++ /dev/null
@@ -1,7 +0,0 @@
-use std::ops::Deref;
-
-struct Foo;
-
-impl<Foo> Deref for Foo { } //~ ERROR must be used
-
-fn main() {}
diff --git a/src/test/ui/error-codes/e0119/issue-28981.stderr b/src/test/ui/error-codes/e0119/issue-28981.stderr
deleted file mode 100644
index 97b570bc7ac..00000000000
--- a/src/test/ui/error-codes/e0119/issue-28981.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-error[E0210]: type parameter `Foo` must be used as the type parameter for some local type (e.g., `MyStruct<Foo>`)
-  --> $DIR/issue-28981.rs:5:6
-   |
-LL | impl<Foo> Deref for Foo { }
-   |      ^^^ type parameter `Foo` 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/error-codes/e0119/so-37347311.rs b/src/test/ui/error-codes/e0119/so-37347311.rs
deleted file mode 100644
index d5f624bc4d9..00000000000
--- a/src/test/ui/error-codes/e0119/so-37347311.rs
+++ /dev/null
@@ -1,17 +0,0 @@
-// Ref: https://stackoverflow.com/q/37347311
-
-trait Storage {
-    type Error;
-}
-
-enum MyError<S: Storage> {
-    StorageProblem(S::Error),
-}
-
-impl<S: Storage> From<S::Error> for MyError<S> { //~ ERROR conflicting implementations
-    fn from(error: S::Error) -> MyError<S> {
-        MyError::StorageProblem(error)
-    }
-}
-
-fn main() {}
diff --git a/src/test/ui/error-codes/e0119/so-37347311.stderr b/src/test/ui/error-codes/e0119/so-37347311.stderr
deleted file mode 100644
index 99367e80841..00000000000
--- a/src/test/ui/error-codes/e0119/so-37347311.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-error[E0119]: conflicting implementations of trait `From<MyError<_>>` for type `MyError<_>`
-  --> $DIR/so-37347311.rs:11:1
-   |
-LL | impl<S: Storage> From<S::Error> for MyError<S> {
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: conflicting implementation in crate `core`:
-           - impl<T> From<T> for T;
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0119`.