Just unwrap()
instead of unwrap_or(DUMMY_HIR_ID)
.
A valid hir id should always be returned in this case.
This commit is contained in:
parent
830e4fde0f
commit
95fb7bf108
@ -191,7 +191,7 @@ fn msg_span_from_early_bound_and_free_regions(
|
||||
let sm = tcx.sess.source_map();
|
||||
|
||||
let scope = region.free_region_binding_scope(tcx);
|
||||
let node = tcx.hir().as_local_hir_id(scope).unwrap_or(hir::DUMMY_HIR_ID);
|
||||
let node = tcx.hir().as_local_hir_id(scope).unwrap();
|
||||
let tag = match tcx.hir().find(node) {
|
||||
Some(Node::Block(_)) | Some(Node::Expr(_)) => "body",
|
||||
Some(Node::Item(it)) => item_scope_tag(&it),
|
||||
|
Loading…
x
Reference in New Issue
Block a user