summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/src/docs/large_const_arrays.txt
blob: 71f67854f2a1afcd3dc1bb0e961000ca3059e8f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
### What it does
Checks for large `const` arrays that should
be defined as `static` instead.

### Why is this bad?
Performance: const variables are inlined upon use.
Static items result in only one instance and has a fixed location in memory.

### Example
```
pub const a = [0u32; 1_000_000];
```

Use instead:
```
pub static a = [0u32; 1_000_000];
```