lint: don't consider sizedness in upcastable lint
Adding a sizedness supertrait shouldn't require multiple vtables so shouldn't be linted against.
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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")]
|
||||
|
||||
Reference in New Issue
Block a user