Skip to content

Commit 58e1a01

Browse files
committed
Auto merge of #155628 - nnethercote:CStore-from_tcx, r=<try>
Streamline `CrateMetadataRef` construction in `provide_one!`.
2 parents 9ec5d5f + cb3df68 commit 58e1a01

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -152,13 +152,8 @@ macro_rules! provide_one {
152152
$tcx.ensure_ok().crate_hash($def_id.krate);
153153
}
154154

155-
let cdata = rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx($tcx), |c| {
156-
c.get_crate_data($def_id.krate).cdata
157-
});
158-
let $cdata = crate::creader::CrateMetadataRef {
159-
cdata: &cdata,
160-
cstore: &CStore::from_tcx($tcx),
161-
};
155+
let cstore = CStore::from_tcx($tcx);
156+
let $cdata = cstore.get_crate_data($def_id.krate);
162157

163158
$compute
164159
}

0 commit comments

Comments
 (0)