File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -23,13 +23,13 @@ impl PredecessorCache {
2323 }
2424
2525 /// Invalidates the predecessor cache.
26- ///
27- /// Invalidating the predecessor cache requires mutating the MIR, which in turn requires a
28- /// unique reference (`&mut`) to the `mir::Body`. Because of this, we can assume that all
29- /// callers of `invalidate` have a unique reference to the MIR and thus to the predecessor
30- /// cache. This means we never need to do synchronization when `invalidate` is called.
3126 #[ inline]
3227 pub ( super ) fn invalidate ( & mut self ) {
28+ // Invalidating the predecessor cache requires mutating the MIR, which in turn requires a
29+ // unique reference (`&mut`) to the `mir::Body`. Because of this, we can assume that all
30+ // callers of `invalidate` have a unique reference to the MIR and thus to the predecessor
31+ // cache. This means we never need to do synchronization when `invalidate` is called, we can
32+ // simply reinitialize the `OnceCell`.
3333 self . cache = OnceCell :: new ( ) ;
3434 }
3535
You can’t perform that action at this time.
0 commit comments