]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_codegen_llvm/debuginfo/create_scope_map.rs
Auto merge of #67290 - jonas-schievink:leak-audit, r=KodrAus
[rust.git] / src / librustc_codegen_llvm / debuginfo / create_scope_map.rs
index 206884d63c7d67cd271336053ed7d68681c8e920..cdb9657e1ff3c3b294b1a57068e3ebc59f8ab86b 100644 (file)
@@ -9,7 +9,7 @@
 
 use libc::c_uint;
 
-use syntax_pos::Pos;
+use rustc_span::Pos;
 
 use rustc_index::bit_set::BitSet;
 use rustc_index::vec::Idx;
@@ -66,14 +66,8 @@ fn make_mir_scope(
     if !has_variables.contains(scope) {
         // Do not create a DIScope if there are no variables
         // defined in this MIR Scope, to avoid debuginfo bloat.
-
-        // However, we don't skip creating a nested scope if
-        // our parent is the root, because we might want to
-        // put arguments in the root and not have shadowing.
-        if parent_scope.scope_metadata.unwrap() != fn_metadata {
-            debug_context.scopes[scope] = parent_scope;
-            return;
-        }
+        debug_context.scopes[scope] = parent_scope;
+        return;
     }
 
     let loc = span_start(cx, scope_data.span);