RS.CLIPPY.NEEDLESS_MAYBE_SIZED

A `?Sized` bound that is unusable due to a `Sized` requirement

This checker is a Clippy lint created by The Rust Project Contributors. The documentation shown here is a copy of the original documentation for: needless_maybe_sized. Copyright ©2025 The Rust Team. All rights reserved.

What it does

Lints ?Sized bounds applied to type parameters that cannot be unsized

Why is this bad?

The ?Sized bound is misleading because it cannot be satisfied by an unsized type

Example

// `T` cannot be unsized because `Clone` requires it to be `Sized`
fn f<T: Clone + ?Sized>(t: &T) {}

Use instead:

fn f<T: Clone>(t: &T) {}

// or choose alternative bounds for `T` so that it can be unsized