@@ -85,7 +85,6 @@ pub struct Queries<'tcx> {
85
85
hir_arena : WorkerLocal < rustc_hir:: Arena < ' tcx > > ,
86
86
87
87
parse : Query < ast:: Crate > ,
88
- pre_configure : Query < ( ast:: Crate , ast:: AttrVec ) > ,
89
88
// This just points to what's in `gcx_cell`.
90
89
gcx : Query < & ' tcx GlobalCtxt < ' tcx > > ,
91
90
}
@@ -98,7 +97,6 @@ impl<'tcx> Queries<'tcx> {
98
97
arena : WorkerLocal :: new ( |_| Arena :: default ( ) ) ,
99
98
hir_arena : WorkerLocal :: new ( |_| rustc_hir:: Arena :: default ( ) ) ,
100
99
parse : Default :: default ( ) ,
101
- pre_configure : Default :: default ( ) ,
102
100
gcx : Default :: default ( ) ,
103
101
}
104
102
}
@@ -113,12 +111,12 @@ impl<'tcx> Queries<'tcx> {
113
111
} )
114
112
}
115
113
116
- #[ deprecated = "pre_configure may be made private in the future. If you need it please open an issue with your use case." ]
117
- pub fn pre_configure ( & self ) -> Result < QueryResult < ' _ , ( ast:: Crate , ast:: AttrVec ) > > {
118
- self . pre_configure . compute ( || {
114
+ pub fn global_ctxt ( & ' tcx self ) -> Result < QueryResult < ' _ , & ' tcx GlobalCtxt < ' tcx > > > {
115
+ self . gcx . compute ( || {
116
+ let sess = & self . compiler . sess ;
117
+
119
118
let mut krate = self . parse ( ) ?. steal ( ) ;
120
119
121
- let sess = & self . compiler . sess ;
122
120
rustc_builtin_macros:: cmdline_attrs:: inject (
123
121
& mut krate,
124
122
& sess. parse_sess ,
@@ -127,15 +125,6 @@ impl<'tcx> Queries<'tcx> {
127
125
128
126
let pre_configured_attrs =
129
127
rustc_expand:: config:: pre_configure_attrs ( sess, & krate. attrs ) ;
130
- Ok ( ( krate, pre_configured_attrs) )
131
- } )
132
- }
133
-
134
- pub fn global_ctxt ( & ' tcx self ) -> Result < QueryResult < ' _ , & ' tcx GlobalCtxt < ' tcx > > > {
135
- self . gcx . compute ( || {
136
- let sess = & self . compiler . sess ;
137
- #[ allow( deprecated) ]
138
- let ( krate, pre_configured_attrs) = self . pre_configure ( ) ?. steal ( ) ;
139
128
140
129
// parse `#[crate_name]` even if `--crate-name` was passed, to make sure it matches.
141
130
let crate_name = find_crate_name ( sess, & pre_configured_attrs) ;
@@ -146,6 +135,7 @@ impl<'tcx> Queries<'tcx> {
146
135
sess. opts . cg . metadata . clone ( ) ,
147
136
sess. cfg_version ,
148
137
) ;
138
+ let outputs = util:: build_output_filenames ( & pre_configured_attrs, sess) ;
149
139
let dep_graph = setup_dep_graph ( sess, crate_name, stable_crate_id) ?;
150
140
151
141
let cstore = FreezeLock :: new ( Box :: new ( CStore :: new (
@@ -180,11 +170,19 @@ impl<'tcx> Queries<'tcx> {
180
170
crate_name,
181
171
) ) ) ;
182
172
feed. crate_for_resolver ( tcx. arena . alloc ( Steal :: new ( ( krate, pre_configured_attrs) ) ) ) ;
173
+ feed. output_filenames ( Arc :: new ( outputs) ) ;
183
174
} ) ;
184
175
Ok ( qcx)
185
176
} )
186
177
}
187
178
179
+ pub fn write_dep_info ( & ' tcx self ) -> Result < ( ) > {
180
+ self . global_ctxt ( ) ?. enter ( |tcx| {
181
+ passes:: write_dep_info ( tcx) ;
182
+ } ) ;
183
+ Ok ( ( ) )
184
+ }
185
+
188
186
/// Check for the `#[rustc_error]` annotation, which forces an error in codegen. This is used
189
187
/// to write UI tests that actually test that compilation succeeds without reporting
190
188
/// an error.
@@ -284,8 +282,13 @@ impl Linker {
284
282
285
283
if sess. opts . unstable_opts . no_link {
286
284
let rlink_file = self . output_filenames . with_extension ( config:: RLINK_EXT ) ;
287
- CodegenResults :: serialize_rlink ( sess, & rlink_file, & codegen_results)
288
- . map_err ( |error| sess. emit_fatal ( FailedWritingFile { path : & rlink_file, error } ) ) ?;
285
+ CodegenResults :: serialize_rlink (
286
+ sess,
287
+ & rlink_file,
288
+ & codegen_results,
289
+ & * self . output_filenames ,
290
+ )
291
+ . map_err ( |error| sess. emit_fatal ( FailedWritingFile { path : & rlink_file, error } ) ) ?;
289
292
return Ok ( ( ) ) ;
290
293
}
291
294
0 commit comments