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 ) ]
2
2
#![ deny( unused_allocation) ]
3
3
4
4
fn main ( ) {
5
- _ = ( box [ 1 ] ) . len ( ) ; //~ error: unnecessary allocation, use `&` instead
5
+ _ = ( # [ rustc_box ] Box :: new ( [ 1 ] ) ) . len ( ) ; //~ error: unnecessary allocation, use `&` instead
6
6
_ = Box :: new ( [ 1 ] ) . len ( ) ; //~ error: unnecessary allocation, use `&` instead
7
7
}
Original file line number Diff line number Diff line change 1
1
error: unnecessary allocation, use `&` instead
2
2
--> $DIR/unused-allocation.rs:5:9
3
3
|
4
- LL | _ = (box [1]).len();
5
- | ^^^^^^^^^
4
+ LL | _ = (#[rustc_box] Box::new( [1]) ).len();
5
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6
6
|
7
7
note: the lint level is defined here
8
8
--> $DIR/unused-allocation.rs:2:9
You can’t perform that action at this time.
0 commit comments