]> git.lizzy.rs Git - rust.git/blob - tests/ui/fallible_impl_from.stderr
Adapt the *.stderr files of the ui-tests to the tool_lints
[rust.git] / tests / ui / fallible_impl_from.stderr
1 error: consider implementing `TryFrom` instead
2   --> $DIR/fallible_impl_from.rs:7:1
3    |
4 7  | / impl From<String> for Foo {
5 8  | |     fn from(s: String) -> Self {
6 9  | |         Foo(s.parse().unwrap())
7 10 | |     }
8 11 | | }
9    | |_^
10    |
11 note: lint level defined here
12   --> $DIR/fallible_impl_from.rs:3:9
13    |
14 3  | #![deny(clippy::fallible_impl_from)]
15    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^
16    = help: `From` is intended for infallible conversions only. Use `TryFrom` if there's a possibility for the conversion to fail.
17 note: potential failure(s)
18   --> $DIR/fallible_impl_from.rs:9:13
19    |
20 9  |         Foo(s.parse().unwrap())
21    |             ^^^^^^^^^^^^^^^^^^
22
23 error: consider implementing `TryFrom` instead
24   --> $DIR/fallible_impl_from.rs:30:1
25    |
26 30 | / impl From<usize> for Invalid {
27 31 | |     fn from(i: usize) -> Invalid {
28 32 | |         if i != 42 {
29 33 | |             panic!();
30 ...  |
31 36 | |     }
32 37 | | }
33    | |_^
34    |
35    = help: `From` is intended for infallible conversions only. Use `TryFrom` if there's a possibility for the conversion to fail.
36 note: potential failure(s)
37   --> $DIR/fallible_impl_from.rs:33:13
38    |
39 33 |             panic!();
40    |             ^^^^^^^^^
41    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
42
43 error: consider implementing `TryFrom` instead
44   --> $DIR/fallible_impl_from.rs:39:1
45    |
46 39 | / impl From<Option<String>> for Invalid {
47 40 | |     fn from(s: Option<String>) -> Invalid {
48 41 | |         let s = s.unwrap();
49 42 | |         if !s.is_empty() {
50 ...  |
51 48 | |     }
52 49 | | }
53    | |_^
54    |
55    = help: `From` is intended for infallible conversions only. Use `TryFrom` if there's a possibility for the conversion to fail.
56 note: potential failure(s)
57   --> $DIR/fallible_impl_from.rs:41:17
58    |
59 41 |         let s = s.unwrap();
60    |                 ^^^^^^^^^^
61 42 |         if !s.is_empty() {
62 43 |             panic!(42);
63    |             ^^^^^^^^^^^
64 44 |         } else if s.parse::<u32>().unwrap() != 42 {
65    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^
66 45 |             panic!("{:?}", s);
67    |             ^^^^^^^^^^^^^^^^^^
68    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
69
70 error: consider implementing `TryFrom` instead
71   --> $DIR/fallible_impl_from.rs:57:1
72    |
73 57 | / impl<'a> From<&'a mut <Box<u32> as ProjStrTrait>::ProjString> for Invalid {
74 58 | |     fn from(s: &'a mut <Box<u32> as ProjStrTrait>::ProjString) -> Invalid {
75 59 | |         if s.parse::<u32>().ok().unwrap() != 42 {
76 60 | |             panic!("{:?}", s);
77 ...  |
78 63 | |     }
79 64 | | }
80    | |_^
81    |
82    = help: `From` is intended for infallible conversions only. Use `TryFrom` if there's a possibility for the conversion to fail.
83 note: potential failure(s)
84   --> $DIR/fallible_impl_from.rs:59:12
85    |
86 59 |         if s.parse::<u32>().ok().unwrap() != 42 {
87    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
88 60 |             panic!("{:?}", s);
89    |             ^^^^^^^^^^^^^^^^^^
90    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
91
92 error: aborting due to 4 previous errors
93