fine-tune comment

This commit is contained in:
Ralf Jung 2025-02-18 11:31:38 +01:00 committed by Zachary S
parent 6493cd8699
commit e3f5db07e0

View file

@ -1264,12 +1264,11 @@ impl<'rt, 'tcx, M: Machine<'tcx>> ValueVisitor<'tcx, M> for ValidityVisitor<'rt,
} }
} }
// *After* all of this, check the ABI. We need to check the ABI to handle // *After* all of this, check further information stored in the layout. We need to check
// types like `NonNull` where the `Scalar` info is more restrictive than what // this to handle types like `NonNull` where the `Scalar` info is more restrictive than what
// the fields say (`rustc_layout_scalar_valid_range_start`). // the fields say (`rustc_layout_scalar_valid_range_start`). But in most cases, this will
// But in most cases, this will just propagate what the fields say, // just propagate what the fields say, and then we want the error to point at the field --
// and then we want the error to point at the field -- so, first recurse, // so, we first recurse, then we do this check.
// then check ABI.
// //
// FIXME: We could avoid some redundant checks here. For newtypes wrapping // FIXME: We could avoid some redundant checks here. For newtypes wrapping
// scalars, we do the same check on every "level" (e.g., first we check // scalars, we do the same check on every "level" (e.g., first we check