mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-29 20:46:07 +03:00
bbb251a25f
- move `is_allowed_vec_method` (a stripped-down version of it, anyway, as the function doesn't make sense as is out of context) to utils, as it's shared between `useless_vec` and `ptr_arg` - add another test for non-standard macro brace case - rm unneeded `allow`s - rm duplicated tests - add comments to some tests
15 lines
385 B
Rust
15 lines
385 B
Rust
//@no-rustfix: no suggestions
|
|
#![warn(clippy::useless_vec)]
|
|
|
|
// Regression test for <https://github.com/rust-lang/rust-clippy/issues/13692>.
|
|
fn foo() {
|
|
// There should be no suggestion in this case.
|
|
let _some_variable = vec![
|
|
//~^ useless_vec
|
|
1, 2, // i'm here to stay
|
|
3, 4, // but this one going away ;-;
|
|
]; // that is life anyways
|
|
}
|
|
|
|
fn main() {}
|