@@ -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;
@@ -2406,8 +2407,8 @@ pub fn encode_metadata(tcx: TyCtxt<'_>, path: &Path, ref_path: Option<&Path>) {
2406
2407
let dep_node = tcx. metadata_dep_node ( ) ;
2407
2408
2408
2409
if tcx. dep_graph . is_fully_enabled ( )
2409
- && let work_product_id = & rustc_middle :: dep_graph :: WorkProductId :: from_cgu_name ( "metadata" )
2410
- && let Some ( work_product) = tcx. dep_graph . previous_work_product ( work_product_id)
2410
+ && let work_product_id = WorkProductId :: from_cgu_name ( "metadata" )
2411
+ && let Some ( work_product) = tcx. dep_graph . previous_work_product ( & work_product_id)
2411
2412
&& tcx. try_mark_green ( & dep_node)
2412
2413
{
2413
2414
let saved_path = & work_product. saved_files [ "rmeta" ] ;
@@ -2416,9 +2417,7 @@ pub fn encode_metadata(tcx: TyCtxt<'_>, path: &Path, ref_path: Option<&Path>) {
2416
2417
debug ! ( "copying preexisting metadata from {source_file:?} to {path:?}" ) ;
2417
2418
match rustc_fs_util:: link_or_copy ( & source_file, path) {
2418
2419
Ok ( _) => { }
2419
- Err ( err) => {
2420
- tcx. dcx ( ) . emit_fatal ( FailCreateFileEncoder { err } ) ;
2421
- }
2420
+ Err ( err) => tcx. dcx ( ) . emit_fatal ( FailCreateFileEncoder { err } ) ,
2422
2421
} ;
2423
2422
return ;
2424
2423
} ;
0 commit comments