about summary refs log tree commit diff
path: root/tests/ui/suggestions/suggest-dereferencing-index.rs
blob: 42abb5537c5a1cecd10df21d6985a1c162e9d9fc (plain)
1
2
3
4
5
6
7
//@ 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`
}