Ignore from_over_into if it contains Self

This commit is contained in:
MarcusGrass 2023-06-01 10:40:21 +02:00
parent d4b388eb43
commit 16f1cf8fd4
No known key found for this signature in database
GPG key ID: B3F995FE064E3AA9
3 changed files with 10 additions and 91 deletions

View file

@ -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)
}
}

View file

@ -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