File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 1- #![ feature( box_syntax ) ]
1+ #![ feature( rustc_attrs , stmt_expr_attributes ) ]
22#![ deny( unused_allocation) ]
33
44fn main ( ) {
5- _ = ( box [ 1 ] ) . len ( ) ; //~ error: unnecessary allocation, use `&` instead
5+ _ = ( # [ rustc_box ] Box :: new ( [ 1 ] ) ) . len ( ) ; //~ error: unnecessary allocation, use `&` instead
66 _ = Box :: new ( [ 1 ] ) . len ( ) ; //~ error: unnecessary allocation, use `&` instead
77}
Original file line number Diff line number Diff line change 11error: unnecessary allocation, use `&` instead
22 --> $DIR/unused-allocation.rs:5:9
33 |
4- LL | _ = (box [1]).len();
5- | ^^^^^^^^^
4+ LL | _ = (#[rustc_box] Box::new( [1]) ).len();
5+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66 |
77note: the lint level is defined here
88 --> $DIR/unused-allocation.rs:2:9
You can’t perform that action at this time.
0 commit comments