@@ -81,35 +81,31 @@ LL + let _: i64 = i32::into(0i32);
8181error: use of a fallible conversion when an infallible one could be used
8282 --> $DIR/unnecessary_fallible_conversions.rs:13:13
8383 |
84- LL | let _ = <i64 as TryFrom<i32>>::try_from(0)
85- | _____________^
86- LL | | .unwrap();
87- | |_________________^
84+ LL | let _ = <i64 as TryFrom<i32>>::try_from(0).unwrap();
85+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8886 |
8987 = note: converting `i32` to `i64` cannot fail
9088help: use
9189 |
92- LL - let _ = <i64 as TryFrom<i32>>::try_from(0)
90+ LL - let _ = <i64 as TryFrom<i32>>::try_from(0).unwrap();
9391LL + let _ = <i64 as From<i32>>::from(0);
9492 |
9593
9694error: use of a fallible conversion when an infallible one could be used
97- --> $DIR/unnecessary_fallible_conversions.rs:15 :13
95+ --> $DIR/unnecessary_fallible_conversions.rs:14 :13
9896 |
99- LL | let _ = <i64 as TryFrom<i32>>::try_from(0).
100- | _____________^
101- LL | | expect("can't happen");
102- | |______________________________^
97+ LL | let _ = <i64 as TryFrom<i32>>::try_from(0).expect("can't happen");
98+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
10399 |
104100 = note: converting `i32` to `i64` cannot fail
105101help: use
106102 |
107- LL - let _ = <i64 as TryFrom<i32>>::try_from(0).
103+ LL - let _ = <i64 as TryFrom<i32>>::try_from(0).expect("can't happen");
108104LL + let _ = <i64 as From<i32>>::from(0);
109105 |
110106
111107error: use of a fallible conversion when an infallible one could be used
112- --> $DIR/unnecessary_fallible_conversions.rs:18 :18
108+ --> $DIR/unnecessary_fallible_conversions.rs:16 :18
113109 |
114110LL | let _: i64 = <i32 as TryInto<_>>::try_into(0).unwrap();
115111 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -122,7 +118,7 @@ LL + let _: i64 = <i32 as Into<_>>::into(0);
122118 |
123119
124120error: use of a fallible conversion when an infallible one could be used
125- --> $DIR/unnecessary_fallible_conversions.rs:19 :18
121+ --> $DIR/unnecessary_fallible_conversions.rs:17 :18
126122 |
127123LL | let _: i64 = <i32 as TryInto<_>>::try_into(0).expect("can't happen");
128124 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
0 commit comments