about summary refs log tree commit diff
path: root/src/librustc_mir
diff options
context:
space:
mode:
authorEduard-Mihai Burtescu <edy.burt@gmail.com>2018-06-01 19:25:28 +0300
committerEduard-Mihai Burtescu <edy.burt@gmail.com>2019-04-23 23:35:21 +0300
commitc3ca9a35be01934df917debca60bbc834f5c0653 (patch)
treeaac4240b81e0a26001a34397104151c9d9d5848c /src/librustc_mir
parent9260305c9e6a15c7692b85324afbd7b36afb29ed (diff)
rustc_mir: create the `let` and "remainder" scopes in source order.
Diffstat (limited to 'src/librustc_mir')
-rw-r--r--src/librustc_mir/build/matches/mod.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/librustc_mir/build/matches/mod.rs b/src/librustc_mir/build/matches/mod.rs
index b5b2d78f1bd..5e15d98e246 100644
--- a/src/librustc_mir/build/matches/mod.rs
+++ b/src/librustc_mir/build/matches/mod.rs
@@ -505,14 +505,15 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
             UserTypeProjections::none(),
             &mut |this, mutability, name, mode, var, span, ty, user_ty| {
                 if visibility_scope.is_none() {
-                    visibility_scope =
-                        Some(this.new_source_scope(scope_span, LintLevel::Inherited, None));
                     // If we have lints, create a new source scope
                     // that marks the lints for the locals. See the comment
                     // on the `source_info` field for why this is needed.
                     if lint_level.is_explicit() {
                         scope = this.new_source_scope(scope_span, lint_level, None);
                     }
+                visibility_scope = Some(this.new_source_scope(scope_span,
+                                                           LintLevel::Inherited,
+                                                           None));
                 }
                 let source_info = SourceInfo { span, scope };
                 let visibility_scope = visibility_scope.unwrap();