Files
rust/tests/ui/useless_vec_unfixable.rs
T
Ada Alakbarova bbb251a25f clean-up
- 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
2025-11-15 08:04:36 +01:00

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() {}