summaryrefslogtreecommitdiffstats
path: root/src/test/ui/lint/unused/issue-81314-unused-span-ident.fixed
blob: aac918f2bc8179d66e535c6c76470a030ebe3b86 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// 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
}