about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDavid Wood <david.wood2@arm.com>2025-04-09 16:49:28 +0000
committerDavid Wood <david.wood2@arm.com>2025-06-16 23:04:33 +0000
commitf0b84b8dcfc15c3936256ccb438b1d050620ff3c (patch)
treec149ca8c4a6b95e7f69b56d558cd82512ca9409c
parent884d0e031a046af894b43180032c1803bb6d0834 (diff)
downloadrust-f0b84b8dcfc15c3936256ccb438b1d050620ff3c.tar.gz
rust-f0b84b8dcfc15c3936256ccb438b1d050620ff3c.zip
lint: don't consider sizedness in upcastable lint
Adding a sizedness supertrait shouldn't require multiple vtables so
shouldn't be linted against.
-rw-r--r--compiler/rustc_lint/src/multiple_supertrait_upcastable.rs3
-rw-r--r--library/core/src/ops/deref.rs1
2 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_lint/src/multiple_supertrait_upcastable.rs b/compiler/rustc_lint/src/multiple_supertrait_upcastable.rs
index dea7c8ac708..3cc55eaa0f2 100644
--- a/compiler/rustc_lint/src/multiple_supertrait_upcastable.rs
+++ b/compiler/rustc_lint/src/multiple_supertrait_upcastable.rs
@@ -46,7 +46,8 @@ impl<'tcx> LateLintPass<'tcx> for MultipleSupertraitUpcastable {
                 .tcx
                 .explicit_super_predicates_of(def_id)
                 .iter_identity_copied()
-                .filter_map(|(pred, _)| pred.as_trait_clause());
+                .filter_map(|(pred, _)| pred.as_trait_clause())
+                .filter(|pred| !cx.tcx.is_lang_item(pred.def_id(), hir::LangItem::MetaSized));
             if direct_super_traits_iter.count() > 1 {
                 cx.emit_span_lint(
                     MULTIPLE_SUPERTRAIT_UPCASTABLE,
diff --git a/library/core/src/ops/deref.rs b/library/core/src/ops/deref.rs
index f62bf702469..9d9d18095bc 100644
--- a/library/core/src/ops/deref.rs
+++ b/library/core/src/ops/deref.rs
@@ -269,7 +269,6 @@ impl<T: ?Sized> const Deref for &mut T {
 #[stable(feature = "rust1", since = "1.0.0")]
 #[const_trait]
 #[rustc_const_unstable(feature = "const_deref", issue = "88955")]
-#[allow(multiple_supertrait_upcastable)]
 pub trait DerefMut: ~const Deref + PointeeSized {
     /// Mutably dereferences the value.
     #[stable(feature = "rust1", since = "1.0.0")]