rust/tests/ui/lint/unused/issue-81314-unused-span-ident.fixed

13 lines
291 B
Rust
Raw Normal View History

2021-02-28 14:03:44 -06:00
// 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
}