fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
3.6 KiB100 linesraw
1error: usage of `Box<&T>`
2  --> $DIR/redundant_allocation_fixable.rs:23:30
3   |
4LL |     pub fn box_test1<T>(foo: Box<&T>) {}
5   |                              ^^^^^^^ help: try: `&T`
6   |
7   = note: `&T` is already a pointer, `Box<&T>` allocates a pointer on the heap
8   = note: `-D clippy::redundant-allocation` implied by `-D warnings`
9   = help: to override `-D warnings` add `#[allow(clippy::redundant_allocation)]`
10
11error: usage of `Box<&MyStruct>`
12  --> $DIR/redundant_allocation_fixable.rs:25:27
13   |
14LL |     pub fn box_test2(foo: Box<&MyStruct>) {}
15   |                           ^^^^^^^^^^^^^^ help: try: `&MyStruct`
16   |
17   = note: `&MyStruct` is already a pointer, `Box<&MyStruct>` allocates a pointer on the heap
18
19error: usage of `Box<&MyEnum>`
20  --> $DIR/redundant_allocation_fixable.rs:27:27
21   |
22LL |     pub fn box_test3(foo: Box<&MyEnum>) {}
23   |                           ^^^^^^^^^^^^ help: try: `&MyEnum`
24   |
25   = note: `&MyEnum` is already a pointer, `Box<&MyEnum>` allocates a pointer on the heap
26
27error: usage of `Box<Box<T>>`
28  --> $DIR/redundant_allocation_fixable.rs:31:30
29   |
30LL |     pub fn box_test5<T>(foo: Box<Box<T>>) {}
31   |                              ^^^^^^^^^^^ help: try: `Box<T>`
32   |
33   = note: `Box<T>` is already on the heap, `Box<Box<T>>` makes an extra allocation
34
35error: usage of `Rc<&T>`
36  --> $DIR/redundant_allocation_fixable.rs:40:29
37   |
38LL |     pub fn rc_test1<T>(foo: Rc<&T>) {}
39   |                             ^^^^^^ help: try: `&T`
40   |
41   = note: `&T` is already a pointer, `Rc<&T>` allocates a pointer on the heap
42
43error: usage of `Rc<&MyStruct>`
44  --> $DIR/redundant_allocation_fixable.rs:42:26
45   |
46LL |     pub fn rc_test2(foo: Rc<&MyStruct>) {}
47   |                          ^^^^^^^^^^^^^ help: try: `&MyStruct`
48   |
49   = note: `&MyStruct` is already a pointer, `Rc<&MyStruct>` allocates a pointer on the heap
50
51error: usage of `Rc<&MyEnum>`
52  --> $DIR/redundant_allocation_fixable.rs:44:26
53   |
54LL |     pub fn rc_test3(foo: Rc<&MyEnum>) {}
55   |                          ^^^^^^^^^^^ help: try: `&MyEnum`
56   |
57   = note: `&MyEnum` is already a pointer, `Rc<&MyEnum>` allocates a pointer on the heap
58
59error: usage of `Rc<Rc<bool>>`
60  --> $DIR/redundant_allocation_fixable.rs:48:24
61   |
62LL |     pub fn rc_test6(a: Rc<Rc<bool>>) {}
63   |                        ^^^^^^^^^^^^ help: try: `Rc<bool>`
64   |
65   = note: `Rc<bool>` is already on the heap, `Rc<Rc<bool>>` makes an extra allocation
66
67error: usage of `Arc<&T>`
68  --> $DIR/redundant_allocation_fixable.rs:57:30
69   |
70LL |     pub fn arc_test1<T>(foo: Arc<&T>) {}
71   |                              ^^^^^^^ help: try: `&T`
72   |
73   = note: `&T` is already a pointer, `Arc<&T>` allocates a pointer on the heap
74
75error: usage of `Arc<&MyStruct>`
76  --> $DIR/redundant_allocation_fixable.rs:59:27
77   |
78LL |     pub fn arc_test2(foo: Arc<&MyStruct>) {}
79   |                           ^^^^^^^^^^^^^^ help: try: `&MyStruct`
80   |
81   = note: `&MyStruct` is already a pointer, `Arc<&MyStruct>` allocates a pointer on the heap
82
83error: usage of `Arc<&MyEnum>`
84  --> $DIR/redundant_allocation_fixable.rs:61:27
85   |
86LL |     pub fn arc_test3(foo: Arc<&MyEnum>) {}
87   |                           ^^^^^^^^^^^^ help: try: `&MyEnum`
88   |
89   = note: `&MyEnum` is already a pointer, `Arc<&MyEnum>` allocates a pointer on the heap
90
91error: usage of `Arc<Arc<bool>>`
92  --> $DIR/redundant_allocation_fixable.rs:65:25
93   |
94LL |     pub fn arc_test7(a: Arc<Arc<bool>>) {}
95   |                         ^^^^^^^^^^^^^^ help: try: `Arc<bool>`
96   |
97   = note: `Arc<bool>` is already on the heap, `Arc<Arc<bool>>` makes an extra allocation
98
99error: aborting due to 12 previous errors
100