Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit e1aaf77

Browse files
authored
Unrolled build for rust-lang#122654
Rollup merge of rust-lang#122654 - RalfJung:interpret-comment, r=matthiaskrgr interpret/memory: explain why we use == on bool This came up in rust-lang#122636.
2 parents 80e5694 + 872781b commit e1aaf77

File tree

1 file changed

+2
-0
lines changed
  • compiler/rustc_const_eval/src/interpret

1 file changed

+2
-0
lines changed

compiler/rustc_const_eval/src/interpret/memory.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -949,6 +949,8 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
949949
/// Runs the close in "validation" mode, which means the machine's memory read hooks will be
950950
/// suppressed. Needless to say, this must only be set with great care! Cannot be nested.
951951
pub(super) fn run_for_validation<R>(&self, f: impl FnOnce() -> R) -> R {
952+
// This deliberately uses `==` on `bool` to follow the pattern
953+
// `assert!(val.replace(new) == old)`.
952954
assert!(
953955
self.memory.validation_in_progress.replace(true) == false,
954956
"`validation_in_progress` was already set"

0 commit comments

Comments
 (0)