|
1 |
| -error: usage of `Box<&T>` |
2 |
| - --> $DIR/redundant_allocation.rs:26:30 |
| 1 | +error: you seem to be trying to use `Box<Rc<T>>`. Consider using just `Box<T>` of `Rc<T>` |
| 2 | + --> $DIR/redundant_allocation.rs:25:30 |
3 | 3 | |
|
4 |
| -LL | pub fn box_test1<T>(foo: Box<&T>) {} |
5 |
| - | ^^^^^^^ help: try: `&T` |
| 4 | +LL | pub fn box_test6<T>(foo: Box<Rc<T>>) {} |
| 5 | + | ^^^^^^^^^^ |
6 | 6 | |
|
7 | 7 | = note: `-D clippy::redundant-allocation` implied by `-D warnings`
|
| 8 | + = help: `Rc<T>` is already on the heap, `Box<Rc<T>>` makes an extra allocation |
8 | 9 |
|
9 |
| -error: usage of `Box<&T>` |
10 |
| - --> $DIR/redundant_allocation.rs:28:27 |
11 |
| - | |
12 |
| -LL | pub fn box_test2(foo: Box<&MyStruct>) {} |
13 |
| - | ^^^^^^^^^^^^^^ help: try: `&MyStruct` |
14 |
| - |
15 |
| -error: usage of `Box<&T>` |
16 |
| - --> $DIR/redundant_allocation.rs:30:27 |
17 |
| - | |
18 |
| -LL | pub fn box_test3(foo: Box<&MyEnum>) {} |
19 |
| - | ^^^^^^^^^^^^ help: try: `&MyEnum` |
20 |
| - |
21 |
| -error: usage of `Box<Box<T>>` |
22 |
| - --> $DIR/redundant_allocation.rs:34:30 |
23 |
| - | |
24 |
| -LL | pub fn box_test5<T>(foo: Box<Box<T>>) {} |
25 |
| - | ^^^^^^^^^^^ help: try: `Box<T>` |
26 |
| - |
27 |
| -error: usage of `Box<Rc<T>>` |
28 |
| - --> $DIR/redundant_allocation.rs:36:30 |
29 |
| - | |
30 |
| -LL | pub fn box_test6<T>(foo: Box<Rc<T>>) {} |
31 |
| - | ^^^^^^^^^^ help: try: `Box<T>` |
32 |
| - |
33 |
| -error: usage of `Box<Arc<T>>` |
34 |
| - --> $DIR/redundant_allocation.rs:38:30 |
| 10 | +error: you seem to be trying to use `Box<Arc<T>>`. Consider using just `Box<T>` of `Arc<T>` |
| 11 | + --> $DIR/redundant_allocation.rs:27:30 |
35 | 12 | |
|
36 | 13 | LL | pub fn box_test7<T>(foo: Box<Arc<T>>) {}
|
37 |
| - | ^^^^^^^^^^^ help: try: `Box<T>` |
| 14 | + | ^^^^^^^^^^^ |
| 15 | + | |
| 16 | + = help: `Arc<T>` is already on the heap, `Box<Arc<T>>` makes an extra allocation |
38 | 17 |
|
39 |
| -error: usage of `Box<Rc<T>>` |
40 |
| - --> $DIR/redundant_allocation.rs:40:27 |
| 18 | +error: you seem to be trying to use `Box<Rc<T>>`. Consider using just `Box<T>` of `Rc<T>` |
| 19 | + --> $DIR/redundant_allocation.rs:29:27 |
41 | 20 | |
|
42 | 21 | LL | pub fn box_test8() -> Box<Rc<SubT<usize>>> {
|
43 |
| - | ^^^^^^^^^^^^^^^^^^^^ help: try: `Box<SubT<usize>>` |
44 |
| - |
45 |
| -error: usage of `Box<Arc<T>>` |
46 |
| - --> $DIR/redundant_allocation.rs:44:30 |
| 22 | + | ^^^^^^^^^^^^^^^^^^^^ |
47 | 23 | |
|
48 |
| -LL | pub fn box_test9<T>(foo: Box<Arc<T>>) -> Box<Arc<SubT<T>>> { |
49 |
| - | ^^^^^^^^^^^ help: try: `Box<T>` |
| 24 | + = help: `Rc<T>` is already on the heap, `Box<Rc<T>>` makes an extra allocation |
50 | 25 |
|
51 |
| -error: usage of `Box<Arc<T>>` |
52 |
| - --> $DIR/redundant_allocation.rs:44:46 |
| 26 | +error: you seem to be trying to use `Box<Arc<T>>`. Consider using just `Box<T>` of `Arc<T>` |
| 27 | + --> $DIR/redundant_allocation.rs:33:30 |
53 | 28 | |
|
54 | 29 | LL | pub fn box_test9<T>(foo: Box<Arc<T>>) -> Box<Arc<SubT<T>>> {
|
55 |
| - | ^^^^^^^^^^^^^^^^^ help: try: `Box<SubT<T>>` |
56 |
| - |
57 |
| -error: usage of `Rc<&T>` |
58 |
| - --> $DIR/redundant_allocation.rs:57:29 |
| 30 | + | ^^^^^^^^^^^ |
59 | 31 | |
|
60 |
| -LL | pub fn rc_test1<T>(foo: Rc<&T>) {} |
61 |
| - | ^^^^^^ help: try: `&T` |
| 32 | + = help: `Arc<T>` is already on the heap, `Box<Arc<T>>` makes an extra allocation |
62 | 33 |
|
63 |
| -error: usage of `Rc<&T>` |
64 |
| - --> $DIR/redundant_allocation.rs:59:26 |
| 34 | +error: you seem to be trying to use `Box<Arc<T>>`. Consider using just `Box<T>` of `Arc<T>` |
| 35 | + --> $DIR/redundant_allocation.rs:33:46 |
65 | 36 | |
|
66 |
| -LL | pub fn rc_test2(foo: Rc<&MyStruct>) {} |
67 |
| - | ^^^^^^^^^^^^^ help: try: `&MyStruct` |
68 |
| - |
69 |
| -error: usage of `Rc<&T>` |
70 |
| - --> $DIR/redundant_allocation.rs:61:26 |
| 37 | +LL | pub fn box_test9<T>(foo: Box<Arc<T>>) -> Box<Arc<SubT<T>>> { |
| 38 | + | ^^^^^^^^^^^^^^^^^ |
71 | 39 | |
|
72 |
| -LL | pub fn rc_test3(foo: Rc<&MyEnum>) {} |
73 |
| - | ^^^^^^^^^^^ help: try: `&MyEnum` |
| 40 | + = help: `Arc<T>` is already on the heap, `Box<Arc<T>>` makes an extra allocation |
74 | 41 |
|
75 |
| -error: usage of `Rc<Box<T>>` |
76 |
| - --> $DIR/redundant_allocation.rs:65:24 |
| 42 | +error: you seem to be trying to use `Rc<Box<T>>`. Consider using just `Rc<T>` of `Box<T>` |
| 43 | + --> $DIR/redundant_allocation.rs:46:24 |
77 | 44 | |
|
78 | 45 | LL | pub fn rc_test5(a: Rc<Box<bool>>) {}
|
79 |
| - | ^^^^^^^^^^^^^ help: try: `Rc<bool>` |
80 |
| - |
81 |
| -error: usage of `Rc<Rc<T>>` |
82 |
| - --> $DIR/redundant_allocation.rs:67:24 |
| 46 | + | ^^^^^^^^^^^^^ |
83 | 47 | |
|
84 |
| -LL | pub fn rc_test6(a: Rc<Rc<bool>>) {} |
85 |
| - | ^^^^^^^^^^^^ help: try: `Rc<bool>` |
| 48 | + = help: `Box<T>` is already on the heap, `Rc<Box<T>>` makes an extra allocation |
86 | 49 |
|
87 |
| -error: usage of `Rc<Arc<T>>` |
88 |
| - --> $DIR/redundant_allocation.rs:69:24 |
| 50 | +error: you seem to be trying to use `Rc<Arc<T>>`. Consider using just `Rc<T>` of `Arc<T>` |
| 51 | + --> $DIR/redundant_allocation.rs:48:24 |
89 | 52 | |
|
90 | 53 | LL | pub fn rc_test7(a: Rc<Arc<bool>>) {}
|
91 |
| - | ^^^^^^^^^^^^^ help: try: `Rc<bool>` |
| 54 | + | ^^^^^^^^^^^^^ |
| 55 | + | |
| 56 | + = help: `Arc<T>` is already on the heap, `Rc<Arc<T>>` makes an extra allocation |
92 | 57 |
|
93 |
| -error: usage of `Rc<Box<T>>` |
94 |
| - --> $DIR/redundant_allocation.rs:71:26 |
| 58 | +error: you seem to be trying to use `Rc<Box<T>>`. Consider using just `Rc<T>` of `Box<T>` |
| 59 | + --> $DIR/redundant_allocation.rs:50:26 |
95 | 60 | |
|
96 | 61 | LL | pub fn rc_test8() -> Rc<Box<SubT<usize>>> {
|
97 |
| - | ^^^^^^^^^^^^^^^^^^^^ help: try: `Rc<SubT<usize>>` |
98 |
| - |
99 |
| -error: usage of `Rc<Arc<T>>` |
100 |
| - --> $DIR/redundant_allocation.rs:75:29 |
| 62 | + | ^^^^^^^^^^^^^^^^^^^^ |
101 | 63 | |
|
102 |
| -LL | pub fn rc_test9<T>(foo: Rc<Arc<T>>) -> Rc<Arc<SubT<T>>> { |
103 |
| - | ^^^^^^^^^^ help: try: `Rc<T>` |
| 64 | + = help: `Box<T>` is already on the heap, `Rc<Box<T>>` makes an extra allocation |
104 | 65 |
|
105 |
| -error: usage of `Rc<Arc<T>>` |
106 |
| - --> $DIR/redundant_allocation.rs:75:44 |
| 66 | +error: you seem to be trying to use `Rc<Arc<T>>`. Consider using just `Rc<T>` of `Arc<T>` |
| 67 | + --> $DIR/redundant_allocation.rs:54:29 |
107 | 68 | |
|
108 | 69 | LL | pub fn rc_test9<T>(foo: Rc<Arc<T>>) -> Rc<Arc<SubT<T>>> {
|
109 |
| - | ^^^^^^^^^^^^^^^^ help: try: `Rc<SubT<T>>` |
110 |
| - |
111 |
| -error: usage of `Arc<&T>` |
112 |
| - --> $DIR/redundant_allocation.rs:88:30 |
| 70 | + | ^^^^^^^^^^ |
113 | 71 | |
|
114 |
| -LL | pub fn arc_test1<T>(foo: Arc<&T>) {} |
115 |
| - | ^^^^^^^ help: try: `&T` |
| 72 | + = help: `Arc<T>` is already on the heap, `Rc<Arc<T>>` makes an extra allocation |
116 | 73 |
|
117 |
| -error: usage of `Arc<&T>` |
118 |
| - --> $DIR/redundant_allocation.rs:90:27 |
| 74 | +error: you seem to be trying to use `Rc<Arc<T>>`. Consider using just `Rc<T>` of `Arc<T>` |
| 75 | + --> $DIR/redundant_allocation.rs:54:44 |
119 | 76 | |
|
120 |
| -LL | pub fn arc_test2(foo: Arc<&MyStruct>) {} |
121 |
| - | ^^^^^^^^^^^^^^ help: try: `&MyStruct` |
122 |
| - |
123 |
| -error: usage of `Arc<&T>` |
124 |
| - --> $DIR/redundant_allocation.rs:92:27 |
| 77 | +LL | pub fn rc_test9<T>(foo: Rc<Arc<T>>) -> Rc<Arc<SubT<T>>> { |
| 78 | + | ^^^^^^^^^^^^^^^^ |
125 | 79 | |
|
126 |
| -LL | pub fn arc_test3(foo: Arc<&MyEnum>) {} |
127 |
| - | ^^^^^^^^^^^^ help: try: `&MyEnum` |
| 80 | + = help: `Arc<T>` is already on the heap, `Rc<Arc<T>>` makes an extra allocation |
128 | 81 |
|
129 |
| -error: usage of `Arc<Box<T>>` |
130 |
| - --> $DIR/redundant_allocation.rs:96:25 |
| 82 | +error: you seem to be trying to use `Arc<Box<T>>`. Consider using just `Arc<T>` of `Box<T>` |
| 83 | + --> $DIR/redundant_allocation.rs:67:25 |
131 | 84 | |
|
132 | 85 | LL | pub fn arc_test5(a: Arc<Box<bool>>) {}
|
133 |
| - | ^^^^^^^^^^^^^^ help: try: `Arc<bool>` |
| 86 | + | ^^^^^^^^^^^^^^ |
| 87 | + | |
| 88 | + = help: `Box<T>` is already on the heap, `Arc<Box<T>>` makes an extra allocation |
134 | 89 |
|
135 |
| -error: usage of `Arc<Rc<T>>` |
136 |
| - --> $DIR/redundant_allocation.rs:98:25 |
| 90 | +error: you seem to be trying to use `Arc<Rc<T>>`. Consider using just `Arc<T>` of `Rc<T>` |
| 91 | + --> $DIR/redundant_allocation.rs:69:25 |
137 | 92 | |
|
138 | 93 | LL | pub fn arc_test6(a: Arc<Rc<bool>>) {}
|
139 |
| - | ^^^^^^^^^^^^^ help: try: `Arc<bool>` |
140 |
| - |
141 |
| -error: usage of `Arc<Arc<T>>` |
142 |
| - --> $DIR/redundant_allocation.rs:100:25 |
| 94 | + | ^^^^^^^^^^^^^ |
143 | 95 | |
|
144 |
| -LL | pub fn arc_test7(a: Arc<Arc<bool>>) {} |
145 |
| - | ^^^^^^^^^^^^^^ help: try: `Arc<bool>` |
| 96 | + = help: `Rc<T>` is already on the heap, `Arc<Rc<T>>` makes an extra allocation |
146 | 97 |
|
147 |
| -error: usage of `Arc<Box<T>>` |
148 |
| - --> $DIR/redundant_allocation.rs:102:27 |
| 98 | +error: you seem to be trying to use `Arc<Box<T>>`. Consider using just `Arc<T>` of `Box<T>` |
| 99 | + --> $DIR/redundant_allocation.rs:71:27 |
149 | 100 | |
|
150 | 101 | LL | pub fn arc_test8() -> Arc<Box<SubT<usize>>> {
|
151 |
| - | ^^^^^^^^^^^^^^^^^^^^^ help: try: `Arc<SubT<usize>>` |
| 102 | + | ^^^^^^^^^^^^^^^^^^^^^ |
| 103 | + | |
| 104 | + = help: `Box<T>` is already on the heap, `Arc<Box<T>>` makes an extra allocation |
152 | 105 |
|
153 |
| -error: usage of `Arc<Rc<T>>` |
154 |
| - --> $DIR/redundant_allocation.rs:106:30 |
| 106 | +error: you seem to be trying to use `Arc<Rc<T>>`. Consider using just `Arc<T>` of `Rc<T>` |
| 107 | + --> $DIR/redundant_allocation.rs:75:30 |
155 | 108 | |
|
156 | 109 | LL | pub fn arc_test9<T>(foo: Arc<Rc<T>>) -> Arc<Rc<SubT<T>>> {
|
157 |
| - | ^^^^^^^^^^ help: try: `Arc<T>` |
| 110 | + | ^^^^^^^^^^ |
| 111 | + | |
| 112 | + = help: `Rc<T>` is already on the heap, `Arc<Rc<T>>` makes an extra allocation |
158 | 113 |
|
159 |
| -error: usage of `Arc<Rc<T>>` |
160 |
| - --> $DIR/redundant_allocation.rs:106:45 |
| 114 | +error: you seem to be trying to use `Arc<Rc<T>>`. Consider using just `Arc<T>` of `Rc<T>` |
| 115 | + --> $DIR/redundant_allocation.rs:75:45 |
161 | 116 | |
|
162 | 117 | LL | pub fn arc_test9<T>(foo: Arc<Rc<T>>) -> Arc<Rc<SubT<T>>> {
|
163 |
| - | ^^^^^^^^^^^^^^^^ help: try: `Arc<SubT<T>>` |
| 118 | + | ^^^^^^^^^^^^^^^^ |
| 119 | + | |
| 120 | + = help: `Rc<T>` is already on the heap, `Arc<Rc<T>>` makes an extra allocation |
164 | 121 |
|
165 |
| -error: aborting due to 27 previous errors |
| 122 | +error: aborting due to 15 previous errors |
166 | 123 |
|
0 commit comments