mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-24 05:33:27 +00:00
d2061faf9e
* applying * binding * complex * constituent * demonstrate * desugaring * exact * expression * for * functionalities * github * implementation * infers * multiple conflicting traits * mutable * necessarily * nightly * nonexistent * optional * parameter * reassignments * resources * substitution * suggestion * that * that array is * using the Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
75 lines
2.6 KiB
Text
75 lines
2.6 KiB
Text
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:10:1
|
|
|
|
|
LL | impl Into<StringWrapper> for String {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: `-D clippy::from-over-into` implied by `-D warnings`
|
|
help: replace the `Into` implementation with `From<std::string::String>`
|
|
|
|
|
LL ~ impl From<String> for StringWrapper {
|
|
LL ~ fn from(val: String) -> Self {
|
|
LL ~ StringWrapper(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:18:1
|
|
|
|
|
LL | impl Into<SelfType> for String {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: replace the `Into` implementation with `From<std::string::String>`
|
|
|
|
|
LL ~ impl From<String> for SelfType {
|
|
LL ~ fn from(val: String) -> Self {
|
|
LL ~ SelfType(String::new())
|
|
|
|
|
|
|
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:33:1
|
|
|
|
|
LL | impl Into<SelfKeywords> for X {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: replace the `Into` implementation with `From<X>`
|
|
|
|
|
LL ~ impl From<X> for SelfKeywords {
|
|
LL ~ fn from(val: X) -> Self {
|
|
LL ~ let _ = X::default();
|
|
LL ~ let _ = X::FOO;
|
|
LL ~ let _: X = 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:45:1
|
|
|
|
|
LL | impl core::convert::Into<bool> for crate::ExplicitPaths {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: `impl From<Local> for Foreign` is allowed by the orphan rules, for more information see
|
|
https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence
|
|
help: replace the `Into` implementation with `From<ExplicitPaths>`
|
|
|
|
|
LL ~ impl core::convert::From<crate::ExplicitPaths> for bool {
|
|
LL ~ fn from(mut val: crate::ExplicitPaths) -> Self {
|
|
LL ~ let in_closure = || val.0;
|
|
LL |
|
|
LL ~ val.0 = false;
|
|
LL ~ val.0
|
|
|
|
|
|
|
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:78:5
|
|
|
|
|
LL | impl<T> Into<FromOverInto<T>> for Vec<T> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: replace the `Into` implementation with `From<std::vec::Vec<T>>`
|
|
|
|
|
LL ~ impl<T> From<Vec<T>> for FromOverInto<T> {
|
|
LL ~ fn from(val: Vec<T>) -> Self {
|
|
LL ~ FromOverInto(val)
|
|
|
|
|
|
|
error: aborting due to 5 previous errors
|
|
|