about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authormarmeladema <xademax@gmail.com>2020-04-12 22:49:34 +0100
committermarmeladema <xademax@gmail.com>2020-04-13 13:43:44 +0100
commit95fb7bf1081850873a7db513a1087e5cc00897b5 (patch)
tree03846da031a73acce30c029b98927eb1f86e506e /src
parent830e4fde0f11c8e8cf177729efac356429ffb0eb (diff)
downloadrust-95fb7bf1081850873a7db513a1087e5cc00897b5.tar.gz
rust-95fb7bf1081850873a7db513a1087e5cc00897b5.zip
Just `unwrap()` instead of `unwrap_or(DUMMY_HIR_ID)`.
A valid hir id should always be returned in this case.
Diffstat (limited to 'src')
-rw-r--r--src/librustc_infer/infer/error_reporting/mod.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/librustc_infer/infer/error_reporting/mod.rs b/src/librustc_infer/infer/error_reporting/mod.rs
index db81ceea43f..4189570a0da 100644
--- a/src/librustc_infer/infer/error_reporting/mod.rs
+++ b/src/librustc_infer/infer/error_reporting/mod.rs
@@ -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),