about summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-07-28 02:09:05 +0000
committerbors <bors@rust-lang.org>2025-07-28 02:09:05 +0000
commit733dab558992d902d6d17576de1da768094e2cf3 (patch)
treec36891d3e7417fc84ef299b806d7601eb3d26471 /compiler/rustc_hir_analysis/src
parent2b5e239c6b86cde974b0ef0f8e23754fb08ff3c5 (diff)
parentd33c8f933696ab1fcdbca369d4c18f436a7faf4c (diff)
downloadrust-733dab558992d902d6d17576de1da768094e2cf3.tar.gz
rust-733dab558992d902d6d17576de1da768094e2cf3.zip
Auto merge of #144556 - matthiaskrgr:rollup-aayo3h5, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#143607 (Port the proc macro attributes to the new attribute parsing infrastructure)
 - rust-lang/rust#144471 (Remove `compiler-builtins-{no-asm,mangled-names}`)
 - rust-lang/rust#144495 (bump cargo_metadata)
 - rust-lang/rust#144523 (rustdoc: save target modifiers)
 - rust-lang/rust#144534 (check_static_item: explain should_check_for_sync choices)
 - rust-lang/rust#144535 (miri: for ABI mismatch errors, say which argument is the problem)

Failed merges:

 - rust-lang/rust#144536 (miri subtree update)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_hir_analysis/src')
-rw-r--r--compiler/rustc_hir_analysis/src/check/check.rs4
-rw-r--r--compiler/rustc_hir_analysis/src/collect/type_of.rs8
2 files changed, 9 insertions, 3 deletions
diff --git a/compiler/rustc_hir_analysis/src/check/check.rs b/compiler/rustc_hir_analysis/src/check/check.rs
index acc831d30ca..6e63ce31024 100644
--- a/compiler/rustc_hir_analysis/src/check/check.rs
+++ b/compiler/rustc_hir_analysis/src/check/check.rs
@@ -768,7 +768,9 @@ pub(crate) fn check_item_type(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Result<(),
                     check_static_inhabited(tcx, def_id);
                     check_static_linkage(tcx, def_id);
                     let ty = tcx.type_of(def_id).instantiate_identity();
-                    res = res.and(wfcheck::check_static_item(tcx, def_id, ty, true));
+                    res = res.and(wfcheck::check_static_item(
+                        tcx, def_id, ty, /* should_check_for_sync */ true,
+                    ));
                 }
                 DefKind::Const => res = res.and(wfcheck::check_const_item(tcx, def_id)),
                 _ => unreachable!(),
diff --git a/compiler/rustc_hir_analysis/src/collect/type_of.rs b/compiler/rustc_hir_analysis/src/collect/type_of.rs
index 68a91212e50..22fb02714dd 100644
--- a/compiler/rustc_hir_analysis/src/collect/type_of.rs
+++ b/compiler/rustc_hir_analysis/src/collect/type_of.rs
@@ -221,7 +221,9 @@ pub(super) fn type_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::EarlyBinder<'_
                     let ty = icx.lower_ty(ty);
                     // MIR relies on references to statics being scalars.
                     // Verify that here to avoid ill-formed MIR.
-                    match check_static_item(tcx, def_id, ty, false) {
+                    // We skip the `Sync` check to avoid cycles for type-alias-impl-trait,
+                    // relying on the fact that non-Sync statics don't ICE the rest of the compiler.
+                    match check_static_item(tcx, def_id, ty, /* should_check_for_sync */ false) {
                         Ok(()) => ty,
                         Err(guar) => Ty::new_error(tcx, guar),
                     }
@@ -286,7 +288,9 @@ pub(super) fn type_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::EarlyBinder<'_
                 let ty = icx.lower_ty(ty);
                 // MIR relies on references to statics being scalars.
                 // Verify that here to avoid ill-formed MIR.
-                match check_static_item(tcx, def_id, ty, false) {
+                // We skip the `Sync` check to avoid cycles for type-alias-impl-trait,
+                // relying on the fact that non-Sync statics don't ICE the rest of the compiler.
+                match check_static_item(tcx, def_id, ty, /* should_check_for_sync */ false) {
                     Ok(()) => ty,
                     Err(guar) => Ty::new_error(tcx, guar),
                 }