1 error: consider implementing `TryFrom` instead
2 --> $DIR/fallible_impl_from.rs:17:1
4 17 | / impl From<String> for Foo {
5 18 | | fn from(s: String) -> Self {
6 19 | | Foo(s.parse().unwrap())
11 note: lint level defined here
12 --> $DIR/fallible_impl_from.rs:13:9
14 13 | #![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:19:13
20 19 | Foo(s.parse().unwrap())
23 error: consider implementing `TryFrom` instead
24 --> $DIR/fallible_impl_from.rs:40:1
26 40 | / impl From<usize> for Invalid {
27 41 | | fn from(i: usize) -> Invalid {
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:43:13
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)
43 error: consider implementing `TryFrom` instead
44 --> $DIR/fallible_impl_from.rs:49:1
46 49 | / impl From<Option<String>> for Invalid {
47 50 | | fn from(s: Option<String>) -> Invalid {
48 51 | | let s = s.unwrap();
49 52 | | if !s.is_empty() {
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:51:17
59 51 | let s = s.unwrap();
61 52 | if !s.is_empty() {
64 54 | } else if s.parse::<u32>().unwrap() != 42 {
65 | ^^^^^^^^^^^^^^^^^^^^^^^^^
66 55 | panic!("{:?}", s);
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)
70 error: consider implementing `TryFrom` instead
71 --> $DIR/fallible_impl_from.rs:67:1
73 67 | / impl<'a> From<&'a mut <Box<u32> as ProjStrTrait>::ProjString> for Invalid {
74 68 | | fn from(s: &'a mut <Box<u32> as ProjStrTrait>::ProjString) -> Invalid {
75 69 | | if s.parse::<u32>().ok().unwrap() != 42 {
76 70 | | panic!("{:?}", s);
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:69:12
86 69 | if s.parse::<u32>().ok().unwrap() != 42 {
87 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
88 70 | panic!("{:?}", s);
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)
92 error: aborting due to 4 previous errors