@@ -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;
@@ -2363,8 +2364,8 @@ pub fn encode_metadata(tcx: TyCtxt<'_>, path: &Path, ref_path: Option<&Path>) {
23632364 let dep_node = tcx. metadata_dep_node ( ) ;
23642365
23652366 if tcx. dep_graph . is_fully_enabled ( )
2366- && let work_product_id = & rustc_middle :: dep_graph :: WorkProductId :: from_cgu_name ( "metadata" )
2367- && let Some ( work_product) = tcx. dep_graph . previous_work_product ( work_product_id)
2367+ && let work_product_id = WorkProductId :: from_cgu_name ( "metadata" )
2368+ && let Some ( work_product) = tcx. dep_graph . previous_work_product ( & work_product_id)
23682369 && tcx. try_mark_green ( & dep_node)
23692370 {
23702371 let saved_path = & work_product. saved_files [ "rmeta" ] ;
@@ -2373,9 +2374,7 @@ pub fn encode_metadata(tcx: TyCtxt<'_>, path: &Path, ref_path: Option<&Path>) {
23732374 debug ! ( "copying preexisting metadata from {source_file:?} to {path:?}" ) ;
23742375 match rustc_fs_util:: link_or_copy ( & source_file, path) {
23752376 Ok ( _) => { }
2376- Err ( err) => {
2377- tcx. dcx ( ) . emit_fatal ( FailCreateFileEncoder { err } ) ;
2378- }
2377+ Err ( err) => tcx. dcx ( ) . emit_fatal ( FailCreateFileEncoder { err } ) ,
23792378 } ;
23802379 return ;
23812380 } ;
0 commit comments