summaryrefslogtreecommitdiffstats
path: root/tests/ui/array-slice-vec
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:59:24 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:59:24 +0000
commit023939b627b7dc93b01471f7d41fb8553ddb4ffa (patch)
tree60fc59477c605c72b0a1051409062ddecc43f877 /tests/ui/array-slice-vec
parentAdding debian version 1.72.1+dfsg1-1. (diff)
downloadrustc-023939b627b7dc93b01471f7d41fb8553ddb4ffa.tar.xz
rustc-023939b627b7dc93b01471f7d41fb8553ddb4ffa.zip
Merging upstream version 1.73.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/array-slice-vec')
-rw-r--r--tests/ui/array-slice-vec/infer_array_len.rs4
-rw-r--r--tests/ui/array-slice-vec/infer_array_len.stderr14
-rw-r--r--tests/ui/array-slice-vec/slice-2.stderr16
-rw-r--r--tests/ui/array-slice-vec/slice-pat-type-mismatches.rs15
-rw-r--r--tests/ui/array-slice-vec/slice-pat-type-mismatches.stderr2
-rw-r--r--tests/ui/array-slice-vec/vec-mut-iter-borrow.stderr2
6 files changed, 19 insertions, 34 deletions
diff --git a/tests/ui/array-slice-vec/infer_array_len.rs b/tests/ui/array-slice-vec/infer_array_len.rs
index 22fe7cb88..547c1f572 100644
--- a/tests/ui/array-slice-vec/infer_array_len.rs
+++ b/tests/ui/array-slice-vec/infer_array_len.rs
@@ -1,4 +1,4 @@
-// see issue #70529
+// check-pass
struct A;
impl From<A> for [u8; 2] {
@@ -13,9 +13,7 @@ impl From<A> for [u8; 3] {
}
}
-
fn main() {
let a = A;
let [_, _] = a.into();
- //~^ ERROR type annotations needed
}
diff --git a/tests/ui/array-slice-vec/infer_array_len.stderr b/tests/ui/array-slice-vec/infer_array_len.stderr
deleted file mode 100644
index c2a509a19..000000000
--- a/tests/ui/array-slice-vec/infer_array_len.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error[E0282]: type annotations needed
- --> $DIR/infer_array_len.rs:19:9
- |
-LL | let [_, _] = a.into();
- | ^^^^^^
- |
-help: consider giving this pattern a type
- |
-LL | let [_, _]: /* Type */ = a.into();
- | ++++++++++++
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0282`.
diff --git a/tests/ui/array-slice-vec/slice-2.stderr b/tests/ui/array-slice-vec/slice-2.stderr
index 561feb90f..b122b4691 100644
--- a/tests/ui/array-slice-vec/slice-2.stderr
+++ b/tests/ui/array-slice-vec/slice-2.stderr
@@ -1,26 +1,26 @@
error[E0608]: cannot index into a value of type `Foo`
- --> $DIR/slice-2.rs:7:6
+ --> $DIR/slice-2.rs:7:7
|
LL | &x[..];
- | ^^^^^
+ | ^^^^
error[E0608]: cannot index into a value of type `Foo`
- --> $DIR/slice-2.rs:8:6
+ --> $DIR/slice-2.rs:8:7
|
LL | &x[Foo..];
- | ^^^^^^^^
+ | ^^^^^^^
error[E0608]: cannot index into a value of type `Foo`
- --> $DIR/slice-2.rs:9:6
+ --> $DIR/slice-2.rs:9:7
|
LL | &x[..Foo];
- | ^^^^^^^^
+ | ^^^^^^^
error[E0608]: cannot index into a value of type `Foo`
- --> $DIR/slice-2.rs:10:6
+ --> $DIR/slice-2.rs:10:7
|
LL | &x[Foo..Foo];
- | ^^^^^^^^^^^
+ | ^^^^^^^^^^
error: aborting due to 4 previous errors
diff --git a/tests/ui/array-slice-vec/slice-pat-type-mismatches.rs b/tests/ui/array-slice-vec/slice-pat-type-mismatches.rs
index 521b898e7..03a1876fd 100644
--- a/tests/ui/array-slice-vec/slice-pat-type-mismatches.rs
+++ b/tests/ui/array-slice-vec/slice-pat-type-mismatches.rs
@@ -2,7 +2,7 @@ fn main() {
match "foo".to_string() {
['f', 'o', ..] => {}
//~^ ERROR expected an array or slice, found `String`
- _ => { }
+ _ => {}
};
// Note that this one works with default binding modes.
@@ -15,7 +15,7 @@ fn main() {
};
match [0, 1, 2] {
- [0] => {}, //~ ERROR pattern requires
+ [0] => {} //~ ERROR pattern requires
[0, 1, x @ ..] => {
let a: [_; 1] = x;
@@ -23,14 +23,15 @@ fn main() {
[0, 1, 2, 3, x @ ..] => {} //~ ERROR pattern requires
};
- match does_not_exist { //~ ERROR cannot find value `does_not_exist` in this scope
- [] => {}
+ match does_not_exist {
+ //~^ ERROR cannot find value `does_not_exist` in this scope
+ [] => {} // ERROR cannot find value `does_not_exist` in this scope
};
}
fn another_fn_to_avoid_suppression() {
- match Default::default()
- {
- [] => {} //~ ERROR type annotations needed
+ match Default::default() {
+ [] => {}
+ //~^ ERROR type annotations needed
};
}
diff --git a/tests/ui/array-slice-vec/slice-pat-type-mismatches.stderr b/tests/ui/array-slice-vec/slice-pat-type-mismatches.stderr
index 70a4cbebe..d1d042c47 100644
--- a/tests/ui/array-slice-vec/slice-pat-type-mismatches.stderr
+++ b/tests/ui/array-slice-vec/slice-pat-type-mismatches.stderr
@@ -13,7 +13,7 @@ LL | ['f', 'o', ..] => {}
error[E0527]: pattern requires 1 element but array has 3
--> $DIR/slice-pat-type-mismatches.rs:18:9
|
-LL | [0] => {},
+LL | [0] => {}
| ^^^ expected 3 elements
error[E0528]: pattern requires at least 4 elements but array has 3
diff --git a/tests/ui/array-slice-vec/vec-mut-iter-borrow.stderr b/tests/ui/array-slice-vec/vec-mut-iter-borrow.stderr
index 0ec263c85..679fd8997 100644
--- a/tests/ui/array-slice-vec/vec-mut-iter-borrow.stderr
+++ b/tests/ui/array-slice-vec/vec-mut-iter-borrow.stderr
@@ -7,7 +7,7 @@ LL | for x in &mut xs {
| first mutable borrow occurs here
| first borrow later used here
LL | xs.push(1)
- | ^^^^^^^^^^ second mutable borrow occurs here
+ | ^^ second mutable borrow occurs here
error: aborting due to previous error