Skip to content

Commit aff9b72

Browse files
committed
move clippy tests back to their intended directory
1 parent 5331d05 commit aff9b72

File tree

3 files changed

+40
-0
lines changed

3 files changed

+40
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#![allow(unused)]
2+
#![warn(clippy::large_const_arrays, clippy::large_stack_arrays)]
3+
4+
const ABOVE: [u8; 11] = [0; 11];
5+
const BELOW: [u8; 10] = [0; 10];
6+
7+
fn main() {
8+
let above = [0u8; 11];
9+
let below = [0u8; 10];
10+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
error: large array defined as const
2+
--> $DIR/array_size_threshold.rs:4:1
3+
|
4+
LL | const ABOVE: [u8; 11] = [0; 11];
5+
| -----^^^^^^^^^^^^^^^^^^^^^^^^^^^
6+
| |
7+
| help: make this a static item: `static`
8+
|
9+
= note: `-D clippy::large-const-arrays` implied by `-D warnings`
10+
11+
error: allocating a local array larger than 10 bytes
12+
--> $DIR/array_size_threshold.rs:4:25
13+
|
14+
LL | const ABOVE: [u8; 11] = [0; 11];
15+
| ^^^^^^^
16+
|
17+
= help: consider allocating on the heap with `vec![0; 11].into_boxed_slice()`
18+
= note: `-D clippy::large-stack-arrays` implied by `-D warnings`
19+
20+
error: allocating a local array larger than 10 bytes
21+
--> $DIR/array_size_threshold.rs:8:17
22+
|
23+
LL | let above = [0u8; 11];
24+
| ^^^^^^^^^
25+
|
26+
= help: consider allocating on the heap with `vec![0u8; 11].into_boxed_slice()`
27+
28+
error: aborting due to 3 previous errors
29+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
array-size-threshold = 10

0 commit comments

Comments
 (0)