Skip to content

Commit f0b84b8

Browse files
committed
lint: don't consider sizedness in upcastable lint
Adding a sizedness supertrait shouldn't require multiple vtables so shouldn't be linted against.
1 parent 884d0e0 commit f0b84b8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

compiler/rustc_lint/src/multiple_supertrait_upcastable.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ impl<'tcx> LateLintPass<'tcx> for MultipleSupertraitUpcastable {
4646
.tcx
4747
.explicit_super_predicates_of(def_id)
4848
.iter_identity_copied()
49-
.filter_map(|(pred, _)| pred.as_trait_clause());
49+
.filter_map(|(pred, _)| pred.as_trait_clause())
50+
.filter(|pred| !cx.tcx.is_lang_item(pred.def_id(), hir::LangItem::MetaSized));
5051
if direct_super_traits_iter.count() > 1 {
5152
cx.emit_span_lint(
5253
MULTIPLE_SUPERTRAIT_UPCASTABLE,

library/core/src/ops/deref.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,6 @@ impl<T: ?Sized> const Deref for &mut T {
269269
#[stable(feature = "rust1", since = "1.0.0")]
270270
#[const_trait]
271271
#[rustc_const_unstable(feature = "const_deref", issue = "88955")]
272-
#[allow(multiple_supertrait_upcastable)]
273272
pub trait DerefMut: ~const Deref + PointeeSized {
274273
/// Mutably dereferences the value.
275274
#[stable(feature = "rust1", since = "1.0.0")]

0 commit comments

Comments
 (0)