diff options
| author | Markus Reiter <me@reitermark.us> | 2024-04-21 21:45:18 +0200 |
|---|---|---|
| committer | Markus Reiter <me@reitermark.us> | 2024-05-08 21:37:55 +0200 |
| commit | d32629891ababfdf1a5f8fe9e12daab8d6797c05 (patch) | |
| tree | 0cb6c41ec566e55488f1e1c93fd4b1acac5a41dd /clippy_lints | |
| parent | 7ad336f3a8948bd7a52cf02944c70280713e76dc (diff) | |
| download | rust-d32629891ababfdf1a5f8fe9e12daab8d6797c05.tar.gz rust-d32629891ababfdf1a5f8fe9e12daab8d6797c05.zip | |
Use generic `NonZero`.
Diffstat (limited to 'clippy_lints')
| -rw-r--r-- | clippy_lints/src/transmute/eager_transmute.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clippy_lints/src/transmute/eager_transmute.rs b/clippy_lints/src/transmute/eager_transmute.rs index c44f5150dd1..1dfc9f7091e 100644 --- a/clippy_lints/src/transmute/eager_transmute.rs +++ b/clippy_lints/src/transmute/eager_transmute.rs @@ -87,7 +87,7 @@ pub(super) fn check<'tcx>( && is_normalizable(cx, cx.param_env, from_ty) && is_normalizable(cx, cx.param_env, to_ty) // we only want to lint if the target type has a niche that is larger than the one of the source type - // e.g. `u8` to `NonZeroU8` should lint, but `NonZeroU8` to `u8` should not + // e.g. `u8` to `NonZero<u8>` should lint, but `NonZero<u8>` to `u8` should not && let Ok(from_layout) = cx.tcx.layout_of(cx.param_env.and(from_ty)) && let Ok(to_layout) = cx.tcx.layout_of(cx.param_env.and(to_ty)) && match (from_layout.largest_niche, to_layout.largest_niche) { |
