2024-07-26 07:46:08 -05:00
|
|
|
error: consider using `NonZeroU64::from()` for more efficient and type-safe conversion
|
2024-08-01 06:59:07 -05:00
|
|
|
--> tests/ui/non_zero_suggestions.rs:9:18
|
2024-07-26 06:41:51 -05:00
|
|
|
|
|
|
|
|
LL | let r1 = x / u64::from(y.get());
|
2024-07-26 07:46:08 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^ help: replace with: `NonZeroU64::from(y)`
|
2024-07-26 06:41:51 -05:00
|
|
|
|
|
|
|
|
= note: `-D clippy::non-zero-suggestions` implied by `-D warnings`
|
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::non_zero_suggestions)]`
|
|
|
|
|
2024-07-26 07:46:08 -05:00
|
|
|
error: consider using `NonZeroU64::from()` for more efficient and type-safe conversion
|
2024-08-01 06:59:07 -05:00
|
|
|
--> tests/ui/non_zero_suggestions.rs:12:18
|
2024-07-26 06:41:51 -05:00
|
|
|
|
|
|
|
|
LL | let r2 = x % u64::from(y.get());
|
2024-07-26 07:46:08 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^ help: replace with: `NonZeroU64::from(y)`
|
2024-07-26 06:41:51 -05:00
|
|
|
|
2024-07-26 07:46:08 -05:00
|
|
|
error: consider using `NonZeroU32::from()` for more efficient and type-safe conversion
|
2024-08-01 06:59:07 -05:00
|
|
|
--> tests/ui/non_zero_suggestions.rs:18:18
|
2024-07-26 06:41:51 -05:00
|
|
|
|
|
|
|
|
LL | let r3 = a / u32::from(b.get());
|
2024-07-26 07:46:08 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^ help: replace with: `NonZeroU32::from(b)`
|
2024-07-26 06:41:51 -05:00
|
|
|
|
2024-07-26 07:46:08 -05:00
|
|
|
error: consider using `NonZeroU64::from()` for more efficient and type-safe conversion
|
2024-08-01 06:59:07 -05:00
|
|
|
--> tests/ui/non_zero_suggestions.rs:21:13
|
2024-07-26 06:41:51 -05:00
|
|
|
|
|
2024-08-01 06:59:07 -05:00
|
|
|
LL | let x = u64::from(NonZeroU32::new(5).unwrap().get());
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `NonZeroU64::from(NonZeroU32::new(5).unwrap())`
|
2024-07-26 06:41:51 -05:00
|
|
|
|
2024-07-26 07:46:08 -05:00
|
|
|
error: consider using `NonZeroU64::from()` for more efficient and type-safe conversion
|
2024-08-01 06:59:07 -05:00
|
|
|
--> tests/ui/non_zero_suggestions.rs:52:9
|
2024-07-26 06:41:51 -05:00
|
|
|
|
|
|
|
|
LL | x / u64::from(y.get())
|
2024-07-26 07:46:08 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^ help: replace with: `NonZeroU64::from(y)`
|
2024-07-26 06:41:51 -05:00
|
|
|
|
2024-07-26 07:46:08 -05:00
|
|
|
error: consider using `NonZeroU64::from()` for more efficient and type-safe conversion
|
2024-08-01 06:59:07 -05:00
|
|
|
--> tests/ui/non_zero_suggestions.rs:62:22
|
2024-07-26 06:41:51 -05:00
|
|
|
|
|
|
|
|
LL | self.value / u64::from(divisor.get())
|
2024-07-26 07:46:08 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `NonZeroU64::from(divisor)`
|
2024-07-26 06:41:51 -05:00
|
|
|
|
2024-08-01 06:59:07 -05:00
|
|
|
error: aborting due to 6 previous errors
|
2024-07-26 06:41:51 -05:00
|
|
|
|