@@ -245,8 +245,7 @@ impl<'tcx> Queries<'tcx> {
245
245
self . prepare_outputs . compute ( || {
246
246
let expansion_result = self . expansion ( ) ?;
247
247
let ( krate, boxed_resolver, _) = & * expansion_result. peek ( ) ;
248
- let crate_name = self . crate_name ( ) ?;
249
- let crate_name = crate_name. peek ( ) ;
248
+ let crate_name = self . crate_name ( ) ?. peek ( ) ;
250
249
passes:: prepare_outputs (
251
250
self . session ( ) ,
252
251
self . compiler ,
@@ -343,32 +342,36 @@ impl<'tcx> Queries<'tcx> {
343
342
}
344
343
345
344
pub fn linker ( & ' tcx self ) -> Result < Linker > {
346
- let dep_graph = self . dep_graph ( ) ?;
347
- let prepare_outputs = self . prepare_outputs ( ) ?;
348
- let crate_hash = self . global_ctxt ( ) ?. peek_mut ( ) . enter ( |tcx| tcx. crate_hash ( LOCAL_CRATE ) ) ;
349
- let ongoing_codegen = self . ongoing_codegen ( ) ?;
350
-
351
345
let sess = self . session ( ) . clone ( ) ;
352
346
let codegen_backend = self . codegen_backend ( ) . clone ( ) ;
353
347
348
+ let dep_graph = self . dep_graph ( ) ?. peek ( ) . clone ( ) ;
349
+ let prepare_outputs = self . prepare_outputs ( ) ?. take ( ) ;
350
+ let crate_hash = self . global_ctxt ( ) ?. peek_mut ( ) . enter ( |tcx| tcx. crate_hash ( LOCAL_CRATE ) ) ;
351
+ let ongoing_codegen = self . ongoing_codegen ( ) ?. take ( ) ;
352
+
354
353
Ok ( Linker {
355
354
sess,
356
- dep_graph : dep_graph. peek ( ) . clone ( ) ,
357
- prepare_outputs : prepare_outputs. take ( ) ,
358
- crate_hash,
359
- ongoing_codegen : ongoing_codegen. take ( ) ,
360
355
codegen_backend,
356
+
357
+ dep_graph,
358
+ prepare_outputs,
359
+ crate_hash,
360
+ ongoing_codegen,
361
361
} )
362
362
}
363
363
}
364
364
365
365
pub struct Linker {
366
+ // compilation inputs
366
367
sess : Lrc < Session > ,
368
+ codegen_backend : Lrc < Box < dyn CodegenBackend > > ,
369
+
370
+ // compilation outputs
367
371
dep_graph : DepGraph ,
368
372
prepare_outputs : OutputFilenames ,
369
373
crate_hash : Svh ,
370
374
ongoing_codegen : Box < dyn Any > ,
371
- codegen_backend : Lrc < Box < dyn CodegenBackend > > ,
372
375
}
373
376
374
377
impl Linker {
0 commit comments