File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 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> {
37893789}
37903790
37913791impl < ' tcx > SelectionCache < ' tcx > {
3792+ /// Actually frees the underlying memory in contrast to what stdlib containers do on `clear`
37923793 pub fn clear ( & self ) {
3793- self . hashmap . borrow_mut ( ) . clear ( ) ;
3794+ * self . hashmap . borrow_mut ( ) = Default :: default ( ) ;
37943795 }
37953796}
37963797
37973798impl < ' tcx > EvaluationCache < ' tcx > {
3799+ /// Actually frees the underlying memory in contrast to what stdlib containers do on `clear`
37983800 pub fn clear ( & self ) {
3799- self . hashmap . borrow_mut ( ) . clear ( ) ;
3801+ * self . hashmap . borrow_mut ( ) = Default :: default ( ) ;
38003802 }
38013803}
38023804
Original file line number Diff line number Diff line change @@ -398,7 +398,8 @@ impl Handler {
398398 /// tools that want to reuse a `Parser` cleaning the previously emitted diagnostics as well as
399399 /// the overall count of emitted error diagnostics.
400400 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 ( ) ;
402403 self . err_count . store ( 0 , SeqCst ) ;
403404 }
404405
You can’t perform that action at this time.
0 commit comments