]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/from_over_into.stderr
Merge from rustc
[rust.git] / src / tools / clippy / tests / ui / from_over_into.stderr
1 error: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
2   --> $DIR/from_over_into.rs:10:1
3    |
4 LL | impl Into<StringWrapper> for String {
5    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6    |
7    = note: `-D clippy::from-over-into` implied by `-D warnings`
8 help: replace the `Into` implentation with `From<std::string::String>`
9    |
10 LL ~ impl From<String> for StringWrapper {
11 LL ~     fn from(val: String) -> Self {
12 LL ~         StringWrapper(val)
13    |
14
15 error: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
16   --> $DIR/from_over_into.rs:18:1
17    |
18 LL | impl Into<SelfType> for String {
19    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
20    |
21 help: replace the `Into` implentation with `From<std::string::String>`
22    |
23 LL ~ impl From<String> for SelfType {
24 LL ~     fn from(val: String) -> Self {
25 LL ~         SelfType(String::new())
26    |
27
28 error: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
29   --> $DIR/from_over_into.rs:33:1
30    |
31 LL | impl Into<SelfKeywords> for X {
32    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
33    |
34 help: replace the `Into` implentation with `From<X>`
35    |
36 LL ~ impl From<X> for SelfKeywords {
37 LL ~     fn from(val: X) -> Self {
38 LL ~         let _ = X::default();
39 LL ~         let _ = X::FOO;
40 LL ~         let _: X = val;
41    |
42
43 error: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
44   --> $DIR/from_over_into.rs:45:1
45    |
46 LL | impl core::convert::Into<bool> for crate::ExplicitPaths {
47    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
48    |
49    = help: `impl From<Local> for Foreign` is allowed by the orphan rules, for more information see
50            https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence
51 help: replace the `Into` implentation with `From<ExplicitPaths>`
52    |
53 LL ~ impl core::convert::From<crate::ExplicitPaths> for bool {
54 LL ~     fn from(mut val: crate::ExplicitPaths) -> Self {
55 LL ~         let in_closure = || val.0;
56 LL | 
57 LL ~         val.0 = false;
58 LL ~         val.0
59    |
60
61 error: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
62   --> $DIR/from_over_into.rs:78:5
63    |
64 LL |     impl<T> Into<FromOverInto<T>> for Vec<T> {
65    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66    |
67 help: replace the `Into` implentation with `From<std::vec::Vec<T>>`
68    |
69 LL ~     impl<T> From<Vec<T>> for FromOverInto<T> {
70 LL ~         fn from(val: Vec<T>) -> Self {
71 LL ~             FromOverInto(val)
72    |
73
74 error: aborting due to 5 previous errors
75