mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-18 09:03:18 +00:00
27 lines
376 B
Rust
27 lines
376 B
Rust
|
//@compile-flags: --test
|
||
|
#![warn(clippy::useless_vec)]
|
||
|
#![allow(clippy::unnecessary_operation, clippy::no_effect)]
|
||
|
|
||
|
fn foo(_: &[u32]) {}
|
||
|
|
||
|
fn main() {
|
||
|
foo(&[1_u32]);
|
||
|
}
|
||
|
|
||
|
#[test]
|
||
|
pub fn in_test() {
|
||
|
foo(&vec![2_u32]);
|
||
|
}
|
||
|
|
||
|
#[cfg(test)]
|
||
|
fn in_cfg_test() {
|
||
|
foo(&vec![3_u32]);
|
||
|
}
|
||
|
|
||
|
#[cfg(test)]
|
||
|
mod mod1 {
|
||
|
fn in_cfg_test_mod() {
|
||
|
super::foo(&vec![4_u32]);
|
||
|
}
|
||
|
}
|