about summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/from_over_into.stderr
blob: fe779544dd578d813db589b865e65124dd858665 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
error: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
  --> tests/ui/from_over_into.rs:9:1
   |
LL | impl Into<StringWrapper> for String {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: `-D clippy::from-over-into` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::from_over_into)]`
help: replace the `Into` implementation with `From<std::string::String>`
   |
LL ~ impl From<String> for StringWrapper {
LL |
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
  --> tests/ui/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 |
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
  --> tests/ui/from_over_into.rs:34:1
   |
LL | impl Into<SelfKeywords> for X {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
help: replace the `Into` implementation with `From<X>`
   |
LL ~ impl From<X> for SelfKeywords {
LL |
LL ~     fn from(val: X) -> Self {
LL ~         let _ = X;
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
  --> tests/ui/from_over_into.rs:47: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 |
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
  --> tests/ui/from_over_into.rs:68:1
   |
LL | impl Into<String> for PathInExpansion {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = 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<PathInExpansion>`
   |
LL ~ impl From<PathInExpansion> for String {
LL |
LL ~     fn from(val: PathInExpansion) -> Self {
   |

error: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
  --> tests/ui/from_over_into.rs:91: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 |
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
  --> tests/ui/from_over_into.rs:102:5
   |
LL |     impl Into<()> for Hello {
   |     ^^^^^^^^^^^^^^^^^^^^^^^
   |
   = 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<issue_12138::Hello>`
   |
LL ~     impl From<Hello> for () {
LL |
LL ~         fn from(val: Hello) {}
   |

error: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
  --> tests/ui/from_over_into.rs:111:5
   |
LL |     impl Into<i64> for MyInt {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = 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<issue_112502::MyInt>`
   |
LL ~     impl From<MyInt> for i64 {
LL |
LL ~         fn from(val: MyInt) -> Self {
LL ~             val.0
   |

error: aborting due to 8 previous errors