1 error: usage of `Box<&T>`
2 --> $DIR/redundant_allocation_fixable.rs:26:30
4 LL | pub fn box_test1<T>(foo: Box<&T>) {}
5 | ^^^^^^^ help: try: `&T`
7 = note: `-D clippy::redundant-allocation` implied by `-D warnings`
8 = note: `&T` is already a pointer, `Box<&T>` allocates a pointer on the heap
10 error: usage of `Box<&MyStruct>`
11 --> $DIR/redundant_allocation_fixable.rs:28:27
13 LL | pub fn box_test2(foo: Box<&MyStruct>) {}
14 | ^^^^^^^^^^^^^^ help: try: `&MyStruct`
16 = note: `&MyStruct` is already a pointer, `Box<&MyStruct>` allocates a pointer on the heap
18 error: usage of `Box<&MyEnum>`
19 --> $DIR/redundant_allocation_fixable.rs:30:27
21 LL | pub fn box_test3(foo: Box<&MyEnum>) {}
22 | ^^^^^^^^^^^^ help: try: `&MyEnum`
24 = note: `&MyEnum` is already a pointer, `Box<&MyEnum>` allocates a pointer on the heap
26 error: usage of `Box<Box<T>>`
27 --> $DIR/redundant_allocation_fixable.rs:34:30
29 LL | pub fn box_test5<T>(foo: Box<Box<T>>) {}
30 | ^^^^^^^^^^^ help: try: `Box<T>`
32 = note: `Box<T>` is already on the heap, `Box<Box<T>>` makes an extra allocation
34 error: usage of `Rc<&T>`
35 --> $DIR/redundant_allocation_fixable.rs:45:29
37 LL | pub fn rc_test1<T>(foo: Rc<&T>) {}
38 | ^^^^^^ help: try: `&T`
40 = note: `&T` is already a pointer, `Rc<&T>` allocates a pointer on the heap
42 error: usage of `Rc<&MyStruct>`
43 --> $DIR/redundant_allocation_fixable.rs:47:26
45 LL | pub fn rc_test2(foo: Rc<&MyStruct>) {}
46 | ^^^^^^^^^^^^^ help: try: `&MyStruct`
48 = note: `&MyStruct` is already a pointer, `Rc<&MyStruct>` allocates a pointer on the heap
50 error: usage of `Rc<&MyEnum>`
51 --> $DIR/redundant_allocation_fixable.rs:49:26
53 LL | pub fn rc_test3(foo: Rc<&MyEnum>) {}
54 | ^^^^^^^^^^^ help: try: `&MyEnum`
56 = note: `&MyEnum` is already a pointer, `Rc<&MyEnum>` allocates a pointer on the heap
58 error: usage of `Rc<Rc<bool>>`
59 --> $DIR/redundant_allocation_fixable.rs:53:24
61 LL | pub fn rc_test6(a: Rc<Rc<bool>>) {}
62 | ^^^^^^^^^^^^ help: try: `Rc<bool>`
64 = note: `Rc<bool>` is already on the heap, `Rc<Rc<bool>>` makes an extra allocation
66 error: usage of `Arc<&T>`
67 --> $DIR/redundant_allocation_fixable.rs:64:30
69 LL | pub fn arc_test1<T>(foo: Arc<&T>) {}
70 | ^^^^^^^ help: try: `&T`
72 = note: `&T` is already a pointer, `Arc<&T>` allocates a pointer on the heap
74 error: usage of `Arc<&MyStruct>`
75 --> $DIR/redundant_allocation_fixable.rs:66:27
77 LL | pub fn arc_test2(foo: Arc<&MyStruct>) {}
78 | ^^^^^^^^^^^^^^ help: try: `&MyStruct`
80 = note: `&MyStruct` is already a pointer, `Arc<&MyStruct>` allocates a pointer on the heap
82 error: usage of `Arc<&MyEnum>`
83 --> $DIR/redundant_allocation_fixable.rs:68:27
85 LL | pub fn arc_test3(foo: Arc<&MyEnum>) {}
86 | ^^^^^^^^^^^^ help: try: `&MyEnum`
88 = note: `&MyEnum` is already a pointer, `Arc<&MyEnum>` allocates a pointer on the heap
90 error: usage of `Arc<Arc<bool>>`
91 --> $DIR/redundant_allocation_fixable.rs:72:25
93 LL | pub fn arc_test7(a: Arc<Arc<bool>>) {}
94 | ^^^^^^^^^^^^^^ help: try: `Arc<bool>`
96 = note: `Arc<bool>` is already on the heap, `Arc<Arc<bool>>` makes an extra allocation
98 error: aborting due to 12 previous errors