@@ -148,14 +148,14 @@ type EvalSnapshot<'a, 'mir, 'tcx, M>
148148pub ( crate ) struct InfiniteLoopDetector < ' a , ' mir , ' tcx : ' a + ' mir , M : Machine < ' mir , ' tcx > > {
149149 /// The set of all `EvalSnapshot` *hashes* observed by this detector.
150150 ///
151- /// Not a proper bloom filter .
152- bloom : FxHashSet < u64 > ,
151+ /// When a collision occurs in this table, we store the full snapshot in `snapshots` .
152+ hashes : FxHashSet < u64 > ,
153153
154154 /// The set of all `EvalSnapshot`s observed by this detector.
155155 ///
156- /// An `EvalSnapshot` will only be fully cloned once it has caused a collision
157- /// in `bloom`. As a result, the detector must observe *two* full cycles of
158- /// an infinite loop before it triggers.
156+ /// An `EvalSnapshot` will only be fully cloned once it has caused a collision in `hashes`. As
157+ /// a result, the detector must observe at least *two* full cycles of an infinite loop before
158+ /// it triggers.
159159 snapshots : FxHashSet < EvalSnapshot < ' a , ' mir , ' tcx , M > > ,
160160}
161161
@@ -165,7 +165,7 @@ impl<'a, 'mir, 'tcx, M> Default for InfiniteLoopDetector<'a, 'mir, 'tcx, M>
165165{
166166 fn default ( ) -> Self {
167167 InfiniteLoopDetector {
168- bloom : FxHashSet :: default ( ) ,
168+ hashes : FxHashSet :: default ( ) ,
169169 snapshots : FxHashSet :: default ( ) ,
170170 }
171171 }
@@ -177,7 +177,7 @@ impl<'a, 'mir, 'tcx, M> InfiniteLoopDetector<'a, 'mir, 'tcx, M>
177177{
178178 /// Returns `true` if the loop detector has not yet observed a snapshot.
179179 pub fn is_empty ( & self ) -> bool {
180- self . bloom . is_empty ( )
180+ self . hashes . is_empty ( )
181181 }
182182
183183 pub fn observe_and_analyze (
@@ -192,7 +192,7 @@ impl<'a, 'mir, 'tcx, M> InfiniteLoopDetector<'a, 'mir, 'tcx, M>
192192 snapshot. hash ( & mut fx) ;
193193 let hash = fx. finish ( ) ;
194194
195- if self . bloom . insert ( hash) {
195+ if self . hashes . insert ( hash) {
196196 // No collision
197197 return Ok ( ( ) )
198198 }
0 commit comments