Skip to content

Commit 7177746

Browse files
committed
Auto merge of #9284 - lengyijun:typo, r=dswij
fix typo in tests/ui/redundant_allocation.rs changelog: none
2 parents 5dc90a1 + b50ba06 commit 7177746

File tree

2 files changed

+21
-31
lines changed

2 files changed

+21
-31
lines changed

tests/ui/redundant_allocation.rs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,13 @@
11
#![warn(clippy::all)]
2-
#![allow(clippy::boxed_local, clippy::needless_pass_by_value)]
3-
#![allow(clippy::disallowed_names, unused_variables, dead_code)]
4-
#![allow(unused_imports)]
2+
#![allow(clippy::boxed_local, clippy::disallowed_names)]
53

64
pub struct MyStruct;
75

86
pub struct SubT<T> {
97
foo: T,
108
}
119

12-
pub enum MyEnum {
13-
One,
14-
Two,
15-
}
16-
1710
mod outer_box {
18-
use crate::MyEnum;
1911
use crate::MyStruct;
2012
use crate::SubT;
2113
use std::boxed::Box;
@@ -36,7 +28,6 @@ mod outer_box {
3628
}
3729

3830
mod outer_rc {
39-
use crate::MyEnum;
4031
use crate::MyStruct;
4132
use crate::SubT;
4233
use std::boxed::Box;
@@ -57,7 +48,6 @@ mod outer_rc {
5748
}
5849

5950
mod outer_arc {
60-
use crate::MyEnum;
6151
use crate::MyStruct;
6252
use crate::SubT;
6353
use std::boxed::Box;

tests/ui/redundant_allocation.stderr

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: usage of `Box<Rc<T>>`
2-
--> $DIR/redundant_allocation.rs:25:30
2+
--> $DIR/redundant_allocation.rs:17:30
33
|
44
LL | pub fn box_test6<T>(foo: Box<Rc<T>>) {}
55
| ^^^^^^^^^^
@@ -9,7 +9,7 @@ LL | pub fn box_test6<T>(foo: Box<Rc<T>>) {}
99
= help: consider using just `Box<T>` or `Rc<T>`
1010

1111
error: usage of `Box<Arc<T>>`
12-
--> $DIR/redundant_allocation.rs:27:30
12+
--> $DIR/redundant_allocation.rs:19:30
1313
|
1414
LL | pub fn box_test7<T>(foo: Box<Arc<T>>) {}
1515
| ^^^^^^^^^^^
@@ -18,7 +18,7 @@ LL | pub fn box_test7<T>(foo: Box<Arc<T>>) {}
1818
= help: consider using just `Box<T>` or `Arc<T>`
1919

2020
error: usage of `Box<Rc<SubT<usize>>>`
21-
--> $DIR/redundant_allocation.rs:29:27
21+
--> $DIR/redundant_allocation.rs:21:27
2222
|
2323
LL | pub fn box_test8() -> Box<Rc<SubT<usize>>> {
2424
| ^^^^^^^^^^^^^^^^^^^^
@@ -27,7 +27,7 @@ LL | pub fn box_test8() -> Box<Rc<SubT<usize>>> {
2727
= help: consider using just `Box<SubT<usize>>` or `Rc<SubT<usize>>`
2828

2929
error: usage of `Box<Arc<T>>`
30-
--> $DIR/redundant_allocation.rs:33:30
30+
--> $DIR/redundant_allocation.rs:25:30
3131
|
3232
LL | pub fn box_test9<T>(foo: Box<Arc<T>>) -> Box<Arc<SubT<T>>> {
3333
| ^^^^^^^^^^^
@@ -36,7 +36,7 @@ LL | pub fn box_test9<T>(foo: Box<Arc<T>>) -> Box<Arc<SubT<T>>> {
3636
= help: consider using just `Box<T>` or `Arc<T>`
3737

3838
error: usage of `Box<Arc<SubT<T>>>`
39-
--> $DIR/redundant_allocation.rs:33:46
39+
--> $DIR/redundant_allocation.rs:25:46
4040
|
4141
LL | pub fn box_test9<T>(foo: Box<Arc<T>>) -> Box<Arc<SubT<T>>> {
4242
| ^^^^^^^^^^^^^^^^^
@@ -45,7 +45,7 @@ LL | pub fn box_test9<T>(foo: Box<Arc<T>>) -> Box<Arc<SubT<T>>> {
4545
= help: consider using just `Box<SubT<T>>` or `Arc<SubT<T>>`
4646

4747
error: usage of `Rc<Box<bool>>`
48-
--> $DIR/redundant_allocation.rs:46:24
48+
--> $DIR/redundant_allocation.rs:37:24
4949
|
5050
LL | pub fn rc_test5(a: Rc<Box<bool>>) {}
5151
| ^^^^^^^^^^^^^
@@ -54,7 +54,7 @@ LL | pub fn rc_test5(a: Rc<Box<bool>>) {}
5454
= help: consider using just `Rc<bool>` or `Box<bool>`
5555

5656
error: usage of `Rc<Arc<bool>>`
57-
--> $DIR/redundant_allocation.rs:48:24
57+
--> $DIR/redundant_allocation.rs:39:24
5858
|
5959
LL | pub fn rc_test7(a: Rc<Arc<bool>>) {}
6060
| ^^^^^^^^^^^^^
@@ -63,7 +63,7 @@ LL | pub fn rc_test7(a: Rc<Arc<bool>>) {}
6363
= help: consider using just `Rc<bool>` or `Arc<bool>`
6464

6565
error: usage of `Rc<Box<SubT<usize>>>`
66-
--> $DIR/redundant_allocation.rs:50:26
66+
--> $DIR/redundant_allocation.rs:41:26
6767
|
6868
LL | pub fn rc_test8() -> Rc<Box<SubT<usize>>> {
6969
| ^^^^^^^^^^^^^^^^^^^^
@@ -72,7 +72,7 @@ LL | pub fn rc_test8() -> Rc<Box<SubT<usize>>> {
7272
= help: consider using just `Rc<SubT<usize>>` or `Box<SubT<usize>>`
7373

7474
error: usage of `Rc<Arc<T>>`
75-
--> $DIR/redundant_allocation.rs:54:29
75+
--> $DIR/redundant_allocation.rs:45:29
7676
|
7777
LL | pub fn rc_test9<T>(foo: Rc<Arc<T>>) -> Rc<Arc<SubT<T>>> {
7878
| ^^^^^^^^^^
@@ -81,7 +81,7 @@ LL | pub fn rc_test9<T>(foo: Rc<Arc<T>>) -> Rc<Arc<SubT<T>>> {
8181
= help: consider using just `Rc<T>` or `Arc<T>`
8282

8383
error: usage of `Rc<Arc<SubT<T>>>`
84-
--> $DIR/redundant_allocation.rs:54:44
84+
--> $DIR/redundant_allocation.rs:45:44
8585
|
8686
LL | pub fn rc_test9<T>(foo: Rc<Arc<T>>) -> Rc<Arc<SubT<T>>> {
8787
| ^^^^^^^^^^^^^^^^
@@ -90,7 +90,7 @@ LL | pub fn rc_test9<T>(foo: Rc<Arc<T>>) -> Rc<Arc<SubT<T>>> {
9090
= help: consider using just `Rc<SubT<T>>` or `Arc<SubT<T>>`
9191

9292
error: usage of `Arc<Box<bool>>`
93-
--> $DIR/redundant_allocation.rs:67:25
93+
--> $DIR/redundant_allocation.rs:57:25
9494
|
9595
LL | pub fn arc_test5(a: Arc<Box<bool>>) {}
9696
| ^^^^^^^^^^^^^^
@@ -99,7 +99,7 @@ LL | pub fn arc_test5(a: Arc<Box<bool>>) {}
9999
= help: consider using just `Arc<bool>` or `Box<bool>`
100100

101101
error: usage of `Arc<Rc<bool>>`
102-
--> $DIR/redundant_allocation.rs:69:25
102+
--> $DIR/redundant_allocation.rs:59:25
103103
|
104104
LL | pub fn arc_test6(a: Arc<Rc<bool>>) {}
105105
| ^^^^^^^^^^^^^
@@ -108,7 +108,7 @@ LL | pub fn arc_test6(a: Arc<Rc<bool>>) {}
108108
= help: consider using just `Arc<bool>` or `Rc<bool>`
109109

110110
error: usage of `Arc<Box<SubT<usize>>>`
111-
--> $DIR/redundant_allocation.rs:71:27
111+
--> $DIR/redundant_allocation.rs:61:27
112112
|
113113
LL | pub fn arc_test8() -> Arc<Box<SubT<usize>>> {
114114
| ^^^^^^^^^^^^^^^^^^^^^
@@ -117,7 +117,7 @@ LL | pub fn arc_test8() -> Arc<Box<SubT<usize>>> {
117117
= help: consider using just `Arc<SubT<usize>>` or `Box<SubT<usize>>`
118118

119119
error: usage of `Arc<Rc<T>>`
120-
--> $DIR/redundant_allocation.rs:75:30
120+
--> $DIR/redundant_allocation.rs:65:30
121121
|
122122
LL | pub fn arc_test9<T>(foo: Arc<Rc<T>>) -> Arc<Rc<SubT<T>>> {
123123
| ^^^^^^^^^^
@@ -126,7 +126,7 @@ LL | pub fn arc_test9<T>(foo: Arc<Rc<T>>) -> Arc<Rc<SubT<T>>> {
126126
= help: consider using just `Arc<T>` or `Rc<T>`
127127

128128
error: usage of `Arc<Rc<SubT<T>>>`
129-
--> $DIR/redundant_allocation.rs:75:45
129+
--> $DIR/redundant_allocation.rs:65:45
130130
|
131131
LL | pub fn arc_test9<T>(foo: Arc<Rc<T>>) -> Arc<Rc<SubT<T>>> {
132132
| ^^^^^^^^^^^^^^^^
@@ -135,7 +135,7 @@ LL | pub fn arc_test9<T>(foo: Arc<Rc<T>>) -> Arc<Rc<SubT<T>>> {
135135
= help: consider using just `Arc<SubT<T>>` or `Rc<SubT<T>>`
136136

137137
error: usage of `Rc<Box<Box<dyn T>>>`
138-
--> $DIR/redundant_allocation.rs:97:27
138+
--> $DIR/redundant_allocation.rs:87:27
139139
|
140140
LL | pub fn test_rc_box(_: Rc<Box<Box<dyn T>>>) {}
141141
| ^^^^^^^^^^^^^^^^^^^
@@ -144,7 +144,7 @@ LL | pub fn test_rc_box(_: Rc<Box<Box<dyn T>>>) {}
144144
= help: consider using just `Rc<Box<dyn T>>` or `Box<Box<dyn T>>`
145145

146146
error: usage of `Rc<Box<Box<str>>>`
147-
--> $DIR/redundant_allocation.rs:129:31
147+
--> $DIR/redundant_allocation.rs:119:31
148148
|
149149
LL | pub fn test_rc_box_str(_: Rc<Box<Box<str>>>) {}
150150
| ^^^^^^^^^^^^^^^^^
@@ -153,7 +153,7 @@ LL | pub fn test_rc_box_str(_: Rc<Box<Box<str>>>) {}
153153
= help: consider using just `Rc<Box<str>>` or `Box<Box<str>>`
154154

155155
error: usage of `Rc<Box<Box<[usize]>>>`
156-
--> $DIR/redundant_allocation.rs:130:33
156+
--> $DIR/redundant_allocation.rs:120:33
157157
|
158158
LL | pub fn test_rc_box_slice(_: Rc<Box<Box<[usize]>>>) {}
159159
| ^^^^^^^^^^^^^^^^^^^^^
@@ -162,7 +162,7 @@ LL | pub fn test_rc_box_slice(_: Rc<Box<Box<[usize]>>>) {}
162162
= help: consider using just `Rc<Box<[usize]>>` or `Box<Box<[usize]>>`
163163

164164
error: usage of `Rc<Box<Box<Path>>>`
165-
--> $DIR/redundant_allocation.rs:131:32
165+
--> $DIR/redundant_allocation.rs:121:32
166166
|
167167
LL | pub fn test_rc_box_path(_: Rc<Box<Box<Path>>>) {}
168168
| ^^^^^^^^^^^^^^^^^^
@@ -171,7 +171,7 @@ LL | pub fn test_rc_box_path(_: Rc<Box<Box<Path>>>) {}
171171
= help: consider using just `Rc<Box<Path>>` or `Box<Box<Path>>`
172172

173173
error: usage of `Rc<Box<Box<DynSized>>>`
174-
--> $DIR/redundant_allocation.rs:132:34
174+
--> $DIR/redundant_allocation.rs:122:34
175175
|
176176
LL | pub fn test_rc_box_custom(_: Rc<Box<Box<DynSized>>>) {}
177177
| ^^^^^^^^^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)