mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-21 17:52:12 +03:00
Fix #43457 (and avoid some unneeded lookups to boot, woo).
This commit is contained in:
@@ -22,10 +22,7 @@ fn make_mirror<'a, 'gcx>(self, cx: &mut Cx<'a, 'gcx, 'tcx>) -> Block<'tcx> {
|
||||
// We have to eagerly translate the "spine" of the statements
|
||||
// in order to get the lexical scoping correctly.
|
||||
let stmts = mirror_stmts(cx, self.id, &*self.stmts);
|
||||
let opt_def_id = cx.tcx.hir.opt_local_def_id(self.id);
|
||||
let opt_destruction_extent = opt_def_id.and_then(|def_id| {
|
||||
cx.tcx.region_maps(def_id).opt_destruction_extent(self.id)
|
||||
});
|
||||
let opt_destruction_extent = cx.region_maps.opt_destruction_extent(self.id);
|
||||
Block {
|
||||
targeted_by_break: self.targeted_by_break,
|
||||
extent: CodeExtent::Misc(self.id),
|
||||
@@ -42,11 +39,8 @@ fn mirror_stmts<'a, 'gcx, 'tcx>(cx: &mut Cx<'a, 'gcx, 'tcx>,
|
||||
stmts: &'tcx [hir::Stmt])
|
||||
-> Vec<StmtRef<'tcx>> {
|
||||
let mut result = vec![];
|
||||
let opt_def_id = cx.tcx.hir.opt_local_def_id(block_id);
|
||||
for (index, stmt) in stmts.iter().enumerate() {
|
||||
let opt_dxn_ext = opt_def_id.and_then(|def_id| {
|
||||
cx.tcx.region_maps(def_id).opt_destruction_extent(stmt.node.id())
|
||||
});
|
||||
let opt_dxn_ext = cx.region_maps.opt_destruction_extent(stmt.node.id());
|
||||
match stmt.node {
|
||||
hir::StmtExpr(ref expr, id) |
|
||||
hir::StmtSemi(ref expr, id) => {
|
||||
|
||||
Reference in New Issue
Block a user