rust/tests/ui/lint/unused/unused-allocation.rs

6 lines
123 B
Rust

#![deny(unused_allocation)]
fn main() {
_ = Box::new([1]).len(); //~ error: unnecessary allocation, use `&` instead
}