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