Skip to content

Commit 904bc29

Browse files
committed
Lighten formatting.
1 parent 761d366 commit 904bc29

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

compiler/rustc_metadata/src/rmeta/encoder.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ use rustc_hir as hir;
1616
use rustc_hir::def_id::{CRATE_DEF_ID, CRATE_DEF_INDEX, LOCAL_CRATE, LocalDefId, LocalDefIdSet};
1717
use rustc_hir::definitions::DefPathData;
1818
use rustc_hir_pretty::id_to_string;
19+
use rustc_middle::dep_graph::WorkProductId;
1920
use rustc_middle::middle::dependency_format::Linkage;
2021
use rustc_middle::middle::exported_symbols::metadata_symbol_name;
2122
use rustc_middle::mir::interpret;
@@ -2406,8 +2407,8 @@ pub fn encode_metadata(tcx: TyCtxt<'_>, path: &Path, ref_path: Option<&Path>) {
24062407
let dep_node = tcx.metadata_dep_node();
24072408

24082409
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)
24112412
&& tcx.try_mark_green(&dep_node)
24122413
{
24132414
let saved_path = &work_product.saved_files["rmeta"];
@@ -2416,9 +2417,7 @@ pub fn encode_metadata(tcx: TyCtxt<'_>, path: &Path, ref_path: Option<&Path>) {
24162417
debug!("copying preexisting metadata from {source_file:?} to {path:?}");
24172418
match rustc_fs_util::link_or_copy(&source_file, path) {
24182419
Ok(_) => {}
2419-
Err(err) => {
2420-
tcx.dcx().emit_fatal(FailCreateFileEncoder { err });
2421-
}
2420+
Err(err) => tcx.dcx().emit_fatal(FailCreateFileEncoder { err }),
24222421
};
24232422
return;
24242423
};

0 commit comments

Comments
 (0)