rust/tests/ui/lint/unused/issue-96606.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

9 lines
269 B
Rust
Raw Normal View History

#[deny(unused)]
fn main() {
let arr = [0; 10];
let _ = arr[(0)]; //~ ERROR unnecessary parentheses around index expression
let _ = arr[{0}]; //~ ERROR unnecessary braces around index expression
let _ = arr[1 + (0)];
let _ = arr[{ let x = 0; x }];
}