11error: `Vec<T>` is already on the heap, the boxing is unnecessary
2- --> $DIR/vec_box_sized.rs:11 :14
2+ --> $DIR/vec_box_sized.rs:24 :14
33 |
44LL | const C: Vec<Box<i32>> = Vec::new();
55 | ^^^^^^^^^^^^^ help: try: `Vec<i32>`
@@ -8,34 +8,52 @@ LL | const C: Vec<Box<i32>> = Vec::new();
88 = help: to override `-D warnings` add `#[allow(clippy::vec_box)]`
99
1010error: `Vec<T>` is already on the heap, the boxing is unnecessary
11- --> $DIR/vec_box_sized.rs:12 :15
11+ --> $DIR/vec_box_sized.rs:25 :15
1212 |
1313LL | static S: Vec<Box<i32>> = Vec::new();
1414 | ^^^^^^^^^^^^^ help: try: `Vec<i32>`
1515
1616error: `Vec<T>` is already on the heap, the boxing is unnecessary
17- --> $DIR/vec_box_sized.rs:15 :21
17+ --> $DIR/vec_box_sized.rs:28 :21
1818 |
1919LL | sized_type: Vec<Box<SizedStruct>>,
2020 | ^^^^^^^^^^^^^^^^^^^^^ help: try: `Vec<SizedStruct>`
2121
2222error: `Vec<T>` is already on the heap, the boxing is unnecessary
23- --> $DIR/vec_box_sized.rs:18 :14
23+ --> $DIR/vec_box_sized.rs:31 :14
2424 |
2525LL | struct A(Vec<Box<SizedStruct>>);
2626 | ^^^^^^^^^^^^^^^^^^^^^ help: try: `Vec<SizedStruct>`
2727
2828error: `Vec<T>` is already on the heap, the boxing is unnecessary
29- --> $DIR/vec_box_sized.rs:19 :18
29+ --> $DIR/vec_box_sized.rs:32 :18
3030 |
3131LL | struct B(Vec<Vec<Box<(u32)>>>);
3232 | ^^^^^^^^^^^^^^^ help: try: `Vec<u32>`
3333
3434error: `Vec<T>` is already on the heap, the boxing is unnecessary
35- --> $DIR/vec_box_sized.rs:63:23
35+ --> $DIR/vec_box_sized.rs:34:42
36+ |
37+ LL | fn allocator_global_defined_vec() -> Vec<Box<i32>, std::alloc::Global> {
38+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Vec<i32>`
39+
40+ error: `Vec<T>` is already on the heap, the boxing is unnecessary
41+ --> $DIR/vec_box_sized.rs:37:42
42+ |
43+ LL | fn allocator_global_defined_box() -> Vec<Box<i32, std::alloc::Global>> {
44+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Vec<i32>`
45+
46+ error: `Vec<T>` is already on the heap, the boxing is unnecessary
47+ --> $DIR/vec_box_sized.rs:40:29
48+ |
49+ LL | fn allocator_match() -> Vec<Box<i32, DummyAllocator>, DummyAllocator> {
50+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Vec<i32>`
51+
52+ error: `Vec<T>` is already on the heap, the boxing is unnecessary
53+ --> $DIR/vec_box_sized.rs:74:23
3654 |
3755LL | pub fn f() -> Vec<Box<S>> {
3856 | ^^^^^^^^^^^ help: try: `Vec<S>`
3957
40- error: aborting due to 6 previous errors
58+ error: aborting due to 9 previous errors
4159
0 commit comments