about summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis/src/check/check.rs
diff options
context:
space:
mode:
authorMatthias Krüger <476013+matthiaskrgr@users.noreply.github.com>2025-07-27 10:19:00 +0200
committerGitHub <noreply@github.com>2025-07-27 10:19:00 +0200
commit58f10376f4b25a9cec4b39a030aaa51dbcc56782 (patch)
treee760a4814b906dcc764a37df2fcc1450f7b91b35 /compiler/rustc_hir_analysis/src/check/check.rs
parent052114f0c5e8d49f62f8caba364b07017310ab09 (diff)
parent8817572b4595df352e6a7fdd56422fb07cd28d89 (diff)
downloadrust-58f10376f4b25a9cec4b39a030aaa51dbcc56782.tar.gz
rust-58f10376f4b25a9cec4b39a030aaa51dbcc56782.zip
Rollup merge of #144226 - cjgillot:known-panics-panics, r=oli-obk
Do not assert layout in KnownPanicsLint.

Fixes rust-lang/rust#121176
Fixes rust-lang/rust#129109
Fixes rust-lang/rust#130970
Fixes rust-lang/rust#131347
Fixes rust-lang/rust#139872
Fixes rust-lang/rust#140332
Diffstat (limited to 'compiler/rustc_hir_analysis/src/check/check.rs')
-rw-r--r--compiler/rustc_hir_analysis/src/check/check.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/rustc_hir_analysis/src/check/check.rs b/compiler/rustc_hir_analysis/src/check/check.rs
index bb1de5bcfc3..acc831d30ca 100644
--- a/compiler/rustc_hir_analysis/src/check/check.rs
+++ b/compiler/rustc_hir_analysis/src/check/check.rs
@@ -767,7 +767,8 @@ pub(crate) fn check_item_type(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Result<(),
                 DefKind::Static { .. } => {
                     check_static_inhabited(tcx, def_id);
                     check_static_linkage(tcx, def_id);
-                    res = res.and(wfcheck::check_static_item(tcx, def_id));
+                    let ty = tcx.type_of(def_id).instantiate_identity();
+                    res = res.and(wfcheck::check_static_item(tcx, def_id, ty, true));
                 }
                 DefKind::Const => res = res.and(wfcheck::check_const_item(tcx, def_id)),
                 _ => unreachable!(),