1
Fork 0

Auto merge of #121885 - reitermarkus:generic-nonzero-inner, r=oli-obk,wesleywiser

Move generic `NonZero` `rustc_layout_scalar_valid_range_start` attribute to inner type.

Tracking issue: https://github.com/rust-lang/rust/issues/120257

r? `@dtolnay`
This commit is contained in:
bors 2024-03-17 02:27:52 +00:00
commit a615cea333
110 changed files with 1841 additions and 1816 deletions

View file

@ -2468,6 +2468,8 @@ impl<'tcx> LateLintPass<'tcx> for InvalidValue {
ty: Ty<'tcx>,
init: InitKind,
) -> Option<InitError> {
let ty = cx.tcx.try_normalize_erasing_regions(cx.param_env, ty).unwrap_or(ty);
use rustc_type_ir::TyKind::*;
match ty.kind() {
// Primitive types that don't like 0 as a value.