summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/from_over_into.stderr
blob: 9c2a7c04c3646a84252479dea7e42a15319d9bb8 (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
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` implentation 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` implentation 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` implentation 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` implentation 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:80:5
   |
LL |     impl<T> Into<FromOverInto<T>> for Vec<T> {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
help: replace the `Into` implentation 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