Ignore from_over_into if it contains Self
This commit is contained in:
parent
d4b388eb43
commit
16f1cf8fd4
3 changed files with 10 additions and 91 deletions
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue