File tree 2 files changed +6
-3
lines changed 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -3789,14 +3789,16 @@ impl<'tcx> TraitObligation<'tcx> {
3789
3789
}
3790
3790
3791
3791
impl < ' tcx > SelectionCache < ' tcx > {
3792
+ /// Actually frees the underlying memory in contrast to what stdlib containers do on `clear`
3792
3793
pub fn clear ( & self ) {
3793
- self . hashmap . borrow_mut ( ) . clear ( ) ;
3794
+ * self . hashmap . borrow_mut ( ) = Default :: default ( ) ;
3794
3795
}
3795
3796
}
3796
3797
3797
3798
impl < ' tcx > EvaluationCache < ' tcx > {
3799
+ /// Actually frees the underlying memory in contrast to what stdlib containers do on `clear`
3798
3800
pub fn clear ( & self ) {
3799
- self . hashmap . borrow_mut ( ) . clear ( ) ;
3801
+ * self . hashmap . borrow_mut ( ) = Default :: default ( ) ;
3800
3802
}
3801
3803
}
3802
3804
Original file line number Diff line number Diff line change @@ -398,7 +398,8 @@ impl Handler {
398
398
/// tools that want to reuse a `Parser` cleaning the previously emitted diagnostics as well as
399
399
/// the overall count of emitted error diagnostics.
400
400
pub fn reset_err_count ( & self ) {
401
- self . emitted_diagnostics . borrow_mut ( ) . clear ( ) ;
401
+ // actually frees the underlying memory (which `clear` would not do)
402
+ * self . emitted_diagnostics . borrow_mut ( ) = Default :: default ( ) ;
402
403
self . err_count . store ( 0 , SeqCst ) ;
403
404
}
404
405
You can’t perform that action at this time.
0 commit comments