about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-08-02 13:38:36 +0000
committerbors <bors@rust-lang.org>2023-08-02 13:38:36 +0000
commit7637653b9fdd2b2f2dc3b378891eb5cf6aea9f5d (patch)
tree52cd9c48d6a97c32e49c73dc3282eb4bcc419170 /compiler/rustc_codegen_llvm/src
parentd1708334312f654204edd21b3e93cf29da847187 (diff)
parentda2b237b6a9d09f0b2a04b02b12a33f786d6eab6 (diff)
downloadrust-7637653b9fdd2b2f2dc3b378891eb5cf6aea9f5d.tar.gz
rust-7637653b9fdd2b2f2dc3b378891eb5cf6aea9f5d.zip
Auto merge of #114368 - Nilstrieb:rollup-pgvm9cf, r=Nilstrieb
Rollup of 5 pull requests

Successful merges:

 - #114079 (Use `upvar_tys` in more places, make it return a list)
 - #114166 (Add regression test for resolving `--extern libc=test.rlib`)
 - #114321 (get auto traits for parallel rustc)
 - #114335 (fix and extend ptr_comparison test)
 - #114347 (x.py print more detailed format files and untracked files count)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
-rw-r--r--compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs14
-rw-r--r--compiler/rustc_codegen_llvm/src/debuginfo/metadata/enums/mod.rs1
2 files changed, 4 insertions, 11 deletions
diff --git a/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs b/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs
index 40f0bcfdf58..f8cbcbd5ec8 100644
--- a/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs
+++ b/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs
@@ -990,14 +990,8 @@ fn build_upvar_field_di_nodes<'ll, 'tcx>(
     closure_or_generator_di_node: &'ll DIType,
 ) -> SmallVec<&'ll DIType> {
     let (&def_id, up_var_tys) = match closure_or_generator_ty.kind() {
-        ty::Generator(def_id, args, _) => {
-            let upvar_tys: SmallVec<_> = args.as_generator().prefix_tys().collect();
-            (def_id, upvar_tys)
-        }
-        ty::Closure(def_id, args) => {
-            let upvar_tys: SmallVec<_> = args.as_closure().upvar_tys().collect();
-            (def_id, upvar_tys)
-        }
+        ty::Generator(def_id, args, _) => (def_id, args.as_generator().prefix_tys()),
+        ty::Closure(def_id, args) => (def_id, args.as_closure().upvar_tys()),
         _ => {
             bug!(
                 "build_upvar_field_di_nodes() called with non-closure-or-generator-type: {:?}",
@@ -1007,9 +1001,7 @@ fn build_upvar_field_di_nodes<'ll, 'tcx>(
     };
 
     debug_assert!(
-        up_var_tys
-            .iter()
-            .all(|&t| t == cx.tcx.normalize_erasing_regions(ParamEnv::reveal_all(), t))
+        up_var_tys.iter().all(|t| t == cx.tcx.normalize_erasing_regions(ParamEnv::reveal_all(), t))
     );
 
     let capture_names = cx.tcx.closure_saved_names_of_captured_variables(def_id);
diff --git a/compiler/rustc_codegen_llvm/src/debuginfo/metadata/enums/mod.rs b/compiler/rustc_codegen_llvm/src/debuginfo/metadata/enums/mod.rs
index b4beb80ca8b..d3239d5c358 100644
--- a/compiler/rustc_codegen_llvm/src/debuginfo/metadata/enums/mod.rs
+++ b/compiler/rustc_codegen_llvm/src/debuginfo/metadata/enums/mod.rs
@@ -379,6 +379,7 @@ pub fn build_generator_variant_struct_type_di_node<'ll, 'tcx>(
             // Fields that are common to all states
             let common_fields: SmallVec<_> = generator_args
                 .prefix_tys()
+                .iter()
                 .zip(common_upvar_names)
                 .enumerate()
                 .map(|(index, (upvar_ty, upvar_name))| {