Skip to content

Commit 26b9146

Browse files
Rename is_empty to has_been_invoked
1 parent 37844e5 commit 26b9146

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/librustc_mir/const_eval.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ impl<'mir, 'tcx> interpret::Machine<'mir, 'tcx> for CompileTimeInterpreter<'mir,
517517
// Emit a warning if this is the first time we have triggered the loop detector. This means
518518
// we have been executing for quite some time.
519519
let span = ecx.frame().span;
520-
if ecx.machine.loop_detector.is_empty() {
520+
if !ecx.machine.loop_detector.has_been_invoked() {
521521
// FIXME(#49980): make this warning a lint
522522
ecx.tcx.sess.span_warn(span,
523523
"Constant evaluating a complex constant, this might take some time");

src/librustc_mir/interpret/snapshot.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,8 @@ impl<'mir, 'tcx> InfiniteLoopDetector<'mir, 'tcx> {
111111
throw_exhaust!(InfiniteLoop)
112112
}
113113

114-
/// Returns `true` if the `InfiniteLoopDetector` has not yet been invoked.
115-
pub fn is_empty(&self) -> bool {
116-
self.hashes.is_empty()
114+
pub fn has_been_invoked(&self) -> bool {
115+
!self.hashes.is_empty()
117116
}
118117
}
119118

0 commit comments

Comments
 (0)