about summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis/src/check/wfcheck.rs
diff options
context:
space:
mode:
authorDavid Wood <david.wood2@arm.com>2025-01-16 14:27:49 +0000
committerDavid Wood <david.wood2@arm.com>2025-06-16 15:00:22 +0000
commit3b0e1c17d285f5e8f93c07b5fc8f9c6aa277c0dd (patch)
treee27b0db7c88b60332b6790cf4aaeadca99ab8911 /compiler/rustc_hir_analysis/src/check/wfcheck.rs
parentd43da6f4de19ccfc6ac5a8e6b16ab8cf2893692a (diff)
downloadrust-3b0e1c17d285f5e8f93c07b5fc8f9c6aa277c0dd.tar.gz
rust-3b0e1c17d285f5e8f93c07b5fc8f9c6aa277c0dd.zip
trait_sel: `{Meta,Pointee}Sized` on `?Sized` types
Expand the automatic implementation of `MetaSized` and `PointeeSized` so
that it is also implemented on non-`Sized` types, just not `ty::Foreign`
(extern type).
Diffstat (limited to 'compiler/rustc_hir_analysis/src/check/wfcheck.rs')
-rw-r--r--compiler/rustc_hir_analysis/src/check/wfcheck.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/rustc_hir_analysis/src/check/wfcheck.rs b/compiler/rustc_hir_analysis/src/check/wfcheck.rs
index b8dc01cbc03..20d0e87b7a7 100644
--- a/compiler/rustc_hir_analysis/src/check/wfcheck.rs
+++ b/compiler/rustc_hir_analysis/src/check/wfcheck.rs
@@ -1258,6 +1258,11 @@ fn check_trait(tcx: TyCtxt<'_>, item: &hir::Item<'_>) -> Result<(), ErrorGuarant
     debug!(?item.owner_id);
 
     let def_id = item.owner_id.def_id;
+    if tcx.is_lang_item(def_id.into(), LangItem::PointeeSized) {
+        // `PointeeSized` is removed during lowering.
+        return Ok(());
+    }
+
     let trait_def = tcx.trait_def(def_id);
     if trait_def.is_marker
         || matches!(trait_def.specialization_kind, TraitSpecializationKind::Marker)