rust/tests/ui/suggestions/suggest-dereferencing-index.rs

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

8 lines
190 B
Rust
Raw Normal View History

// run-rustfix
#![allow(unused_variables)]
fn main() {
let i: &usize = &1;
let one_item_please: i32 = [1, 2, 3][i]; //~ ERROR the type `[{integer}]` cannot be indexed by `&usize`
}