about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorMarcusGrass <marcus.grass@protonmail.com>2023-06-01 10:40:21 +0200
committerMarcusGrass <marcus.grass@protonmail.com>2023-06-01 10:46:29 +0200
commit16f1cf8fd4e378d61bb240a8c5bbbeba2d000cb0 (patch)
tree6261926f63b8d9dd8a1f146283d9e61261651d54 /tests
parentd4b388eb43719543aaa9680f5aa03b69d024ea38 (diff)
downloadrust-16f1cf8fd4e378d61bb240a8c5bbbeba2d000cb0.tar.gz
rust-16f1cf8fd4e378d61bb240a8c5bbbeba2d000cb0.zip
Ignore from_over_into if it contains Self
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/from_over_into.fixed6
-rw-r--r--tests/ui/from_over_into.stderr15
2 files changed, 4 insertions, 17 deletions
diff --git a/tests/ui/from_over_into.fixed b/tests/ui/from_over_into.fixed
index f1333bb39a8..98310ac5c6c 100644
--- a/tests/ui/from_over_into.fixed
+++ b/tests/ui/from_over_into.fixed
@@ -92,9 +92,9 @@ pub struct Lval<T>(T);
 
 pub struct Rval<T>(T);
 
-impl<T> From<Lval<T>> for Rval<Lval<T>> {
-    fn from(val: Lval<T>) -> Self {
-        Rval(val)
+impl<T> Into<Rval<Self>> for Lval<T> {
+    fn into(self) -> Rval<Self> {
+        Rval(self)
     }
 }
 
diff --git a/tests/ui/from_over_into.stderr b/tests/ui/from_over_into.stderr
index c514bb6146c..6039f86fe67 100644
--- a/tests/ui/from_over_into.stderr
+++ b/tests/ui/from_over_into.stderr
@@ -71,18 +71,5 @@ LL ~         fn from(val: Vec<T>) -> Self {
 LL ~             FromOverInto(val)
    |
 
-error: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
-  --> $DIR/from_over_into.rs:95:1
-   |
-LL | impl<T> Into<Rval<Self>> for Lval<T> {
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-help: replace the `Into` implementation with `From<Lval<T>>`
-   |
-LL ~ impl<T> From<Lval<T>> for Rval<Lval<T>> {
-LL ~     fn from(val: Lval<T>) -> Self {
-LL ~         Rval(val)
-   |
-
-error: aborting due to 6 previous errors
+error: aborting due to 5 previous errors