about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorNicholas Nethercote <nnethercote@mozilla.com>2018-04-20 20:27:58 +1000
committerNicholas Nethercote <nnethercote@mozilla.com>2018-04-20 20:27:58 +1000
commit144c0d5519dff9eca7bacd6191856ef57dbb7e0f (patch)
tree208c9a3951389133dffc9cd4af1c168bb69fdd66 /src
parent23561c6747b0916e852aaa2a5d04c0b0eeddc6de (diff)
downloadrust-144c0d5519dff9eca7bacd6191856ef57dbb7e0f.tar.gz
rust-144c0d5519dff9eca7bacd6191856ef57dbb7e0f.zip
Fix a copy-and-paste bug in nearest_common_ancestor.
This code path is rarely hit, which likely explains why this bug hasn't
been detected before now. (I only noticed it via code inspection.)
Diffstat (limited to 'src')
-rw-r--r--src/librustc/middle/region.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/librustc/middle/region.rs b/src/librustc/middle/region.rs
index 42483c83f4b..b77e0b5fae9 100644
--- a/src/librustc/middle/region.rs
+++ b/src/librustc/middle/region.rs
@@ -706,7 +706,7 @@ impl<'tcx> ScopeTree {
             // "Modeling closures" section of the README in
             // infer::region_constraints for more details.
             let a_root_scope = a_ancestors[a_index];
-            let b_root_scope = a_ancestors[a_index];
+            let b_root_scope = b_ancestors[b_index];
             return match (a_root_scope.data(), b_root_scope.data()) {
                 (ScopeData::Destruction(a_root_id),
                  ScopeData::Destruction(b_root_id)) => {