summaryrefslogtreecommitdiffstats
path: root/tests/ui/lint/unused/unused-allocation.rs
blob: c1a6f5ceaf17880e7d3381886b80c09016697d3b (plain)
1
2
3
4
5
6
7
#![feature(rustc_attrs, stmt_expr_attributes)]
#![deny(unused_allocation)]

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