about summary refs log tree commit diff
path: root/src/test/ui/array-slice-vec/suggest-array-length.fixed
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-09-09 20:43:13 +0000
committerbors <bors@rust-lang.org>2022-09-09 20:43:13 +0000
commit1d37ed661a6922e7a167609b8cd7eb31e972b19b (patch)
treed05693f2376caa5a9725b030558f246f5edf995a /src/test/ui/array-slice-vec/suggest-array-length.fixed
parent98f3001eecbe4cbd091c10ffab45b4c164bb507b (diff)
parent2e258cec0505f58ffc2d1997acb5f4ea2e279500 (diff)
downloadrust-1d37ed661a6922e7a167609b8cd7eb31e972b19b.tar.gz
rust-1d37ed661a6922e7a167609b8cd7eb31e972b19b.zip
Auto merge of #101611 - GuillaumeGomez:rollup-yw3qtug, r=GuillaumeGomez
Rollup of 5 pull requests

Successful merges:

 - #101475 (Use futex-based locks and thread parker on Hermit)
 - #101492 (Suggest adding array lengths to references to arrays if possible)
 - #101495 (Compile spin_loop_hint as pause on x86 even without sse2 enabled)
 - #101529 (Fix the example code and doctest for Formatter::sign_plus)
 - #101600 (rustdoc: simplify the codeblock tooltip)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'src/test/ui/array-slice-vec/suggest-array-length.fixed')
-rw-r--r--src/test/ui/array-slice-vec/suggest-array-length.fixed12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/ui/array-slice-vec/suggest-array-length.fixed b/src/test/ui/array-slice-vec/suggest-array-length.fixed
index bae3ab74af6..867c18a7d5e 100644
--- a/src/test/ui/array-slice-vec/suggest-array-length.fixed
+++ b/src/test/ui/array-slice-vec/suggest-array-length.fixed
@@ -5,10 +5,22 @@ fn main() {
     const Foo: [i32; 3] = [1, 2, 3];
     //~^ ERROR in expressions, `_` can only be used on the left-hand side of an assignment
     //~| ERROR using `_` for array lengths is unstable
+    const REF_FOO: &[u8; 1] = &[1];
+    //~^ ERROR in expressions, `_` can only be used on the left-hand side of an assignment
+    //~| ERROR using `_` for array lengths is unstable
     let foo: [i32; 3] = [1, 2, 3];
     //~^ ERROR in expressions, `_` can only be used on the left-hand side of an assignment
     //~| ERROR using `_` for array lengths is unstable
     let bar: [i32; 3] = [0; 3];
     //~^ ERROR in expressions, `_` can only be used on the left-hand side of an assignment
     //~| ERROR using `_` for array lengths is unstable
+    let ref_foo: &[i32; 3] = &[1, 2, 3];
+    //~^ ERROR in expressions, `_` can only be used on the left-hand side of an assignment
+    //~| ERROR using `_` for array lengths is unstable
+    let ref_bar: &[i32; 3] = &[0; 3];
+    //~^ ERROR in expressions, `_` can only be used on the left-hand side of an assignment
+    //~| ERROR using `_` for array lengths is unstable
+    let multiple_ref_foo: &&[i32; 3] = &&[1, 2, 3];
+    //~^ ERROR in expressions, `_` can only be used on the left-hand side of an assignment
+    //~| ERROR using `_` for array lengths is unstable
 }