Change:
} }; <del> match self.map.find(fr.scope.node_id(&self.region_maps)) { Some(ast_map::NodeBlock(ref blk)) => { let (msg, opt_span) = explain_span(self, "block", blk.span); (format!("{} {}", prefix, msg), opt_span) } Some(ast_map::NodeItem(it)) => { let tag = item_scope_tag(&it); let (msg, opt_span) = explain_span(self, tag, it.span); (format!("{} {}", prefix, msg), opt_span) </del> <ins> let node = fr.scope.node_id(&self.region_maps); let unknown; let tag = match self.map.find(node) { Some(ast_map::NodeBlock(_)) | Some(ast_map::NodeExpr(_)) => "body", Some(ast_map::NodeItem(it)) => item_scope_tag(&it), Some(ast_map::NodeTraitItem(it)) => trait_item_scope_tag(&it), Some(ast_map::NodeImplItem(it)) => impl_item_scope_tag(&it), // this really should not happen, but it does: // FIXME(#27942) Some(_) => { unknown = format!("unexpected node ({}) for scope {:?}.   Please report a bug.", self.map.node_to_string(node), fr.scope); &unknown </ins> } <del> Some(_) | None => { // this really should not happen, but it does: // FIXME(#27942) (format!("{} unknown free region bounded by scope {:?}", prefix, fr.scope), None) </del> <ins> None => { unknown = format!("unknown node for scope {:?}.   Please report a bug.", fr.scope); &unknown </ins> } <del> } </del> <ins> }; let (msg, opt_span) = explain_span(self, tag, self.map.span(node)); (format!("{} {}", prefix, msg), opt_span) </ins> } ty::ReStatic => ("the static lifetime".to_owned(), None),

Discussion:
Receiving info about MIR or some other intermediate form in a user error report. I tried this code which most likely has some lifetime issue that I am yet to resolve: I should have received information about the scope defined by some part of my code or if the issue is with auto-generated code then possibly no information about an internal scope. Instead, this happened: :
This seems to be more common than I first thought: Made a resulted in:
Issue exists in latest nightly as well.
Can confirm experiencing it. Smaller sample: Not an issue in current stable or beta, which reports rather than
Does this qualify as a regression?
Yes, though not the kind we'd do a point release for, IMO
should mark as such then :)
Here's another small one:
It took me a minute to figure out that this issue is about the error message & not the error. I've also been getting CallSiteScope and so on nonsense in my error output recently. This seems like a pretty serious regression in the usability of our error messages! My impression has been that this impacts just about every lifetime issue I've been getting recently, but I could be wrong. Could we get this fixed by next stable release? I disagree with that this isn't worth making a point release for (currently its only in nightly, so that's not an issue).
Nominated for consideration by the compiler team.
This appears to be in beta (testing on the playground). Super tiny repro: gives
Has nobody looked into this? I'll take a peek before the compiler meeting today. EDIT: Of course it was me who introduced this bug, or rather triggered sigh. EDIT2: Basically, after , any uses of are suspicious. I'll try to make a PR.
Fix is at , using reduction as the testcase for this issue.
triage: P-high We have a fix though =)