diff options
| author | Michael Woerister <michaelwoerister@posteo> | 2017-08-07 15:06:10 +0200 |
|---|---|---|
| committer | Michael Woerister <michaelwoerister@posteo> | 2017-08-11 12:11:38 +0200 |
| commit | e777189b4accdd7a92adf8554a368d399ff7f3ee (patch) | |
| tree | 1715374707f5b8186437caa223f104c60a930131 /src/librustc_borrowck | |
| parent | 7f2423eede51cc622420356988777db2473a0be2 (diff) | |
| download | rust-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.rs | 9 |
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) } } |
