@@ -16,6 +16,7 @@ use rustc_hir as hir;
1616use rustc_hir:: def_id:: { CRATE_DEF_ID , CRATE_DEF_INDEX , LOCAL_CRATE , LocalDefId , LocalDefIdSet } ;
1717use rustc_hir:: definitions:: DefPathData ;
1818use rustc_hir_pretty:: id_to_string;
19+ use rustc_middle:: dep_graph:: WorkProductId ;
1920use rustc_middle:: middle:: dependency_format:: Linkage ;
2021use rustc_middle:: middle:: exported_symbols:: metadata_symbol_name;
2122use rustc_middle:: mir:: interpret;
@@ -2367,8 +2368,8 @@ pub fn encode_metadata(tcx: TyCtxt<'_>, path: &Path, ref_path: Option<&Path>) {
23672368 let dep_node = tcx. metadata_dep_node ( ) ;
23682369
23692370 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)
23722373 && tcx. try_mark_green ( & dep_node)
23732374 {
23742375 let saved_path = & work_product. saved_files [ "rmeta" ] ;
@@ -2377,9 +2378,7 @@ pub fn encode_metadata(tcx: TyCtxt<'_>, path: &Path, ref_path: Option<&Path>) {
23772378 debug ! ( "copying preexisting metadata from {source_file:?} to {path:?}" ) ;
23782379 match rustc_fs_util:: link_or_copy ( & source_file, path) {
23792380 Ok ( _) => { }
2380- Err ( err) => {
2381- tcx. dcx ( ) . emit_fatal ( FailCreateFileEncoder { err } ) ;
2382- }
2381+ Err ( err) => tcx. dcx ( ) . emit_fatal ( FailCreateFileEncoder { err } ) ,
23832382 } ;
23842383 return ;
23852384 } ;
0 commit comments