]> 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 2450b7582de6a5163726275954af32face635ade..ca8ca53c80c3f436956fef359df23a0778ebd111 100644 (file)
@@ -15,17 +15,14 @@ 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];
     v[10];
     v[1 << 3];
 
-    //
-    // Continue tests at end function to minimize the changes to this file's corresponding stderr.
-    //
-
     const N: usize = 15; // Out of bounds
     const M: usize = 3; // In bounds
     x[N]; // Ok, let rustc's `const_err` lint handle `usize` indexing on arrays.