]> git.lizzy.rs Git - rust.git/blob - tests/ui/lint/unused/issue-81314-unused-span-ident.rs
Rollup merge of #106670 - albertlarsan68:check-docs-in-pr-ci, r=Mark-Simulacrum
[rust.git] / tests / ui / lint / unused / issue-81314-unused-span-ident.rs
1 // run-rustfix
2 // Regression test for #81314: Unused variable lint should
3 // span only the identifier and not the rest of the pattern
4
5 #![deny(unused)]
6
7 fn main() {
8     let [rest @ ..] = [1, 2, 3]; //~ ERROR unused variable
9 }
10
11 pub fn foo([rest @ ..]: &[i32]) { //~ ERROR unused variable
12 }