Skip to content

Stop using prefix_tys#156650

Open
dingxiangfei2009 wants to merge 1 commit into
rust-lang:mainfrom
dingxiangfei2009:coro-no-prefix-tys
Open

Stop using prefix_tys#156650
dingxiangfei2009 wants to merge 1 commit into
rust-lang:mainfrom
dingxiangfei2009:coro-no-prefix-tys

Conversation

@dingxiangfei2009
Copy link
Copy Markdown
Contributor

@dingxiangfei2009 dingxiangfei2009 commented May 16, 2026

This is a member of a patch series to replace #135527.

This function hints at an early commitment to coroutine memory layout. We should not give promises on how upvars are allocated.

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 16, 2026

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels May 16, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 16, 2026

r? @tiif

rustbot has assigned @tiif.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler, debuginfo
  • compiler, debuginfo expanded to 73 candidates
  • Random selection from 15 candidates

@cjgillot cjgillot assigned cjgillot and tiif and unassigned tiif May 18, 2026
@cjgillot
Copy link
Copy Markdown
Contributor

Do you mind rebasing and running x.py fmt to remove formatting changes? That will make review much easier.

This function hints at an early commitment to coroutine memory layout.
We should not give promises on how upvars are allocated.

Signed-off-by: Xiangfei Ding <dingxiangfei2009@protonmail.ch>
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 19, 2026

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@rust-log-analyzer
Copy link
Copy Markdown
Collaborator

The job tidy failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
[TIMING:end] tool::ToolBuild { build_compiler: Compiler { stage: 0, host: x86_64-unknown-linux-gnu, forced_compiler: false }, target: x86_64-unknown-linux-gnu, tool: "tidy", path: "src/tools/tidy", mode: ToolBootstrap, source_type: InTree, extra_features: [], allow_features: "", cargo_args: [], artifact_kind: Binary } -- 12.872
[TIMING:end] tool::Tidy { compiler: Compiler { stage: 0, host: x86_64-unknown-linux-gnu, forced_compiler: false }, target: x86_64-unknown-linux-gnu } -- 0.000
fmt check
Diff in /checkout/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs:79:
 /// unique ID can be found in the type map.
 macro_rules! return_if_di_node_created_in_meantime {
     ($cx: expr, $unique_type_id: expr) => {
-        if let Some(di_node) = debug_context($cx)
-            .type_map
-            .di_node_for_unique_id($unique_type_id)
-        {
+        if let Some(di_node) = debug_context($cx).type_map.di_node_for_unique_id($unique_type_id) {
             return DINodeCreationResult::new(di_node, true);
         }
     };
Diff in /checkout/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs:103:
     span: Span,
 ) -> DINodeCreationResult<'ll> {
     let ty::Array(element_type, len) = array_type.kind() else {
-        bug!(
-            "build_fixed_size_array_di_node() called with non-ty::Array type `{:?}`",
-            array_type
-        )
+        bug!("build_fixed_size_array_di_node() called with non-ty::Array type `{:?}`", array_type)
     };
 
     let element_type_di_node = spanned_type_di_node(cx, *element_type, span);
Diff in /checkout/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs:183:
                 &ptr_type_debuginfo_name,
             );
 
-            DINodeCreationResult {
-                di_node,
-                already_stored_in_typemap: false,
-            }
+            DINodeCreationResult { di_node, already_stored_in_typemap: false }
         }
         Some(wide_pointer_kind) => {
             type_map::build_type_with_children(
Diff in /checkout/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs:292:
         .insert(unique_type_id, recursion_marker_type_di_node(cx));
 
     let fn_ty = unique_type_id.expect_ty();
-    let signature = cx
-        .tcx
-        .normalize_erasing_late_bound_regions(cx.typing_env(), fn_ty.fn_sig(cx.tcx));
+    let signature =
+        cx.tcx.normalize_erasing_late_bound_regions(cx.typing_env(), fn_ty.fn_sig(cx.tcx));
 
     let signature_di_nodes: SmallVec<_> = iter::once(
         // return type
Diff in /checkout/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs:308:
     )
     .chain(
         // regular arguments
-        signature
-            .inputs()
-            .iter()
-            .map(|&argument_type| Some(type_di_node(cx, argument_type))),
+        signature.inputs().iter().map(|&argument_type| Some(type_di_node(cx, argument_type))),
     )
     .collect();
 
Diff in /checkout/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs:318:
-    debug_context(cx)
-        .type_map
-        .unique_id_to_di_node
-        .borrow_mut()
-        .remove(&unique_type_id);
+    debug_context(cx).type_map.unique_id_to_di_node.borrow_mut().remove(&unique_type_id);
 
     let fn_di_node = create_subroutine_type(cx, &signature_di_nodes[..]);
 
Diff in /checkout/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs:327:
     let name = compute_debuginfo_type_name(cx.tcx, fn_ty, false);
     let (size, align) = match fn_ty.kind() {
         ty::FnDef(..) => (Size::ZERO, Align::ONE),
-        ty::FnPtr(..) => (
-            cx.tcx.data_layout.pointer_size(),
-            cx.tcx.data_layout.pointer_align().abi,
-        ),
+        ty::FnPtr(..) => {
+            (cx.tcx.data_layout.pointer_size(), cx.tcx.data_layout.pointer_align().abi)
+        }
         _ => unreachable!(),
     };
     let di_node = create_pointer_type(cx, fn_di_node, size, align, &name);
Diff in /checkout/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs:440:
 
     let element_type_di_node = type_di_node(cx, element_type);
     return_if_di_node_created_in_meantime!(cx, unique_type_id);
-    DINodeCreationResult {
-        di_node: element_type_di_node,
-        already_stored_in_typemap: false,
-    }
+    DINodeCreationResult { di_node: element_type_di_node, already_stored_in_typemap: false }
 }
 
 /// Get the debuginfo node for the given type.
Diff in /checkout/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs:461:
 ) -> &'ll DIType {
     let unique_type_id = UniqueTypeId::for_ty(cx.tcx, t);
 
-    if let Some(existing_di_node) = debug_context(cx)
-        .type_map
-        .di_node_for_unique_id(unique_type_id)
+    if let Some(existing_di_node) = debug_context(cx).type_map.di_node_for_unique_id(unique_type_id)
     {
         return existing_di_node;
     }
Diff in /checkout/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs:470:
 
     debug!("type_di_node: {:?} kind: {:?}", t, t.kind());
 
-    let DINodeCreationResult {
-        di_node,
-        already_stored_in_typemap,
-    } = match *t.kind() {
+    let DINodeCreationResult { di_node, already_stored_in_typemap } = match *t.kind() {
         ty::Never | ty::Bool | ty::Char | ty::Int(_) | ty::Uint(_) | ty::Float(_) => {
             build_basic_type_di_node(cx, t)
         }
Diff in /checkout/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs:490:
         // (or if there is no allocator argument).
         ty::Adt(def, args)
             if def.is_box()
-                && args
-                    .get(1)
-                    .is_none_or(|arg| cx.layout_of(arg.expect_ty()).is_1zst()) =>
+                && args.get(1).is_none_or(|arg| cx.layout_of(arg.expect_ty()).is_1zst()) =>
         {
             build_pointer_or_reference_di_node(cx, t, t.expect_boxed_ty(), unique_type_id)
         }
Diff in /checkout/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs:522:
     {
         if already_stored_in_typemap {
             // Make sure that we really do have a `TypeMap` entry for the unique type ID.
-            let di_node_for_uid = match debug_context(cx)
-                .type_map
-                .di_node_for_unique_id(unique_type_id)
-            {
-                Some(di_node) => di_node,
-                None => {
-                    bug!(
-                        "expected type debuginfo node for unique \
+            let di_node_for_uid =
+                match debug_context(cx).type_map.di_node_for_unique_id(unique_type_id) {
+                    Some(di_node) => di_node,
+                    None => {
+                        bug!(
+                            "expected type debuginfo node for unique \
                                type ID '{:?}' to already be in \
                                the `debuginfo::TypeMap` but it \
                                was not.",
Diff in /checkout/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs:536:
-                        unique_type_id,
-                    );
-                }
-            };
+                            unique_type_id,
+                        );
+                    }
+                };
 
             assert_eq!(di_node_for_uid as *const _, di_node as *const _);
         } else {
Diff in /checkout/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs:549:
 
 // FIXME(mw): Cache this via a regular UniqueTypeId instead of an extra field in the debug context.
 fn recursion_marker_type_di_node<'ll, 'tcx>(cx: &CodegenCx<'ll, 'tcx>) -> &'ll DIType {
-    *debug_context(cx)
-        .recursion_marker_type
-        .get_or_init(move || {
-            // The choice of type here is pretty arbitrary -
-            // anything reading the debuginfo for a recursive
-            // type is going to see *something* weird - the only
-            // question is what exactly it will see.
-            //
-            // FIXME: the name `<recur_type>` does not fit the naming scheme
-            //        of other types.
-            //
-            // FIXME: it might make sense to use an actual pointer type here
-            //        so that debuggers can show the address.
-            create_basic_type(
-                cx,
-                "<recur_type>",
-                cx.tcx.data_layout.pointer_size(),
-                dwarf_const::DW_ATE_unsigned,
-            )
-        })
+    *debug_context(cx).recursion_marker_type.get_or_init(move || {
+        // The choice of type here is pretty arbitrary -
+        // anything reading the debuginfo for a recursive
+        // type is going to see *something* weird - the only
+        // question is what exactly it will see.
+        //
+        // FIXME: the name `<recur_type>` does not fit the naming scheme
+        //        of other types.
+        //
+        // FIXME: it might make sense to use an actual pointer type here
+        //        so that debuggers can show the address.
+        create_basic_type(
+            cx,
+            "<recur_type>",
+            cx.tcx.data_layout.pointer_size(),
+            dwarf_const::DW_ATE_unsigned,
+        )
+    })
 }
 
 fn hex_encode(data: &[u8]) -> String {
Diff in /checkout/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs:618:
                     // By moving the working directory portion into the `directory` part of the
                     // DIFile, we allow LLVM to emit just the relative path for DWARF, while
                     // still emitting the correct absolute path for CodeView.
-                    (
-                        working_directory.to_string_lossy(),
-                        rel_path.to_string_lossy().into_owned(),
-                    )
+                    (working_directory.to_string_lossy(), rel_path.to_string_lossy().into_owned())
                 } else {
                     ("".into(), embeddable_name.to_string_lossy().into_owned())
                 }
Diff in /checkout/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs:628:
             }
             other => {
                 debug!(?other);
-                (
-                    "".into(),
-                    other
-                        .display(RemapPathScopeComponents::DEBUGINFO)
-                        .to_string(),
-                )
+                ("".into(), other.display(RemapPathScopeComponents::DEBUGINFO).to_string())
             }
         };
 
Diff in /checkout/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs:650:
         if cx.sess().opts.unstable_opts.embed_source {
             source = source_file.src.as_deref().map(String::as_str);
             if source.is_none() {
-                cx.tcx
-                    .sess
-                    .source_map()
-                    .ensure_source_file_source_present(source_file);
+                cx.tcx.sess.source_map().ensure_source_file_source_present(source_file);
                 external_src = source_file.external_src.read();
                 source = external_src.get_source();
             }
Diff in /checkout/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs:660:
         }
 
-        create_file(
-            DIB(cx),
-            &file_name,
-            &directory,
-            &hash_value,
-            hash_kind,
-            source,
-        )
+        create_file(DIB(cx), &file_name, &directory, &hash_value, hash_kind, source)
     }
 }
 
Diff in /checkout/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs:673:
 fn unknown_file_metadata<'ll>(cx: &CodegenCx<'ll, '_>) -> &'ll DIFile {
-    debug_context(cx)
-        .created_files
-        .borrow_mut()
-        .entry(None)
-        .or_insert_with(|| {
-            create_file(DIB(cx), "<unknown>", "", "", llvm::ChecksumKind::None, None)
-        })
+    debug_context(cx).created_files.borrow_mut().entry(None).or_insert_with(|| {
+        create_file(DIB(cx), "<unknown>", "", "", llvm::ChecksumKind::None, None)
+    })
 }
 
 fn create_file<'ll>(
Diff in /checkout/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs:958:
             codegen_unit_name,
         ) {
         // We get a path relative to the working directory from split_dwarf_path
-        Some(
-            tcx.sess
-                .source_map()
-                .path_mapping()
-                .to_real_filename(work_dir, f),
-        )
+        Some(tcx.sess.source_map().path_mapping().to_real_filename(work_dir, f))
     } else {
         None
     };
Diff in /checkout/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs:970:
     let split_name = split_name
         .as_ref()
-        .map(|f| {
-            f.path(RemapPathScopeComponents::DEBUGINFO)
-                .to_string_lossy()
-        })
+        .map(|f| f.path(RemapPathScopeComponents::DEBUGINFO).to_string_lossy())
         .unwrap_or_default();
-    let work_dir = work_dir
-        .path(RemapPathScopeComponents::DEBUGINFO)
-        .to_string_lossy();
+    let work_dir = work_dir.path(RemapPathScopeComponents::DEBUGINFO).to_string_lossy();
     let kind = DebugEmissionKind::from_generic(tcx.sess.opts.debuginfo);
 
     let dwarf_version = tcx.sess.dwarf_version();
Diff in /checkout/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs:983:
-    let is_dwarf_kind = matches!(
-        tcx.sess.target.debuginfo_kind,
-        DebuginfoKind::Dwarf | DebuginfoKind::DwarfDsym
-    );
+    let is_dwarf_kind =
+        matches!(tcx.sess.target.debuginfo_kind, DebuginfoKind::Dwarf | DebuginfoKind::DwarfDsym);
     // Don't emit `.debug_pubnames` and `.debug_pubtypes` on DWARFv4 or lower.
     let debug_name_table_kind = if is_dwarf_kind && dwarf_version <= 4 {
         DebugNameTableKind::None
Diff in /checkout/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs:1113:
     let struct_type = unique_type_id.expect_ty();
 
     let ty::Adt(adt_def, _) = struct_type.kind() else {
-        bug!(
-            "build_struct_type_di_node() called with non-struct-type: {:?}",
-            struct_type
-        );
+        bug!("build_struct_type_di_node() called with non-struct-type: {:?}", struct_type);
     };
     assert!(adt_def.is_struct());
     let containing_scope = get_namespace_for_item(cx, adt_def.did());
Diff in /checkout/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs:1232:
     };
 
     let (bitstride, element_di_node) = if element_ty.is_bool() {
-        (
-            Some(llvm::LLVMValueAsMetadata(cx.const_i64(1))),
-            type_di_node(cx, cx.tcx.types.u8),
-        )
+        (Some(llvm::LLVMValueAsMetadata(cx.const_i64(1))), type_di_node(cx, cx.tcx.types.u8))
     } else {
         (None, type_di_node(cx, element_ty))
     };
Diff in /checkout/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs:1286:
     };
 
     debug_context(cx).type_map.insert(unique_type_id, metadata);
-    DINodeCreationResult {
-        di_node: metadata,
-        already_stored_in_typemap: true,
-    }
+    DINodeCreationResult { di_node: metadata, already_stored_in_typemap: true }
 }
 
 //=-----------------------------------------------------------------------------
Diff in /checkout/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs:1348:
 ) -> DINodeCreationResult<'ll> {
     let tuple_type = unique_type_id.expect_ty();
     let &ty::Tuple(component_types) = tuple_type.kind() else {
-        bug!(
-            "build_tuple_type_di_node() called with non-tuple-type: {:?}",
-            tuple_type
-        )
+        bug!("build_tuple_type_di_node() called with non-tuple-type: {:?}", tuple_type)
     };
 
     let tuple_type_and_layout = cx.layout_of(tuple_type);
Diff in /checkout/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs:1400:
     let closure_env_type = unique_type_id.expect_ty();
     let &(ty::Closure(def_id, _) | ty::CoroutineClosure(def_id, _)) = closure_env_type.kind()
     else {
-        bug!(
-            "build_closure_env_di_node() called with non-closure-type: {:?}",
-            closure_env_type
-        )
+        bug!("build_closure_env_di_node() called with non-closure-type: {:?}", closure_env_type)
     };
     let containing_scope = get_namespace_for_item(cx, def_id);
     let type_name = compute_debuginfo_type_name(cx.tcx, closure_env_type, false);
Diff in /checkout/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs:1523:
     return smallvec![];
 
     fn get_parameter_names(cx: &CodegenCx<'_, '_>, generics: &ty::Generics) -> Vec<Symbol> {
-        let mut names = generics.parent.map_or_else(Vec::new, |def_id| {
-            get_parameter_names(cx, cx.tcx.generics_of(def_id))
-        });
+        let mut names = generics
+            .parent
+            .map_or_else(Vec::new, |def_id| get_parameter_names(cx, cx.tcx.generics_of(def_id)));
         names.extend(generics.own_params.iter().map(|param| param.name));
         names
     }
Diff in /checkout/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs:1557:
 
     let is_local_to_unit = is_node_local_to_unit(cx, def_id);
 
-    let DefKind::Static { nested, .. } = cx.tcx.def_kind(def_id) else {
-        bug!()
-    };
+    let DefKind::Static { nested, .. } = cx.tcx.def_kind(def_id) else { bug!() };
     if nested {
         return;
     }
Diff in /checkout/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs:1570:
     let linkage_name = mangled_name_of_instance(cx, Instance::mono(tcx, def_id)).name;
     // When empty, linkage_name field is omitted,
     // which is what we want for no_mangle statics
-    let linkage_name = if var_name == linkage_name {
-        ""
-    } else {
-        linkage_name
-    };
+    let linkage_name = if var_name == linkage_name { "" } else { linkage_name };
 
     let global_align = cx.align_of(variable_type);
 
Diff in /checkout/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs:1628:
     // If `usize` is not pointer-sized and -aligned then the size and alignment computations
     // for the vtable as a whole would be wrong. Let's make sure this holds even on weird
     // platforms.
-    assert_eq!(
-        cx.size_and_align_of(tcx.types.usize),
-        (pointer_size, pointer_align)
-    );
+    assert_eq!(cx.size_and_align_of(tcx.types.usize), (pointer_size, pointer_align));
 
     let vtable_type_name =
         compute_debuginfo_vtable_name(cx.tcx, ty, poly_trait_ref, VTableNameKind::Type);
Diff in /checkout/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs:1669:
                             //       (coming from different traits).
                             (format!("__method{index}"), void_pointer_type_di_node)
                         }
-                        ty::VtblEntry::TraitVPtr(_) => (
-                            format!("__super_trait_ptr{index}"),
-                            void_pointer_type_di_node,
-                        ),
+                        ty::VtblEntry::TraitVPtr(_) => {
+                            (format!("__super_trait_ptr{index}"), void_pointer_type_di_node)
+                        }
                         ty::VtblEntry::MetadataAlign => ("align".to_string(), usize_di_node),
                         ty::VtblEntry::MetadataSize => ("size".to_string(), usize_di_node),
                         ty::VtblEntry::Vacant => return None,
Diff in /checkout/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs:1825:
     let type_ = [llvm::LLVMValueAsMetadata(cx.const_usize(0)), typeid];
     cx.global_add_metadata_node(vtable, llvm::MD_type, &type_);
 
-    let vcall_visibility = [llvm::LLVMValueAsMetadata(
-        cx.const_u64(vcall_visibility as u64),
-    )];
+    let vcall_visibility = [llvm::LLVMValueAsMetadata(cx.const_u64(vcall_visibility as u64))];
     cx.global_set_metadata_node(vtable, llvm::MD_vcall_visibility, &vcall_visibility);
 }
 
Diff in /checkout/compiler/rustc_mir_transform/src/validate.rs:39:
         // terribly important that they pass the validator. However, I think other passes might
         // still see them, in which case they might be surprised. It would probably be better if we
         // didn't put this through the MIR pipeline at all.
-        if matches!(
-            body.source.instance,
-            InstanceKind::Intrinsic(..) | InstanceKind::Virtual(..)
-        ) {
+        if matches!(body.source.instance, InstanceKind::Intrinsic(..) | InstanceKind::Virtual(..)) {
             return;
         }
         let def_id = body.source.def_id();
Diff in /checkout/compiler/rustc_mir_transform/src/validate.rs:164:
                 ),
             }
         } else {
-            self.fail(
-                location,
-                format!("encountered jump to invalid basic block {bb:?}"),
-            )
+            self.fail(location, format!("encountered jump to invalid basic block {bb:?}"))
         }
     }
 
Diff in /checkout/compiler/rustc_mir_transform/src/validate.rs:282:
 
     fn is_critical_call_edge(&self, target: Option<BasicBlock>, unwind: UnwindAction) -> bool {
         let Some(target) = target else { return false };
-        matches!(
-            unwind,
-            UnwindAction::Cleanup(_) | UnwindAction::Terminate(_)
-        ) && self.body.basic_blocks.predecessors()[target].len() > 1
+        matches!(unwind, UnwindAction::Cleanup(_) | UnwindAction::Terminate(_))
+            && self.body.basic_blocks.predecessors()[target].len() > 1
     }
 }
 
Diff in /checkout/compiler/rustc_mir_transform/src/validate.rs:319:
             }
             StatementKind::SetDiscriminant { .. } => {
                 if self.body.phase < MirPhase::Runtime(RuntimePhase::Initial) {
-                    self.fail(
-                        location,
-                        "`SetDiscriminant`is not allowed until deaggregation",
-                    );
+                    self.fail(location, "`SetDiscriminant`is not allowed until deaggregation");
                 }
---
                 );
             }
-            if projection
-                .iter()
-                .any(|p| !matches!(p, PlaceElem::Field(..)))
-            {
+            if projection.iter().any(|p| !matches!(p, PlaceElem::Field(..))) {
                 self.fail(
                     START_BLOCK.start_location(),
                     format!(
Diff in /checkout/compiler/rustc_mir_transform/src/validate.rs:1003:
                 if place.projection.iter().any(|p| !p.can_use_in_debuginfo()) {
                     self.fail(
                         START_BLOCK.start_location(),
-                        format!(
-                            "illegal place {:?} in debuginfo for {:?}",
-                            place, debuginfo.name
-                        ),
+                        format!("illegal place {:?} in debuginfo for {:?}", place, debuginfo.name),
                     );
                 }
             }
Diff in /checkout/compiler/rustc_mir_transform/src/validate.rs:1092:
             Rvalue::Use(_, _) => {}
             Rvalue::CopyForDeref(_) => {
                 if self.body.phase >= MirPhase::Runtime(RuntimePhase::Initial) {
-                    self.fail(
-                        location,
-                        "`CopyForDeref` should have been removed in runtime MIR",
-                    );
+                    self.fail(location, "`CopyForDeref` should have been removed in runtime MIR");
                 }
             }
             Rvalue::Aggregate(kind, fields) => match **kind {
Diff in /checkout/compiler/rustc_mir_transform/src/validate.rs:1147:
                 AggregateKind::Closure(_, args) => {
                     let upvars = args.as_closure().upvar_tys();
                     if upvars.len() != fields.len() {
-                        self.fail(
-                            location,
-                            "closure has the wrong number of initialized fields",
-                        );
+                        self.fail(location, "closure has the wrong number of initialized fields");
                     }
                     for (src, dest) in std::iter::zip(fields, upvars) {
                         if !self.mir_assign_valid_types(src.ty(self.body, self.tcx), dest) {
Diff in /checkout/compiler/rustc_mir_transform/src/validate.rs:1161:
                 AggregateKind::Coroutine(_, args) => {
                     let upvars = args.as_coroutine().upvar_tys();
                     if upvars.len() != fields.len() {
-                        self.fail(
-                            location,
-                            "coroutine has the wrong number of initialized fields",
-                        );
+                        self.fail(location, "coroutine has the wrong number of initialized fields");
                     }
                     for (src, dest) in std::iter::zip(fields, upvars) {
                         if !self.mir_assign_valid_types(src.ty(self.body, self.tcx), dest) {
Diff in /checkout/compiler/rustc_mir_transform/src/validate.rs:1566:
                         self.body.local_decls[local].local_info
                     && !matches!(rvalue, Rvalue::CopyForDeref(_))
                 {
-                    self.fail(
-                        location,
-                        "assignment to a `DerefTemp` must use `CopyForDeref`",
-                    )
+                    self.fail(location, "assignment to a `DerefTemp` must use `CopyForDeref`")
                 }
             }
             StatementKind::AscribeUserType(..) => {
Diff in /checkout/compiler/rustc_mir_transform/src/validate.rs:1633:
             }
             StatementKind::SetDiscriminant { place, .. } => {
                 if self.body.phase < MirPhase::Runtime(RuntimePhase::Initial) {
-                    self.fail(
-                        location,
-                        "`SetDiscriminant`is not allowed until deaggregation",
-                    );
+                    self.fail(location, "`SetDiscriminant`is not allowed until deaggregation");
                 }
                 let pty = place.ty(&self.body.local_decls, self.tcx).ty;
                 if !matches!(
Diff in /checkout/compiler/rustc_mir_transform/src/validate.rs:1643:
                     pty.kind(),
                     ty::Adt(..)
                         | ty::Coroutine(..)
-                        | ty::Alias(ty::AliasTy {
-                            kind: ty::Opaque { .. },
-                            ..
-                        })
+                        | ty::Alias(ty::AliasTy { kind: ty::Opaque { .. }, .. })
                 ) {
                     self.fail(
                         location,
Diff in /checkout/compiler/rustc_mir_transform/src/validate.rs:1757:
 }
 
 pub(super) fn validate_debuginfos<'tcx>(body: &Body<'tcx>) -> Vec<(Location, String)> {
-    let mut debuginfo_checker = DebuginfoChecker {
-        debuginfo_locals: debuginfo_locals(body),
-        failures: Vec::new(),
-    };
+    let mut debuginfo_checker =
+        DebuginfoChecker { debuginfo_locals: debuginfo_locals(body), failures: Vec::new() };
     debuginfo_checker.visit_body(body);
     debuginfo_checker.failures
 }
Diff in /checkout/compiler/rustc_mir_transform/src/validate.rs:1780:
             StmtDebugInfo::AssignRef(local, _) | StmtDebugInfo::InvalidAssign(local) => *local,
         };
         if !self.debuginfo_locals.contains(local) {
-            self.failures
-                .push((location, format!("{local:?} is not in debuginfo")));
+            self.failures.push((location, format!("{local:?} is not in debuginfo")));
         }
     }
 }
fmt: checked 6864 files
Bootstrap failed while executing `test src/tools/tidy tidyselftest --extra-checks=py,cpp,js,spellcheck`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants