2024-07-26 12:46:08 +00:00
|
|
|
error: consider using `NonZeroU64::from()` for more efficient and type-safe conversion
|
2024-07-26 21:45:40 +00:00
|
|
|
--> tests/ui/non_zero_suggestions.rs:10:18
|
2024-07-26 11:41:51 +00:00
|
|
|
|
|
|
|
|
LL | let r1 = x / u64::from(y.get());
|
2024-07-26 12:46:08 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^ help: replace with: `NonZeroU64::from(y)`
|
2024-07-26 11:41:51 +00: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 12:46:08 +00:00
|
|
|
error: consider using `NonZeroU64::from()` for more efficient and type-safe conversion
|
2024-07-26 21:45:40 +00:00
|
|
|
--> tests/ui/non_zero_suggestions.rs:13:18
|
2024-07-26 11:41:51 +00:00
|
|
|
|
|
|
|
|
LL | let r2 = x % u64::from(y.get());
|
2024-07-26 12:46:08 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^ help: replace with: `NonZeroU64::from(y)`
|
2024-07-26 11:41:51 +00:00
|
|
|
|
2024-07-26 12:46:08 +00:00
|
|
|
error: consider using `NonZeroU32::from()` for more efficient and type-safe conversion
|
2024-07-26 21:45:40 +00:00
|
|
|
--> tests/ui/non_zero_suggestions.rs:19:18
|
2024-07-26 11:41:51 +00:00
|
|
|
|
|
|
|
|
LL | let r3 = a / u32::from(b.get());
|
2024-07-26 12:46:08 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^ help: replace with: `NonZeroU32::from(b)`
|
2024-07-26 11:41:51 +00:00
|
|
|
|
2024-07-26 12:46:08 +00:00
|
|
|
error: consider using `NonZeroI16::from()` for more efficient and type-safe conversion
|
2024-07-26 21:45:40 +00:00
|
|
|
--> tests/ui/non_zero_suggestions.rs:25:14
|
2024-07-26 11:41:51 +00:00
|
|
|
|
|
|
|
|
LL | let r4 = i16::from(d.get());
|
2024-07-26 12:46:08 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^ help: replace with: `NonZeroI16::from(d)`
|
2024-07-26 11:41:51 +00:00
|
|
|
|
2024-07-26 12:46:08 +00:00
|
|
|
error: consider using `NonZeroU64::from()` for more efficient and type-safe conversion
|
2024-07-26 21:45:40 +00:00
|
|
|
--> tests/ui/non_zero_suggestions.rs:31:18
|
2024-07-26 11:41:51 +00:00
|
|
|
|
|
|
|
|
LL | let r5 = m / u64::from(n.get());
|
2024-07-26 12:46:08 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^ help: replace with: `NonZeroU64::from(n)`
|
2024-07-26 11:41:51 +00:00
|
|
|
|
2024-07-26 12:46:08 +00:00
|
|
|
error: consider using `NonZeroU64::from()` for more efficient and type-safe conversion
|
2024-07-26 21:45:40 +00:00
|
|
|
--> tests/ui/non_zero_suggestions.rs:37:14
|
2024-07-26 11:41:51 +00:00
|
|
|
|
|
|
|
|
LL | let r6 = u64::from(max_u32.get());
|
2024-07-26 12:46:08 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `NonZeroU64::from(max_u32)`
|
2024-07-26 11:41:51 +00:00
|
|
|
|
2024-07-26 12:46:08 +00:00
|
|
|
error: consider using `NonZeroU64::from()` for more efficient and type-safe conversion
|
2024-07-26 21:45:40 +00:00
|
|
|
--> tests/ui/non_zero_suggestions.rs:41:13
|
2024-07-26 11:41:51 +00:00
|
|
|
|
|
|
|
|
LL | let _ = u64::from(NonZeroU32::new(10).unwrap().get());
|
2024-07-26 12:46:08 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `NonZeroU64::from(NonZeroU32::new(10).unwrap())`
|
2024-07-26 11:41:51 +00:00
|
|
|
|
2024-07-26 12:46:08 +00:00
|
|
|
error: consider using `NonZeroU64::from()` for more efficient and type-safe conversion
|
2024-07-26 21:45:40 +00:00
|
|
|
--> tests/ui/non_zero_suggestions.rs:63:9
|
2024-07-26 11:41:51 +00:00
|
|
|
|
|
|
|
|
LL | x / u64::from(y.get())
|
2024-07-26 12:46:08 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^ help: replace with: `NonZeroU64::from(y)`
|
2024-07-26 11:41:51 +00:00
|
|
|
|
2024-07-26 12:46:08 +00:00
|
|
|
error: consider using `NonZeroU64::from()` for more efficient and type-safe conversion
|
2024-07-26 21:45:40 +00:00
|
|
|
--> tests/ui/non_zero_suggestions.rs:68:5
|
|
|
|
|
|
|
|
|
LL | u64::from(y.get())
|
|
|
|
| ^^^^^^^^^^^^^^^^^^ help: replace with: `NonZeroU64::from(y)`
|
|
|
|
|
|
|
|
error: consider using `NonZeroU64::from()` for more efficient and type-safe conversion
|
|
|
|
--> tests/ui/non_zero_suggestions.rs:80:22
|
2024-07-26 11:41:51 +00:00
|
|
|
|
|
|
|
|
LL | self.value / u64::from(divisor.get())
|
2024-07-26 12:46:08 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `NonZeroU64::from(divisor)`
|
2024-07-26 11:41:51 +00:00
|
|
|
|
2024-07-26 21:45:40 +00:00
|
|
|
error: aborting due to 10 previous errors
|
2024-07-26 11:41:51 +00:00
|
|
|
|