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 | bd8e565e16b43e2e68a67804d20992218579ac9d (patch) | |
| tree | 5d56c89a7c826097856d082ce0084691601118d5 /src/tools/clippy/clippy_lints | |
| parent | 7531eafa7e20eed36c8738e45790d4a82b702162 (diff) | |
| download | rust-bd8e565e16b43e2e68a67804d20992218579ac9d.tar.gz rust-bd8e565e16b43e2e68a67804d20992218579ac9d.zip | |
Use generic `NonZero`.
Diffstat (limited to 'src/tools/clippy/clippy_lints')
| -rw-r--r-- | src/tools/clippy/clippy_lints/src/transmute/eager_transmute.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tools/clippy/clippy_lints/src/transmute/eager_transmute.rs b/src/tools/clippy/clippy_lints/src/transmute/eager_transmute.rs index c44f5150dd1..1dfc9f7091e 100644 --- a/src/tools/clippy/clippy_lints/src/transmute/eager_transmute.rs +++ b/src/tools/clippy/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) { |
