diff options
| author | Ralf Jung <post@ralfj.de> | 2025-02-18 11:31:38 +0100 |
|---|---|---|
| committer | Zachary S <zasample18+github@gmail.com> | 2025-02-20 13:41:24 -0600 |
| commit | e3f5db07e0daa833c51c335fa07d87affd8a8bf9 (patch) | |
| tree | d22d4773a9e56d07e82e707b33697b0939abf273 /compiler/rustc_const_eval/src/interpret | |
| parent | 6493cd8699cc6d55a38b5187ff4cc731f969c483 (diff) | |
| download | rust-e3f5db07e0daa833c51c335fa07d87affd8a8bf9.tar.gz rust-e3f5db07e0daa833c51c335fa07d87affd8a8bf9.zip | |
fine-tune comment
Diffstat (limited to 'compiler/rustc_const_eval/src/interpret')
| -rw-r--r-- | compiler/rustc_const_eval/src/interpret/validity.rs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/compiler/rustc_const_eval/src/interpret/validity.rs b/compiler/rustc_const_eval/src/interpret/validity.rs index 3667cc84d70..40dec0cb39e 100644 --- a/compiler/rustc_const_eval/src/interpret/validity.rs +++ b/compiler/rustc_const_eval/src/interpret/validity.rs @@ -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 - // types like `NonNull` where the `Scalar` info is more restrictive than what - // the fields say (`rustc_layout_scalar_valid_range_start`). - // But in most cases, this will just propagate what the fields say, - // and then we want the error to point at the field -- so, first recurse, - // then check ABI. + // *After* all of this, check further information stored in the layout. We need to check + // this to handle types like `NonNull` where the `Scalar` info is more restrictive than what + // the fields say (`rustc_layout_scalar_valid_range_start`). But in most cases, this will + // just propagate what the fields say, and then we want the error to point at the field -- + // so, we first recurse, then we do this check. // // 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 |
