Open
Description
fn lol(x: Box<[u8]>) {
unimplemented!();
}
warning: local variable doesn't need to be boxed here
--> src/lib.rs:1:8
|
1 | fn lol(x: Box<[u8]>) {
| ^
|
= note: `#[warn(clippy::boxed_local)]` on by default
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#boxed_local
This is kind of an interesting case; the suggestion isn't wrong per se, but it's definitely not optimal. The lint explainer as currently worded strongly suggests "an unboxed T
would work fine", whereas with ?Sized
values this obviously cannot be done. The owned value has to be boxed or otherwise behind an indirection.