about summary refs log tree commit diff
path: root/src/librustc_borrowck
diff options
context:
space:
mode:
authorMichael Woerister <michaelwoerister@posteo>2017-08-07 15:06:10 +0200
committerMichael Woerister <michaelwoerister@posteo>2017-08-11 12:11:38 +0200
commite777189b4accdd7a92adf8554a368d399ff7f3ee (patch)
tree1715374707f5b8186437caa223f104c60a930131 /src/librustc_borrowck
parent7f2423eede51cc622420356988777db2473a0be2 (diff)
downloadrust-e777189b4accdd7a92adf8554a368d399ff7f3ee.tar.gz
rust-e777189b4accdd7a92adf8554a368d399ff7f3ee.zip
Use ItemLocalId as key for TypeckTables::pat_binding_modes.
Diffstat (limited to 'src/librustc_borrowck')
-rw-r--r--src/librustc_borrowck/borrowck/mod.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/librustc_borrowck/borrowck/mod.rs b/src/librustc_borrowck/borrowck/mod.rs
index 6b31535c5a5..4b26aa95759 100644
--- a/src/librustc_borrowck/borrowck/mod.rs
+++ b/src/librustc_borrowck/borrowck/mod.rs
@@ -899,8 +899,13 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> {
         };
 
         match pat.node {
-            hir::PatKind::Binding(..) =>
-                *self.tables.pat_binding_modes.get(&pat.id).expect("missing binding mode"),
+            hir::PatKind::Binding(..) => {
+                self.tables.validate_hir_id(pat.hir_id);
+                *self.tables
+                     .pat_binding_modes
+                     .get(&pat.hir_id.local_id)
+                     .expect("missing binding mode")
+            }
             _ => bug!("local is not a binding: {:?}", pat)
         }
     }