2023-10-14 17:57:33 -05:00
|
|
|
error: use of a fallible conversion when an infallible one could be used
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/unnecessary_fallible_conversions_unfixable.rs:27:34
|
2023-10-14 17:57:33 -05:00
|
|
|
|
|
|
|
|
LL | let _: Result<Foo, _> = 0i64.try_into();
|
|
|
|
| ^^^^^^^^ help: use: `into`
|
|
|
|
|
|
2023-11-07 09:01:52 -06:00
|
|
|
= note: converting `i64` to `Foo` cannot fail
|
2023-10-14 17:57:33 -05:00
|
|
|
= note: `-D clippy::unnecessary-fallible-conversions` implied by `-D warnings`
|
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::unnecessary_fallible_conversions)]`
|
|
|
|
|
|
|
|
error: use of a fallible conversion when an infallible one could be used
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/unnecessary_fallible_conversions_unfixable.rs:29:29
|
2023-10-14 17:57:33 -05:00
|
|
|
|
|
|
|
|
LL | let _: Result<Foo, _> = i64::try_into(0i64);
|
|
|
|
| ^^^^^^^^^^^^^ help: use: `Into::into`
|
2023-11-07 09:01:52 -06:00
|
|
|
|
|
|
|
|
= note: converting `i64` to `Foo` cannot fail
|
2023-10-14 17:57:33 -05:00
|
|
|
|
|
|
|
error: use of a fallible conversion when an infallible one could be used
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/unnecessary_fallible_conversions_unfixable.rs:31:29
|
2023-10-14 17:57:33 -05:00
|
|
|
|
|
|
|
|
LL | let _: Result<Foo, _> = Foo::try_from(0i64);
|
|
|
|
| ^^^^^^^^^^^^^ help: use: `From::from`
|
2023-11-07 09:01:52 -06:00
|
|
|
|
|
|
|
|
= note: converting `i64` to `Foo` cannot fail
|
2023-10-14 17:57:33 -05:00
|
|
|
|
|
|
|
error: use of a fallible conversion when an infallible one could be used
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/unnecessary_fallible_conversions_unfixable.rs:34:34
|
2023-10-14 17:57:33 -05:00
|
|
|
|
|
|
|
|
LL | let _: Result<i64, _> = 0i32.try_into();
|
|
|
|
| ^^^^^^^^ help: use: `into`
|
2023-11-07 09:01:52 -06:00
|
|
|
|
|
|
|
|
= note: converting `i32` to `i64` cannot fail
|
2023-10-14 17:57:33 -05:00
|
|
|
|
|
|
|
error: use of a fallible conversion when an infallible one could be used
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/unnecessary_fallible_conversions_unfixable.rs:36:29
|
2023-10-14 17:57:33 -05:00
|
|
|
|
|
|
|
|
LL | let _: Result<i64, _> = i32::try_into(0i32);
|
|
|
|
| ^^^^^^^^^^^^^ help: use: `Into::into`
|
2023-11-07 09:01:52 -06:00
|
|
|
|
|
|
|
|
= note: converting `i32` to `i64` cannot fail
|
2023-10-14 17:57:33 -05:00
|
|
|
|
|
|
|
error: use of a fallible conversion when an infallible one could be used
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/unnecessary_fallible_conversions_unfixable.rs:38:29
|
2023-10-14 17:57:33 -05:00
|
|
|
|
|
|
|
|
LL | let _: Result<i64, _> = <_>::try_from(0i32);
|
|
|
|
| ^^^^^^^^^^^^^ help: use: `From::from`
|
2023-11-07 09:01:52 -06:00
|
|
|
|
|
|
|
|
= note: converting `i32` to `i64` cannot fail
|
2023-10-14 17:57:33 -05:00
|
|
|
|
|
|
|
error: aborting due to 6 previous errors
|
|
|
|
|