1 error: consider implementing `TryFrom` instead
2 --> $DIR/fallible_impl_from.rs:5:1
4 5 | / impl From<String> for Foo {
5 6 | | fn from(s: String) -> Self {
6 7 | | Foo(s.parse().unwrap())
11 note: lint level defined here
12 --> $DIR/fallible_impl_from.rs:1:9
14 1 | #![deny(fallible_impl_from)]
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:7:13
20 7 | Foo(s.parse().unwrap())
23 error: consider implementing `TryFrom` instead
24 --> $DIR/fallible_impl_from.rs:28:1
26 28 | / impl From<usize> for Invalid {
27 29 | | 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:31:13
41 = note: this error originates in a macro outside of the current crate
43 error: consider implementing `TryFrom` instead
44 --> $DIR/fallible_impl_from.rs:37:1
46 37 | / impl From<Option<String>> for Invalid {
47 38 | | fn from(s: Option<String>) -> Invalid {
48 39 | | let s = s.unwrap();
49 40 | | 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:39:17
59 39 | let s = s.unwrap();
61 40 | if !s.is_empty() {
64 42 | } else if s.parse::<u32>().unwrap() != 42 {
65 | ^^^^^^^^^^^^^^^^^^^^^^^^^
66 43 | panic!("{:?}", s);
68 = note: this error originates in a macro outside of the current crate
70 error: consider implementing `TryFrom` instead
71 --> $DIR/fallible_impl_from.rs:55:1
73 55 | / impl<'a> From<&'a mut <Box<u32> as ProjStrTrait>::ProjString> for Invalid {
74 56 | | fn from(s: &'a mut <Box<u32> as ProjStrTrait>::ProjString) -> Invalid {
75 57 | | if s.parse::<u32>().ok().unwrap() != 42 {
76 58 | | 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:57:12
86 57 | if s.parse::<u32>().ok().unwrap() != 42 {
87 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
88 58 | panic!("{:?}", s);
90 = note: this error originates in a macro outside of the current crate