Skip to content

Commit 214e65c

Browse files
committed
Add unuseless #[allow(unused_allocation)]
1 parent 6f3c25a commit 214e65c

File tree

5 files changed

+17
-20
lines changed

5 files changed

+17
-20
lines changed

tests/ui/iterators/into-iter-on-arrays-lint.fixed

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// run-rustfix
33
// rustfix-only-machine-applicable
44

5-
#[allow(unused_must_use)]
5+
#[allow(unused_must_use, unused_allocation)]
66
fn main() {
77
let small = [1, 2];
88
let big = [0u8; 33];

tests/ui/iterators/into-iter-on-arrays-lint.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// run-rustfix
33
// rustfix-only-machine-applicable
44

5-
#[allow(unused_must_use)]
5+
#[allow(unused_must_use, unused_allocation)]
66
fn main() {
77
let small = [1, 2];
88
let big = [0u8; 33];

tests/ui/macros/rfc-2011-nicer-assert-messages/all-expr-kinds.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// run-pass
55
// needs-unwind Asserting on contents of error message
66

7-
#![allow(path_statements)]
7+
#![allow(path_statements, unused_allocation)]
88
#![feature(box_syntax, core_intrinsics, generic_assert, generic_assert_internals)]
99

1010
macro_rules! test {

tests/ui/self/arbitrary_self_types_trait.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// run-pass
2+
#![allow(unused_allocation)]
23

34
use std::rc::Rc;
45

@@ -13,7 +14,7 @@ impl Trait for Vec<i32> {
1314
}
1415

1516
fn main() {
16-
let v = vec![1,2,3];
17+
let v = vec![1, 2, 3];
1718

18-
assert_eq!(&[1,2,3], Box::new(Rc::new(v)).trait_method());
19+
assert_eq!(&[1, 2, 3], Box::new(Rc::new(v)).trait_method());
1920
}

tests/ui/structs-enums/align-struct.rs

+11-15
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// run-pass
2-
#![allow(dead_code)]
2+
#![allow(dead_code, unused_allocation)]
33

44
use std::mem;
55

@@ -20,7 +20,6 @@ struct AlignMany(i32);
2020

2121
// Raising alignment may not alter size.
2222
#[repr(align(8))]
23-
#[allow(dead_code)]
2423
struct Align8Many {
2524
a: i32,
2625
b: i32,
@@ -29,9 +28,8 @@ struct Align8Many {
2928
}
3029

3130
enum Enum {
32-
#[allow(dead_code)]
3331
A(i32),
34-
B(Align16)
32+
B(Align16),
3533
}
3634

3735
// Nested alignment - use `#[repr(C)]` to suppress field reordering for sizeof test
@@ -73,7 +71,7 @@ struct AlignLarge {
7371

7472
union UnionContainsAlign {
7573
a: Align16,
76-
b: f32
74+
b: f32,
7775
}
7876

7977
impl Align16 {
@@ -158,7 +156,7 @@ pub fn main() {
158156
// Note that the size of Nested may change if struct field re-ordering is enabled
159157
assert_eq!(mem::align_of::<Nested>(), 16);
160158
assert_eq!(mem::size_of::<Nested>(), 48);
161-
let a = Nested{ a: 1, b: 2, c: Align16(3), d: 4};
159+
let a = Nested { a: 1, b: 2, c: Align16(3), d: 4 };
162160
assert_eq!(mem::align_of_val(&a), 16);
163161
assert_eq!(mem::align_of_val(&a.b), 4);
164162
assert_eq!(mem::align_of_val(&a.c), 16);
@@ -179,8 +177,8 @@ pub fn main() {
179177
assert_eq!(a.0, 15);
180178
assert_eq!(mem::align_of_val(a), 16);
181179
assert_eq!(mem::size_of_val(a), 16);
182-
},
183-
_ => ()
180+
}
181+
_ => (),
184182
}
185183
assert!(is_aligned_to(&e, 16));
186184

@@ -197,8 +195,8 @@ pub fn main() {
197195
}
198196

199197
// arrays of aligned elements should also be aligned
200-
assert_eq!(mem::align_of::<[Align16;2]>(), 16);
201-
assert_eq!(mem::size_of::<[Align16;2]>(), 32);
198+
assert_eq!(mem::align_of::<[Align16; 2]>(), 16);
199+
assert_eq!(mem::size_of::<[Align16; 2]>(), 32);
202200

203201
let a = [Align16(0), Align16(1)];
204202
assert_eq!(mem::align_of_val(&a[0]), 16);
@@ -209,7 +207,7 @@ pub fn main() {
209207
assert_eq!(mem::align_of_val(Box::new(Align16(0)).as_ref()), 16);
210208

211209
// check heap array is aligned
212-
let a = vec!(Align16(0), Align16(1));
210+
let a = vec![Align16(0), Align16(1)];
213211
assert_eq!(mem::align_of_val(&a[0]), 16);
214212
assert_eq!(mem::align_of_val(&a[1]), 16);
215213

@@ -224,16 +222,14 @@ pub fn main() {
224222

225223
assert_eq!(mem::align_of::<AlignContainsPacked4C>(), 16);
226224
assert_eq!(mem::size_of::<AlignContainsPacked4C>(), 32);
227-
let a = AlignContainsPacked4C { a: Packed4C{ a: 1, b: 2 }, b: 3 };
225+
let a = AlignContainsPacked4C { a: Packed4C { a: 1, b: 2 }, b: 3 };
228226
assert_eq!(mem::align_of_val(&a), 16);
229227
assert_eq!(mem::align_of_val(&a.a), 4);
230228
assert_eq!(mem::align_of_val(&a.b), mem::align_of::<u64>());
231229
assert_eq!(mem::size_of_val(&a), 32);
232230
assert!(is_aligned_to(&a, 16));
233231

234-
let mut large = Box::new(AlignLarge {
235-
stuff: [0; 0x10000],
236-
});
232+
let mut large = Box::new(AlignLarge { stuff: [0; 0x10000] });
237233
large.stuff[0] = 132;
238234
*large.stuff.last_mut().unwrap() = 102;
239235
assert_eq!(large.stuff[0], 132);

0 commit comments

Comments
 (0)