move clippy tests back to their intended directory

This commit is contained in:
Pietro Albini 2023-03-08 14:17:16 +01:00
parent 5331d05334
commit aff9b72375
3 changed files with 40 additions and 0 deletions

View file

@ -0,0 +1,10 @@
#![allow(unused)]
#![warn(clippy::large_const_arrays, clippy::large_stack_arrays)]
const ABOVE: [u8; 11] = [0; 11];
const BELOW: [u8; 10] = [0; 10];
fn main() {
let above = [0u8; 11];
let below = [0u8; 10];
}

View file

@ -0,0 +1,29 @@
error: large array defined as const
--> $DIR/array_size_threshold.rs:4:1
|
LL | const ABOVE: [u8; 11] = [0; 11];
| -----^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| help: make this a static item: `static`
|
= note: `-D clippy::large-const-arrays` implied by `-D warnings`
error: allocating a local array larger than 10 bytes
--> $DIR/array_size_threshold.rs:4:25
|
LL | const ABOVE: [u8; 11] = [0; 11];
| ^^^^^^^
|
= help: consider allocating on the heap with `vec![0; 11].into_boxed_slice()`
= note: `-D clippy::large-stack-arrays` implied by `-D warnings`
error: allocating a local array larger than 10 bytes
--> $DIR/array_size_threshold.rs:8:17
|
LL | let above = [0u8; 11];
| ^^^^^^^^^
|
= help: consider allocating on the heap with `vec![0u8; 11].into_boxed_slice()`
error: aborting due to 3 previous errors

View file

@ -0,0 +1 @@
array-size-threshold = 10