]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/indexing_slicing_index.rs
Auto merge of #7847 - mikerite:fix-7829, r=flip1995
[rust.git] / tests / ui / indexing_slicing_index.rs
index 000d5269930ba8f29a69a8c496c7cded649a14dc..ca8ca53c80c3f436956fef359df23a0778ebd111 100644 (file)
@@ -15,7 +15,8 @@ fn main() {
     x[3]; // Ok, should not produce stderr.
 
     let y = &x;
-    y[0];
+    y[0]; // Ok, referencing shouldn't affect this lint. See the issue 6021
+    y[4]; // Ok, rustc will handle references too.
 
     let v = vec![0; 5];
     v[0];