@@ -81,35 +81,31 @@ LL + let _: i64 = i32::into(0i32);
81
81
error: use of a fallible conversion when an infallible one could be used
82
82
--> $DIR/unnecessary_fallible_conversions.rs:13:13
83
83
|
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
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
88
86
|
89
87
= note: converting `i32` to `i64` cannot fail
90
88
help: use
91
89
|
92
- LL - let _ = <i64 as TryFrom<i32>>::try_from(0)
90
+ LL - let _ = <i64 as TryFrom<i32>>::try_from(0).unwrap();
93
91
LL + let _ = <i64 as From<i32>>::from(0);
94
92
|
95
93
96
94
error: 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
98
96
|
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
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
103
99
|
104
100
= note: converting `i32` to `i64` cannot fail
105
101
help: use
106
102
|
107
- LL - let _ = <i64 as TryFrom<i32>>::try_from(0).
103
+ LL - let _ = <i64 as TryFrom<i32>>::try_from(0).expect("can't happen");
108
104
LL + let _ = <i64 as From<i32>>::from(0);
109
105
|
110
106
111
107
error: 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
113
109
|
114
110
LL | let _: i64 = <i32 as TryInto<_>>::try_into(0).unwrap();
115
111
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -122,7 +118,7 @@ LL + let _: i64 = <i32 as Into<_>>::into(0);
122
118
|
123
119
124
120
error: 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
126
122
|
127
123
LL | let _: i64 = <i32 as TryInto<_>>::try_into(0).expect("can't happen");
128
124
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
0 commit comments