@@ -351,11 +351,13 @@ impl<'sess> OnDiskCache<'sess> {
351
351
/// Store a diagnostic emitted during the current compilation session.
352
352
/// Anything stored like this will be available via `load_diagnostics` in
353
353
/// the next compilation session.
354
+ #[ inline( never) ]
355
+ #[ cold]
354
356
pub fn store_diagnostics ( & self ,
355
357
dep_node_index : DepNodeIndex ,
356
- diagnostics : Vec < Diagnostic > ) {
358
+ diagnostics : Box < Vec < Diagnostic > > ) {
357
359
let mut current_diagnostics = self . current_diagnostics . borrow_mut ( ) ;
358
- let prev = current_diagnostics. insert ( dep_node_index, diagnostics) ;
360
+ let prev = current_diagnostics. insert ( dep_node_index, * diagnostics) ;
359
361
debug_assert ! ( prev. is_none( ) ) ;
360
362
}
361
363
@@ -377,13 +379,15 @@ impl<'sess> OnDiskCache<'sess> {
377
379
/// Since many anonymous queries can share the same `DepNode`, we aggregate
378
380
/// them -- as opposed to regular queries where we assume that there is a
379
381
/// 1:1 relationship between query-key and `DepNode`.
382
+ #[ inline( never) ]
383
+ #[ cold]
380
384
pub fn store_diagnostics_for_anon_node ( & self ,
381
385
dep_node_index : DepNodeIndex ,
382
- mut diagnostics : Vec < Diagnostic > ) {
386
+ mut diagnostics : Box < Vec < Diagnostic > > ) {
383
387
let mut current_diagnostics = self . current_diagnostics . borrow_mut ( ) ;
384
388
385
389
let x = current_diagnostics. entry ( dep_node_index) . or_insert_with ( || {
386
- mem:: replace ( & mut diagnostics, Vec :: new ( ) )
390
+ mem:: replace ( & mut * diagnostics, Vec :: new ( ) )
387
391
} ) ;
388
392
389
393
x. extend ( diagnostics. into_iter ( ) ) ;
0 commit comments