1
1
use crate :: interface:: { Compiler , Result } ;
2
- use crate :: passes:: { self , BoxedResolver , ExpansionResult , BoxedGlobalCtxt , PluginInfo } ;
2
+ use crate :: passes:: { self , BoxedResolver , BoxedGlobalCtxt , PluginInfo } ;
3
3
4
4
use rustc_incremental:: DepGraphFuture ;
5
5
use rustc_data_structures:: sync:: Lrc ;
@@ -11,6 +11,7 @@ use rustc::session::Session;
11
11
use rustc:: lint:: LintStore ;
12
12
use rustc:: hir:: def_id:: LOCAL_CRATE ;
13
13
use rustc:: ty:: steal:: Steal ;
14
+ use rustc:: ty:: ResolverOutputs ;
14
15
use rustc:: dep_graph:: DepGraph ;
15
16
use std:: cell:: { Ref , RefMut , RefCell } ;
16
17
use std:: rc:: Rc ;
@@ -81,7 +82,7 @@ pub(crate) struct Queries {
81
82
register_plugins : Query < ( ast:: Crate , PluginInfo , Lrc < LintStore > ) > ,
82
83
expansion : Query < ( ast:: Crate , Steal < Rc < RefCell < BoxedResolver > > > , Lrc < LintStore > ) > ,
83
84
dep_graph : Query < DepGraph > ,
84
- lower_to_hir : Query < ( Steal < hir:: map:: Forest > , ExpansionResult ) > ,
85
+ lower_to_hir : Query < ( Steal < hir:: map:: Forest > , Steal < ResolverOutputs > ) > ,
85
86
prepare_outputs : Query < OutputFilenames > ,
86
87
global_ctxt : Query < BoxedGlobalCtxt > ,
87
88
ongoing_codegen : Query < Box < dyn Any > > ,
@@ -191,7 +192,9 @@ impl Compiler {
191
192
} )
192
193
}
193
194
194
- pub fn lower_to_hir ( & self ) -> Result < & Query < ( Steal < hir:: map:: Forest > , ExpansionResult ) > > {
195
+ pub fn lower_to_hir (
196
+ & self ,
197
+ ) -> Result < & Query < ( Steal < hir:: map:: Forest > , Steal < ResolverOutputs > ) > > {
195
198
self . queries . lower_to_hir . compute ( || {
196
199
let expansion_result = self . expansion ( ) ?;
197
200
let peeked = expansion_result. peek ( ) ;
@@ -207,14 +210,14 @@ impl Compiler {
207
210
& krate
208
211
)
209
212
} ) ?) ;
210
- Ok ( ( hir, BoxedResolver :: to_expansion_result ( resolver) ) )
213
+ Ok ( ( hir, Steal :: new ( BoxedResolver :: to_resolver_outputs ( resolver) ) ) )
211
214
} )
212
215
}
213
216
214
217
pub fn prepare_outputs ( & self ) -> Result < & Query < OutputFilenames > > {
215
218
self . queries . prepare_outputs . compute ( || {
216
219
let expansion_result = self . expansion ( ) ?;
217
- let ( krate, boxed_resolver) = & * expansion_result. peek ( ) ;
220
+ let ( krate, boxed_resolver, _ ) = & * expansion_result. peek ( ) ;
218
221
let crate_name = self . crate_name ( ) ?;
219
222
let crate_name = crate_name. peek ( ) ;
220
223
passes:: prepare_outputs ( self . session ( ) , self , & krate, & boxed_resolver, & crate_name)
@@ -228,12 +231,12 @@ impl Compiler {
228
231
let lint_store = self . expansion ( ) ?. peek ( ) . 2 . clone ( ) ;
229
232
let hir = self . lower_to_hir ( ) ?;
230
233
let hir = hir. peek ( ) ;
231
- let ( ref hir_forest, ref expansion ) = * hir;
234
+ let ( hir_forest, resolver_outputs ) = & * hir;
232
235
Ok ( passes:: create_global_ctxt (
233
236
self ,
234
237
lint_store,
235
238
hir_forest. steal ( ) ,
236
- expansion . resolver_outputs . steal ( ) ,
239
+ resolver_outputs. steal ( ) ,
237
240
outputs,
238
241
& crate_name) )
239
242
} )
0 commit comments