-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No EndRegion emitted for DestructionScope #43457
Comments
Indeed, even the CleanEndRegions.before.mir shows no |
Very weird: It seems like at the time that control reaches this statement in |
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: let opt_def_id = cx.tcx.hir.opt_local_def_id(block_id);
...
let opt_dxn_ext = opt_def_id.and_then(|def_id| {
cx.tcx.region_maps(def_id).opt_destruction_extent(stmt.node.id())
}); but the Now to figure out what |
@eddyb points out that I should not be attempting to do Will fix! |
Fix destruction extent lookup during HIR -> HAIR translation My method for finding the destruction extent, if any, from cbed41a (in rust-lang#39409), was buggy in that it sometimes failed to find an extent that was nonetheless present. This fixes that, and is cleaner code to boot. Fix rust-lang#43457
The following code
compiles to MIR without any
EndRegion
(this is right before theEraseRegions
pass):Cc @pnkfelix
The text was updated successfully, but these errors were encountered: