Change:
The following code compiles to MIR without any (this is right before the pass): Cc
Cc
Indeed, even the shows no for that borrow. Looking further now.
Very weird: It seems like at the time that control reaches this statement in , there is no destruction scope attached to it...? still looking... (I'm not aware of a place where a destruction scope would be later...)
A ha! The destruction scope exists, but during the HIR -HAIR translation, we fail to find it, because the way we look up the destruction scope is with some code that looks like this: but the that we got for that is , so the lookup doesn't have a chance of working. Now to figure out what is returning here (or if we perhaps should be using a different key for the lookup?)
that I should not be attempting to do in the first place here (which then goes south when I fail to find the appropriate to use), because the itself now carries the appropriate directly, thanks to (specifically ) Will fix!

Discussion:
// 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); <del> 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) }); </del> <ins> let opt_destruction_extent = cx.region_maps.opt_destruction_extent(self.id); </ins> Block { targeted_by_break: self.targeted_by_break, extent: CodeExtent::Misc(self.id),

stmts: &'tcx [hir::Stmt]) -> Vec<StmtRef<'tcx>> { let mut result = vec![]; <del> let opt_def_id = cx.tcx.hir.opt_local_def_id(block_id); </del> for (index, stmt) in stmts.iter().enumerate() { <del> let opt_dxn_ext = opt_def_id.and_then(|def_id| { cx.tcx.region_maps(def_id).opt_destruction_extent(stmt.node.id()) }); </del> <ins> let opt_dxn_ext = cx.region_maps.opt_destruction_extent(stmt.node.id()); </ins> match stmt.node { hir::StmtExpr(ref expr, id) | hir::StmtSemi(ref expr, id) => {

<ins> // Copyright 2017 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. // compile-flags: -Z identify_regions -Z span_free_formats // ignore-tidy-linelength // Regression test for #43457: an `EndRegion` was missing from output // because compiler was using a faulty means for region map lookup. use std::cell::RefCell; fn rc_refcell_test(r: RefCell<i32>) { r.borrow_mut(); } fn main() { } // END RUST SOURCE // START rustc.node5.SimplifyCfg-qualify-consts.after.mir // // fn rc_refcell_test(_1: std::cell::RefCell<i32>) -> () { //     let mut _0: (); //     scope 1 { //         let _2: std::cell::RefCell<i32>; //     } //     let mut _3: std::cell::RefMut<'17dce, i32>; //     let mut _4: &'17dce std::cell::RefCell<i32>; // //     bb0: { //         StorageLive(_2); //         _2 = _1; //         StorageLive(_4); //         _4 = &'17dce _2; //         _3 = const <std::cell::RefCell<T>>::borrow_mut(_4) -> bb1; //     } // //     bb1: { //         drop(_3) -> bb2; //     } // //     bb2: { //         StorageDead(_4); //         EndRegion('17dce); //         _0 = (); //         StorageDead(_2); //         return; //     } // } </ins>