@@ -13,6 +13,7 @@ use rustc::session::Session;
13
13
use rustc:: ty:: TyCtxt ;
14
14
use rustc:: util:: common:: time;
15
15
use rustc_data_structures:: fx:: FxHashMap ;
16
+ use rustc_data_structures:: sync:: join;
16
17
use rustc_serialize:: Encodable as RustcEncodable ;
17
18
use rustc_serialize:: opaque:: Encoder ;
18
19
use std:: io:: { self , Cursor } ;
@@ -33,13 +34,15 @@ pub fn save_dep_graph<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) {
33
34
return ;
34
35
}
35
36
36
- time ( sess. time_passes ( ) , "persist query result cache" , || {
37
- save_in ( sess,
38
- query_cache_path ( sess) ,
39
- |e| encode_query_cache ( tcx, e) ) ;
40
- } ) ;
41
-
42
- if tcx. sess . opts . debugging_opts . incremental_queries {
37
+ join ( || {
38
+ if tcx. sess . opts . debugging_opts . incremental_queries {
39
+ time ( sess. time_passes ( ) , "persist query result cache" , || {
40
+ save_in ( sess,
41
+ query_cache_path ( sess) ,
42
+ |e| encode_query_cache ( tcx, e) ) ;
43
+ } ) ;
44
+ }
45
+ } , || {
43
46
time ( sess. time_passes ( ) , "persist dep-graph" , || {
44
47
save_in ( sess,
45
48
dep_graph_path ( sess) ,
@@ -49,7 +52,7 @@ pub fn save_dep_graph<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) {
49
52
} )
50
53
} ) ;
51
54
} ) ;
52
- }
55
+ } ) ;
53
56
54
57
dirty_clean:: check_dirty_clean_annotations ( tcx) ;
55
58
} )
0 commit comments