diff options
Diffstat (limited to 'tests/ui/suggestions/suggest-dereferencing-index.rs')
-rw-r--r-- | tests/ui/suggestions/suggest-dereferencing-index.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/ui/suggestions/suggest-dereferencing-index.rs b/tests/ui/suggestions/suggest-dereferencing-index.rs new file mode 100644 index 000000000..82ebacc49 --- /dev/null +++ b/tests/ui/suggestions/suggest-dereferencing-index.rs @@ -0,0 +1,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` +} |