2021-01-02 15:29:43 +00:00
|
|
|
error: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
|
2022-12-17 13:12:54 +00:00
|
|
|
--> $DIR/from_over_into.rs:10:1
|
2021-01-02 15:29:43 +00:00
|
|
|
|
|
2021-01-15 09:56:44 +00:00
|
|
|
LL | impl Into<StringWrapper> for String {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2021-01-02 15:29:43 +00:00
|
|
|
|
|
2022-09-22 16:04:22 +00:00
|
|
|
= note: `-D clippy::from-over-into` implied by `-D warnings`
|
2023-05-05 15:45:49 +00:00
|
|
|
help: replace the `Into` implementation with `From<std::string::String>`
|
2022-10-23 13:18:45 +00:00
|
|
|
|
|
|
|
|
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
|
2022-12-17 13:12:54 +00:00
|
|
|
--> $DIR/from_over_into.rs:18:1
|
2022-10-23 13:18:45 +00:00
|
|
|
|
|
|
|
|
LL | impl Into<SelfType> for String {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
2023-05-05 15:45:49 +00:00
|
|
|
help: replace the `Into` implementation with `From<std::string::String>`
|
2022-10-23 13:18:45 +00:00
|
|
|
|
|
|
|
|
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
|
2022-12-17 13:12:54 +00:00
|
|
|
--> $DIR/from_over_into.rs:33:1
|
2022-10-23 13:18:45 +00:00
|
|
|
|
|
|
|
|
LL | impl Into<SelfKeywords> for X {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
2023-05-05 15:45:49 +00:00
|
|
|
help: replace the `Into` implementation with `From<X>`
|
2022-10-23 13:18:45 +00:00
|
|
|
|
|
|
|
|
LL ~ impl From<X> for SelfKeywords {
|
|
|
|
LL ~ fn from(val: X) -> Self {
|
2023-05-05 15:45:49 +00:00
|
|
|
LL ~ let _ = X;
|
2022-10-23 13:18:45 +00:00
|
|
|
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
|
2022-12-17 13:12:54 +00:00
|
|
|
--> $DIR/from_over_into.rs:45:1
|
2022-10-23 13:18:45 +00:00
|
|
|
|
|
|
|
|
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
|
2023-05-05 15:45:49 +00:00
|
|
|
help: replace the `Into` implementation with `From<ExplicitPaths>`
|
2022-10-23 13:18:45 +00:00
|
|
|
|
|
|
|
|
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
|
2022-12-17 13:12:54 +00:00
|
|
|
--> $DIR/from_over_into.rs:78:5
|
2022-10-23 13:18:45 +00:00
|
|
|
|
|
|
|
|
LL | impl<T> Into<FromOverInto<T>> for Vec<T> {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
2023-05-05 15:45:49 +00:00
|
|
|
help: replace the `Into` implementation with `From<std::vec::Vec<T>>`
|
2022-10-23 13:18:45 +00:00
|
|
|
|
|
|
|
|
LL ~ impl<T> From<Vec<T>> for FromOverInto<T> {
|
|
|
|
LL ~ fn from(val: Vec<T>) -> Self {
|
|
|
|
LL ~ FromOverInto(val)
|
|
|
|
|
|
2021-01-02 15:29:43 +00:00
|
|
|
|
2022-10-23 13:18:45 +00:00
|
|
|
error: aborting due to 5 previous errors
|
2021-01-02 15:29:43 +00:00
|
|
|
|