rust/tests/ui/lint/unused/issue-81314-unused-span-ident.rs
2024-02-16 20:02:50 +00:00

13 lines
290 B
Rust

//@ run-rustfix
// Regression test for #81314: Unused variable lint should
// span only the identifier and not the rest of the pattern
#![deny(unused)]
fn main() {
let [rest @ ..] = [1, 2, 3]; //~ ERROR unused variable
}
pub fn foo([rest @ ..]: &[i32]) { //~ ERROR unused variable
}