From 144c0d5519dff9eca7bacd6191856ef57dbb7e0f Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Fri, 20 Apr 2018 20:27:58 +1000 Subject: [PATCH] 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.) --- src/librustc/middle/region.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librustc/middle/region.rs b/src/librustc/middle/region.rs index 42483c83f4ba..b77e0b5fae9c 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)) => {