Skip to content

Commit afd976b

Browse files
committed
add more information to old tests
1 parent fdcbd71 commit afd976b

File tree

3 files changed

+36
-28
lines changed

3 files changed

+36
-28
lines changed

tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/pattern-errors.classic2024.stderr

+9-9
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ LL | if let Some(&x) = &Some(&mut 0) {
1111
| ~
1212

1313
error[E0308]: mismatched types
14-
--> $DIR/pattern-errors.rs:14:17
14+
--> $DIR/pattern-errors.rs:15:17
1515
|
1616
LL | if let Some(&mut Some(&x)) = &Some(&mut Some(0)) {
1717
| ^^^^^
@@ -23,7 +23,7 @@ LL | if let Some(&Some(&x)) = &Some(&mut Some(0)) {
2323
| ~
2424

2525
error[E0308]: mismatched types
26-
--> $DIR/pattern-errors.rs:18:22
26+
--> $DIR/pattern-errors.rs:20:22
2727
|
2828
LL | if let Some(Some(&mut x)) = &Some(Some(&mut 0)) {
2929
| ^^^^^
@@ -35,7 +35,7 @@ LL | if let Some(Some(&x)) = &Some(Some(&mut 0)) {
3535
| ~
3636

3737
error[E0308]: mismatched types
38-
--> $DIR/pattern-errors.rs:23:17
38+
--> $DIR/pattern-errors.rs:26:17
3939
|
4040
LL | if let Some(&mut Some(&_)) = &Some(&Some(0)) {
4141
| ^^^^^
@@ -47,7 +47,7 @@ LL | if let Some(&Some(&_)) = &Some(&Some(0)) {
4747
| ~
4848

4949
error[E0308]: mismatched types
50-
--> $DIR/pattern-errors.rs:29:23
50+
--> $DIR/pattern-errors.rs:34:23
5151
|
5252
LL | if let Some(&Some(&mut _)) = &mut Some(&Some(0)) {
5353
| ^^^^^
@@ -59,7 +59,7 @@ LL | if let Some(&Some(&_)) = &mut Some(&Some(0)) {
5959
| ~
6060

6161
error[E0308]: mismatched types
62-
--> $DIR/pattern-errors.rs:35:17
62+
--> $DIR/pattern-errors.rs:42:17
6363
|
6464
LL | if let Some(&mut Some(x)) = &Some(Some(0)) {
6565
| ^^^^^
@@ -71,7 +71,7 @@ LL | if let Some(&Some(x)) = &Some(Some(0)) {
7171
| ~
7272

7373
error[E0308]: mismatched types
74-
--> $DIR/pattern-errors.rs:115:10
74+
--> $DIR/pattern-errors.rs:123:10
7575
|
7676
LL | let [&mut x] = &[&mut 0];
7777
| ^^^^^
@@ -83,7 +83,7 @@ LL | let [&x] = &[&mut 0];
8383
| ~
8484

8585
error[E0308]: mismatched types
86-
--> $DIR/pattern-errors.rs:120:10
86+
--> $DIR/pattern-errors.rs:128:10
8787
|
8888
LL | let [&mut &x] = &[&mut 0];
8989
| ^^^^^
@@ -95,7 +95,7 @@ LL | let [&&x] = &[&mut 0];
9595
| ~
9696

9797
error[E0308]: mismatched types
98-
--> $DIR/pattern-errors.rs:125:10
98+
--> $DIR/pattern-errors.rs:133:10
9999
|
100100
LL | let [&mut &ref x] = &[&mut 0];
101101
| ^^^^^
@@ -107,7 +107,7 @@ LL | let [&&ref x] = &[&mut 0];
107107
| ~
108108

109109
error[E0308]: mismatched types
110-
--> $DIR/pattern-errors.rs:130:10
110+
--> $DIR/pattern-errors.rs:138:10
111111
|
112112
LL | let [&mut &(mut x)] = &[&mut 0];
113113
| ^^^^^

tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/pattern-errors.rs

+8
Original file line numberDiff line numberDiff line change
@@ -9,31 +9,39 @@
99
pub fn main() {
1010
if let Some(&mut x) = &Some(&mut 0) {
1111
//[classic2024]~^ ERROR: mismatched types
12+
//[classic2024]~| cannot match inherited `&` with `&mut` pattern
1213
let _: &u32 = x;
1314
}
1415
if let Some(&mut Some(&x)) = &Some(&mut Some(0)) {
1516
//[classic2024]~^ ERROR: mismatched types
17+
//[classic2024]~| cannot match inherited `&` with `&mut` pattern
1618
let _: u32 = x;
1719
}
1820
if let Some(Some(&mut x)) = &Some(Some(&mut 0)) {
1921
//[classic2024]~^ ERROR: mismatched types
22+
//[classic2024]~| cannot match inherited `&` with `&mut` pattern
2023
let _: &u32 = x;
2124
}
2225

2326
if let Some(&mut Some(&_)) = &Some(&Some(0)) {
2427
//~^ ERROR: mismatched types
28+
//~| cannot match inherited `&` with `&mut` pattern
2529
}
2630
if let Some(&Some(&mut _)) = &Some(&mut Some(0)) {
2731
//[structural2024]~^ ERROR: mismatched types
32+
//[structural2024]~| cannot match inherited `&` with `&mut` pattern
2833
}
2934
if let Some(&Some(&mut _)) = &mut Some(&Some(0)) {
3035
//~^ ERROR: mismatched types
36+
//~| cannot match inherited `&` with `&mut` pattern
3137
}
3238
if let Some(&Some(Some(&mut _))) = &Some(Some(&mut Some(0))) {
3339
//[structural2024]~^ ERROR: mismatched types
40+
//[structural2024]~| cannot match inherited `&` with `&mut` pattern
3441
}
3542
if let Some(&mut Some(x)) = &Some(Some(0)) {
3643
//~^ ERROR: mismatched types
44+
//~| cannot match inherited `&` with `&mut` pattern
3745
}
3846
}
3947

tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/pattern-errors.structural2024.stderr

+19-19
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0308]: mismatched types
2-
--> $DIR/pattern-errors.rs:23:17
2+
--> $DIR/pattern-errors.rs:26:17
33
|
44
LL | if let Some(&mut Some(&_)) = &Some(&Some(0)) {
55
| ^^^^^
@@ -11,7 +11,7 @@ LL | if let Some(&Some(&_)) = &Some(&Some(0)) {
1111
| ~
1212

1313
error[E0308]: mismatched types
14-
--> $DIR/pattern-errors.rs:26:23
14+
--> $DIR/pattern-errors.rs:30:23
1515
|
1616
LL | if let Some(&Some(&mut _)) = &Some(&mut Some(0)) {
1717
| ^^^^^
@@ -23,7 +23,7 @@ LL | if let Some(&Some(&_)) = &Some(&mut Some(0)) {
2323
| ~
2424

2525
error[E0308]: mismatched types
26-
--> $DIR/pattern-errors.rs:29:23
26+
--> $DIR/pattern-errors.rs:34:23
2727
|
2828
LL | if let Some(&Some(&mut _)) = &mut Some(&Some(0)) {
2929
| ^^^^^
@@ -35,7 +35,7 @@ LL | if let Some(&Some(&_)) = &mut Some(&Some(0)) {
3535
| ~
3636

3737
error[E0308]: mismatched types
38-
--> $DIR/pattern-errors.rs:32:28
38+
--> $DIR/pattern-errors.rs:38:28
3939
|
4040
LL | if let Some(&Some(Some(&mut _))) = &Some(Some(&mut Some(0))) {
4141
| ^^^^^
@@ -47,7 +47,7 @@ LL | if let Some(&Some(Some(&_))) = &Some(Some(&mut Some(0))) {
4747
| ~
4848

4949
error[E0308]: mismatched types
50-
--> $DIR/pattern-errors.rs:35:17
50+
--> $DIR/pattern-errors.rs:42:17
5151
|
5252
LL | if let Some(&mut Some(x)) = &Some(Some(0)) {
5353
| ^^^^^
@@ -59,7 +59,7 @@ LL | if let Some(&Some(x)) = &Some(Some(0)) {
5959
| ~
6060

6161
error[E0308]: mismatched types
62-
--> $DIR/pattern-errors.rs:41:11
62+
--> $DIR/pattern-errors.rs:49:11
6363
|
6464
LL | let &[&mut x] = &&mut [0];
6565
| ^^^^^
@@ -71,7 +71,7 @@ LL | let &[&x] = &&mut [0];
7171
| ~
7272

7373
error[E0308]: mismatched types
74-
--> $DIR/pattern-errors.rs:46:11
74+
--> $DIR/pattern-errors.rs:54:11
7575
|
7676
LL | let &[&mut x] = &mut &mut [0];
7777
| ^^^^^
@@ -83,7 +83,7 @@ LL | let &[&x] = &mut &mut [0];
8383
| ~
8484

8585
error[E0308]: mismatched types
86-
--> $DIR/pattern-errors.rs:51:11
86+
--> $DIR/pattern-errors.rs:59:11
8787
|
8888
LL | let &[&mut ref x] = &&mut [0];
8989
| ^^^^^
@@ -95,7 +95,7 @@ LL | let &[&ref x] = &&mut [0];
9595
| ~
9696

9797
error[E0308]: mismatched types
98-
--> $DIR/pattern-errors.rs:56:11
98+
--> $DIR/pattern-errors.rs:64:11
9999
|
100100
LL | let &[&mut ref x] = &mut &mut [0];
101101
| ^^^^^
@@ -107,7 +107,7 @@ LL | let &[&ref x] = &mut &mut [0];
107107
| ~
108108

109109
error[E0308]: mismatched types
110-
--> $DIR/pattern-errors.rs:61:11
110+
--> $DIR/pattern-errors.rs:69:11
111111
|
112112
LL | let &[&mut mut x] = &&mut [0];
113113
| ^^^^^
@@ -119,7 +119,7 @@ LL | let &[&mut x] = &&mut [0];
119119
| ~
120120

121121
error[E0308]: mismatched types
122-
--> $DIR/pattern-errors.rs:66:11
122+
--> $DIR/pattern-errors.rs:74:11
123123
|
124124
LL | let &[&mut mut x] = &mut &mut [0];
125125
| ^^^^^
@@ -131,7 +131,7 @@ LL | let &[&mut x] = &mut &mut [0];
131131
| ~
132132

133133
error[E0658]: binding cannot be both mutable and by-reference
134-
--> $DIR/pattern-errors.rs:73:12
134+
--> $DIR/pattern-errors.rs:81:12
135135
|
136136
LL | let [&(mut x)] = &[&0];
137137
| ^^^^
@@ -141,7 +141,7 @@ LL | let [&(mut x)] = &[&0];
141141
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
142142

143143
error[E0658]: binding cannot be both mutable and by-reference
144-
--> $DIR/pattern-errors.rs:77:12
144+
--> $DIR/pattern-errors.rs:85:12
145145
|
146146
LL | let [&(mut x)] = &mut [&0];
147147
| ^^^^
@@ -151,7 +151,7 @@ LL | let [&(mut x)] = &mut [&0];
151151
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
152152

153153
error[E0308]: mismatched types
154-
--> $DIR/pattern-errors.rs:83:11
154+
--> $DIR/pattern-errors.rs:91:11
155155
|
156156
LL | let [&&mut x] = &[&mut 0];
157157
| ^^^^^
@@ -163,7 +163,7 @@ LL | let [&&x] = &[&mut 0];
163163
| ~
164164

165165
error[E0308]: mismatched types
166-
--> $DIR/pattern-errors.rs:88:11
166+
--> $DIR/pattern-errors.rs:96:11
167167
|
168168
LL | let [&&mut x] = &mut [&mut 0];
169169
| ^^^^^
@@ -175,7 +175,7 @@ LL | let [&&x] = &mut [&mut 0];
175175
| ~
176176

177177
error[E0308]: mismatched types
178-
--> $DIR/pattern-errors.rs:93:11
178+
--> $DIR/pattern-errors.rs:101:11
179179
|
180180
LL | let [&&mut ref x] = &[&mut 0];
181181
| ^^^^^
@@ -187,7 +187,7 @@ LL | let [&&ref x] = &[&mut 0];
187187
| ~
188188

189189
error[E0308]: mismatched types
190-
--> $DIR/pattern-errors.rs:98:11
190+
--> $DIR/pattern-errors.rs:106:11
191191
|
192192
LL | let [&&mut ref x] = &mut [&mut 0];
193193
| ^^^^^
@@ -199,7 +199,7 @@ LL | let [&&ref x] = &mut [&mut 0];
199199
| ~
200200

201201
error[E0308]: mismatched types
202-
--> $DIR/pattern-errors.rs:103:11
202+
--> $DIR/pattern-errors.rs:111:11
203203
|
204204
LL | let [&&mut mut x] = &[&mut 0];
205205
| ^^^^^
@@ -211,7 +211,7 @@ LL | let [&&mut x] = &[&mut 0];
211211
| ~
212212

213213
error[E0308]: mismatched types
214-
--> $DIR/pattern-errors.rs:108:11
214+
--> $DIR/pattern-errors.rs:116:11
215215
|
216216
LL | let [&&mut mut x] = &mut [&mut 0];
217217
| ^^^^^

0 commit comments

Comments
 (0)