diff options
| author | bors <bors@rust-lang.org> | 2023-01-28 16:11:33 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-01-28 16:11:33 +0000 |
| commit | d6f0642827e21a088b0130c84857d84f5433301d (patch) | |
| tree | 9d109467a036373273b6166d41cc5bd855618a02 /compiler/rustc_mir_transform/src | |
| parent | bca8b4dc32ec20f9a4e0ca55f54e5b2a531936fc (diff) | |
| parent | 1aab86eae2f9e3e442f39577bd1bd62bccd8cc0c (diff) | |
| download | rust-d6f0642827e21a088b0130c84857d84f5433301d.tar.gz rust-d6f0642827e21a088b0130c84857d84f5433301d.zip | |
Auto merge of #107206 - cjgillot:no-h2l-map, r=WaffleLapkin
Remove HirId -> LocalDefId map from HIR. Having this map in HIR prevents the creating of new definitions after HIR has been built. Thankfully, we do not need it. Based on https://github.com/rust-lang/rust/pull/103902
Diffstat (limited to 'compiler/rustc_mir_transform/src')
| -rw-r--r-- | compiler/rustc_mir_transform/src/check_unsafety.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_mir_transform/src/coverage/mod.rs | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/compiler/rustc_mir_transform/src/check_unsafety.rs b/compiler/rustc_mir_transform/src/check_unsafety.rs index adf6ae4c727..9f006a76162 100644 --- a/compiler/rustc_mir_transform/src/check_unsafety.rs +++ b/compiler/rustc_mir_transform/src/check_unsafety.rs @@ -445,7 +445,7 @@ impl<'tcx> intravisit::Visitor<'tcx> for UnusedUnsafeVisitor<'_, 'tcx> { _fd: &'tcx hir::FnDecl<'tcx>, b: hir::BodyId, _s: rustc_span::Span, - _id: HirId, + _id: LocalDefId, ) { if matches!(fk, intravisit::FnKind::Closure) { self.visit_body(self.tcx.hir().body(b)) diff --git a/compiler/rustc_mir_transform/src/coverage/mod.rs b/compiler/rustc_mir_transform/src/coverage/mod.rs index 1468afc6456..9a617159813 100644 --- a/compiler/rustc_mir_transform/src/coverage/mod.rs +++ b/compiler/rustc_mir_transform/src/coverage/mod.rs @@ -540,7 +540,8 @@ fn fn_sig_and_body( // FIXME(#79625): Consider improving MIR to provide the information needed, to avoid going back // to HIR for it. let hir_node = tcx.hir().get_if_local(def_id).expect("expected DefId is local"); - let fn_body_id = hir::map::associated_body(hir_node).expect("HIR node is a function with body"); + let (_, fn_body_id) = + hir::map::associated_body(hir_node).expect("HIR node is a function with body"); (hir_node.fn_sig(), tcx.hir().body(fn_body_id)) } |
