Skip to content

Commit 660cc37

Browse files
committed
Some comment nits
1 parent 8af9c26 commit 660cc37

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

compiler/rustc_const_eval/src/interpret/validity.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,9 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValidityVisitor<'rt, 'mir, '
476476
// and that static refers back to us (potentially through a promoted).
477477
// This could miss some UB, but that's fine.
478478
// We still walk nested allocations, as they are fundamentally part of this validation run.
479+
// This means we will also recurse into nested statics of *other*
480+
// statics, even though we do not recurse into other statics directly.
481+
// That's somewhat inconsistent but harmless.
479482
skip_recursive_check = !nested;
480483
}
481484
Some(CtfeValidationMode::Const { .. }) => {
@@ -709,8 +712,6 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValidityVisitor<'rt, 'mir, '
709712
if let Some(mplace) = op.as_mplace_or_imm().left() {
710713
if let Some(alloc_id) = mplace.ptr().provenance.and_then(|p| p.get_alloc_id()) {
711714
let mutability = match self.ecx.tcx.global_alloc(alloc_id) {
712-
// This can only ever be the static currently being evaluated (or one of its nested allocations), as
713-
// we do not walk into other statics. See `check_safe_pointer` for details.
714715
GlobalAlloc::Static(did) => {
715716
let DefKind::Static { mutability, nested } = self.ecx.tcx.def_kind(did)
716717
else {

0 commit comments

Comments
 (0)