Skip to content

Commit

Permalink
Rollup merge of rust-lang#52315 - ljedrz:FIXME_#27942, r=petrochenkov
Browse files Browse the repository at this point in the history
Resolve FIXME(rust-lang#27942)

[related issue](rust-lang#27942)

cc [rust-lang#44366](rust-lang#44366)
  • Loading branch information
Mark-Simulacrum committed Jul 13, 2018
2 parents 102ed77 + 72f096b commit 82da5ce
Showing 1 changed file with 1 addition and 21 deletions.
22 changes: 1 addition & 21 deletions src/librustc/infer/error_reporting/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,32 +193,12 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {

let scope = region.free_region_binding_scope(self);
let node = self.hir.as_local_node_id(scope).unwrap_or(DUMMY_NODE_ID);
let unknown;
let tag = match self.hir.find(node) {
Some(hir_map::NodeBlock(_)) | Some(hir_map::NodeExpr(_)) => "body",
Some(hir_map::NodeItem(it)) => Self::item_scope_tag(&it),
Some(hir_map::NodeTraitItem(it)) => Self::trait_item_scope_tag(&it),
Some(hir_map::NodeImplItem(it)) => Self::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.hir.node_to_string(node),
scope
);
&unknown
}
None => {
unknown = format!(
"unknown node for scope {:?}. \
Please report a bug.",
scope
);
&unknown
}
_ => unreachable!()
};
let (prefix, span) = match *region {
ty::ReEarlyBound(ref br) => {
Expand Down

0 comments on commit 82da5ce

Please sign in to comment.