@@ -16,6 +16,7 @@ use rustc_hir as hir;
16
16
use rustc_hir:: def_id:: { CRATE_DEF_ID , CRATE_DEF_INDEX , LOCAL_CRATE , LocalDefId , LocalDefIdSet } ;
17
17
use rustc_hir:: definitions:: DefPathData ;
18
18
use rustc_hir_pretty:: id_to_string;
19
+ use rustc_middle:: dep_graph:: WorkProductId ;
19
20
use rustc_middle:: middle:: dependency_format:: Linkage ;
20
21
use rustc_middle:: middle:: exported_symbols:: metadata_symbol_name;
21
22
use rustc_middle:: mir:: interpret;
@@ -2367,8 +2368,8 @@ pub fn encode_metadata(tcx: TyCtxt<'_>, path: &Path, ref_path: Option<&Path>) {
2367
2368
let dep_node = tcx. metadata_dep_node ( ) ;
2368
2369
2369
2370
if tcx. dep_graph . is_fully_enabled ( )
2370
- && let work_product_id = & rustc_middle :: dep_graph :: WorkProductId :: from_cgu_name ( "metadata" )
2371
- && let Some ( work_product) = tcx. dep_graph . previous_work_product ( work_product_id)
2371
+ && let work_product_id = WorkProductId :: from_cgu_name ( "metadata" )
2372
+ && let Some ( work_product) = tcx. dep_graph . previous_work_product ( & work_product_id)
2372
2373
&& tcx. try_mark_green ( & dep_node)
2373
2374
{
2374
2375
let saved_path = & work_product. saved_files [ "rmeta" ] ;
@@ -2377,9 +2378,7 @@ pub fn encode_metadata(tcx: TyCtxt<'_>, path: &Path, ref_path: Option<&Path>) {
2377
2378
debug ! ( "copying preexisting metadata from {source_file:?} to {path:?}" ) ;
2378
2379
match rustc_fs_util:: link_or_copy ( & source_file, path) {
2379
2380
Ok ( _) => { }
2380
- Err ( err) => {
2381
- tcx. dcx ( ) . emit_fatal ( FailCreateFileEncoder { err } ) ;
2382
- }
2381
+ Err ( err) => tcx. dcx ( ) . emit_fatal ( FailCreateFileEncoder { err } ) ,
2383
2382
} ;
2384
2383
return ;
2385
2384
} ;
0 commit comments