1
1
error[E0308]: mismatched types
2
- --> $DIR/well-typed-edition-2024.rs:14:22
2
+ --> $DIR/well-typed-edition-2024.rs:30:23
3
3
|
4
- LL | if let Some(Some(&x)) = &Some(& Some(0)) {
5
- | ^^ --------------- this expression has type `&Option<& Option<{integer}>>`
6
- | |
7
- | expected integer, found `&_`
4
+ LL | if let Some(Some(&& x)) = &Some(Some(& 0)) {
5
+ | ^^ --------------- this expression has type `&Option<Option<& {integer}>>`
6
+ | |
7
+ | expected integer, found `&_`
8
8
|
9
9
= note: expected type `{integer}`
10
10
found reference `&_`
11
11
help: consider removing `&` from the pattern
12
12
|
13
- LL | if let Some(Some(x)) = &Some(&Some(0)) {
14
- | ~
13
+ LL - if let Some(Some(&&x)) = &Some(Some(&0)) {
14
+ LL + if let Some(Some(&x)) = &Some(Some(&0)) {
15
+ |
15
16
16
17
error[E0308]: mismatched types
17
- --> $DIR/well-typed-edition-2024.rs:23:23
18
+ --> $DIR/well-typed-edition-2024.rs:37:22
18
19
|
19
- LL | if let Some(Some(&& x)) = &Some(Some(& 0)) {
20
- | ^^ --------------- this expression has type `&Option<Option<& {integer}>>`
21
- | |
22
- | expected integer, found `&_`
20
+ LL | if let Some(Some(&x)) = &Some(& Some(0)) {
21
+ | ^^ --------------- this expression has type `&Option<& Option<{integer}>>`
22
+ | |
23
+ | expected integer, found `&_`
23
24
|
24
25
= note: expected type `{integer}`
25
26
found reference `&_`
26
27
help: consider removing `&` from the pattern
27
28
|
28
- LL - if let Some(Some(&&x)) = &Some(Some(&0)) {
29
- LL + if let Some(Some(&x)) = &Some(Some(&0)) {
30
- |
29
+ LL | if let Some(Some(x)) = &Some(&Some(0)) {
30
+ | ~
31
31
32
32
error[E0308]: mismatched types
33
- --> $DIR/well-typed-edition-2024.rs:28 :17
33
+ --> $DIR/well-typed-edition-2024.rs:42 :17
34
34
|
35
35
LL | if let Some(&Some(x)) = &Some(Some(0)) {
36
36
| ^^^^^^^^ -------------- this expression has type `&Option<Option<{integer}>>`
@@ -41,7 +41,7 @@ LL | if let Some(&Some(x)) = &Some(Some(0)) {
41
41
found reference `&_`
42
42
43
43
error[E0308]: mismatched types
44
- --> $DIR/well-typed-edition-2024.rs:33 :22
44
+ --> $DIR/well-typed-edition-2024.rs:47 :22
45
45
|
46
46
LL | if let Some(Some(&mut x)) = &mut Some(&mut Some(0)) {
47
47
| ^^^^^^ ----------------------- this expression has type `&mut Option<&mut Option<{integer}>>`
@@ -51,7 +51,7 @@ LL | if let Some(Some(&mut x)) = &mut Some(&mut Some(0)) {
51
51
= note: expected type `{integer}`
52
52
found mutable reference `&mut _`
53
53
note: to declare a mutable binding use: `mut x`
54
- --> $DIR/well-typed-edition-2024.rs:33 :22
54
+ --> $DIR/well-typed-edition-2024.rs:47 :22
55
55
|
56
56
LL | if let Some(Some(&mut x)) = &mut Some(&mut Some(0)) {
57
57
| ^^^^^^
@@ -61,33 +61,22 @@ LL | if let Some(Some(x)) = &mut Some(&mut Some(0)) {
61
61
| ~
62
62
63
63
error[E0308]: mismatched types
64
- --> $DIR/well-typed-edition-2024.rs:38 :23
64
+ --> $DIR/well-typed-edition-2024.rs:54 :23
65
65
|
66
- LL | if let Some(&Some(&x)) = &mut Some(&Some(0)) {
67
- | ^^ ------------------- this expression has type `&mut Option<&Option<{integer}>>`
66
+ LL | if let Some(&Some(&x)) = Some(&Some(&mut 0)) {
67
+ | ^^ ------------------- this expression has type `Option<&Option<&mut {integer}>>`
68
68
| |
69
- | expected integer, found `&_`
69
+ | types differ in mutability
70
70
|
71
- = note: expected type ` {integer}`
72
- found reference `&_`
71
+ = note: expected mutable reference `&mut {integer}`
72
+ found reference `&_`
73
73
help: consider removing `&` from the pattern
74
74
|
75
- LL | if let Some(&Some(x)) = &mut Some(&Some(0)) {
75
+ LL | if let Some(&Some(x)) = Some(&Some(&mut 0)) {
76
76
| ~
77
77
78
78
error[E0308]: mismatched types
79
- --> $DIR/well-typed-edition-2024.rs:50:17
80
- |
81
- LL | if let Some(&Some(&x)) = &Some(&mut Some(0)) {
82
- | ^^^^^^^^^ ------------------- this expression has type `&Option<&mut Option<{integer}>>`
83
- | |
84
- | types differ in mutability
85
- |
86
- = note: expected mutable reference `&mut Option<{integer}>`
87
- found reference `&_`
88
-
89
- error[E0308]: mismatched types
90
- --> $DIR/well-typed-edition-2024.rs:55:23
79
+ --> $DIR/well-typed-edition-2024.rs:61:23
91
80
|
92
81
LL | if let Some(&Some(&x)) = &Some(&Some(0)) {
93
82
| ^^ --------------- this expression has type `&Option<&Option<{integer}>>`
@@ -102,7 +91,7 @@ LL | if let Some(&Some(x)) = &Some(&Some(0)) {
102
91
| ~
103
92
104
93
error[E0308]: mismatched types
105
- --> $DIR/well-typed-edition-2024.rs:60 :17
94
+ --> $DIR/well-typed-edition-2024.rs:68 :17
106
95
|
107
96
LL | if let Some(&Some(Some(&x))) = &Some(Some(&mut Some(0))) {
108
97
| ^^^^^^^^^^^^^^^ ------------------------- this expression has type `&Option<Option<&mut Option<{integer}>>>`
@@ -113,22 +102,7 @@ LL | if let Some(&Some(Some(&x))) = &Some(Some(&mut Some(0))) {
113
102
found reference `&_`
114
103
115
104
error[E0308]: mismatched types
116
- --> $DIR/well-typed-edition-2024.rs:65:23
117
- |
118
- LL | if let Some(&Some(&x)) = Some(&Some(&mut 0)) {
119
- | ^^ ------------------- this expression has type `Option<&Option<&mut {integer}>>`
120
- | |
121
- | types differ in mutability
122
- |
123
- = note: expected mutable reference `&mut {integer}`
124
- found reference `&_`
125
- help: consider removing `&` from the pattern
126
- |
127
- LL | if let Some(&Some(x)) = Some(&Some(&mut 0)) {
128
- | ~
129
-
130
- error[E0308]: mismatched types
131
- --> $DIR/well-typed-edition-2024.rs:70:17
105
+ --> $DIR/well-typed-edition-2024.rs:73:17
132
106
|
133
107
LL | if let Some(&Some(x)) = &mut Some(Some(0)) {
134
108
| ^^^^^^^^ ------------------ this expression has type `&mut Option<Option<{integer}>>`
@@ -139,7 +113,33 @@ LL | if let Some(&Some(x)) = &mut Some(Some(0)) {
139
113
found reference `&_`
140
114
141
115
error[E0308]: mismatched types
142
- --> $DIR/well-typed-edition-2024.rs:78:10
116
+ --> $DIR/well-typed-edition-2024.rs:80:17
117
+ |
118
+ LL | if let Some(&Some(&x)) = &Some(&mut Some(0)) {
119
+ | ^^^^^^^^^ ------------------- this expression has type `&Option<&mut Option<{integer}>>`
120
+ | |
121
+ | types differ in mutability
122
+ |
123
+ = note: expected mutable reference `&mut Option<{integer}>`
124
+ found reference `&_`
125
+
126
+ error[E0308]: mismatched types
127
+ --> $DIR/well-typed-edition-2024.rs:85:23
128
+ |
129
+ LL | if let Some(&Some(&x)) = &mut Some(&Some(0)) {
130
+ | ^^ ------------------- this expression has type `&mut Option<&Option<{integer}>>`
131
+ | |
132
+ | expected integer, found `&_`
133
+ |
134
+ = note: expected type `{integer}`
135
+ found reference `&_`
136
+ help: consider removing `&` from the pattern
137
+ |
138
+ LL | if let Some(&Some(x)) = &mut Some(&Some(0)) {
139
+ | ~
140
+
141
+ error[E0308]: mismatched types
142
+ --> $DIR/well-typed-edition-2024.rs:93:10
143
143
|
144
144
LL | let [&mut x] = &mut [&0];
145
145
| ^^^^^^ --------- this expression has type `&mut [&{integer}; 1]`
@@ -149,7 +149,7 @@ LL | let [&mut x] = &mut [&0];
149
149
= note: expected reference `&{integer}`
150
150
found mutable reference `&mut _`
151
151
note: to declare a mutable binding use: `mut x`
152
- --> $DIR/well-typed-edition-2024.rs:78 :10
152
+ --> $DIR/well-typed-edition-2024.rs:93 :10
153
153
|
154
154
LL | let [&mut x] = &mut [&0];
155
155
| ^^^^^^
@@ -160,7 +160,7 @@ LL + let [x] = &mut [&0];
160
160
|
161
161
162
162
error[E0308]: mismatched types
163
- --> $DIR/well-typed-edition-2024.rs:83 :10
163
+ --> $DIR/well-typed-edition-2024.rs:98 :10
164
164
|
165
165
LL | let [&mut ref x] = &mut [&0];
166
166
| ^^^^^^^^^^ --------- this expression has type `&mut [&{integer}; 1]`
@@ -170,7 +170,7 @@ LL | let [&mut ref x] = &mut [&0];
170
170
= note: expected reference `&{integer}`
171
171
found mutable reference `&mut _`
172
172
note: to declare a mutable binding use: `mut x`
173
- --> $DIR/well-typed-edition-2024.rs:83 :10
173
+ --> $DIR/well-typed-edition-2024.rs:98 :10
174
174
|
175
175
LL | let [&mut ref x] = &mut [&0];
176
176
| ^^^^^^^^^^
@@ -181,7 +181,7 @@ LL + let [ref x] = &mut [&0];
181
181
|
182
182
183
183
error[E0308]: mismatched types
184
- --> $DIR/well-typed-edition-2024.rs:88 :10
184
+ --> $DIR/well-typed-edition-2024.rs:103 :10
185
185
|
186
186
LL | let [&mut ref mut x] = &mut [&0];
187
187
| ^^^^^^^^^^^^^^ --------- this expression has type `&mut [&{integer}; 1]`
@@ -191,7 +191,7 @@ LL | let [&mut ref mut x] = &mut [&0];
191
191
= note: expected reference `&{integer}`
192
192
found mutable reference `&mut _`
193
193
note: to declare a mutable binding use: `mut x`
194
- --> $DIR/well-typed-edition-2024.rs:88 :10
194
+ --> $DIR/well-typed-edition-2024.rs:103 :10
195
195
|
196
196
LL | let [&mut ref mut x] = &mut [&0];
197
197
| ^^^^^^^^^^^^^^
@@ -202,7 +202,7 @@ LL + let [ref mut x] = &mut [&0];
202
202
|
203
203
204
204
error[E0308]: mismatched types
205
- --> $DIR/well-typed-edition-2024.rs:93 :10
205
+ --> $DIR/well-typed-edition-2024.rs:108 :10
206
206
|
207
207
LL | let [&mut mut x] = &mut [&0];
208
208
| ^^^^^^^^^^ --------- this expression has type `&mut [&{integer}; 1]`
@@ -212,7 +212,7 @@ LL | let [&mut mut x] = &mut [&0];
212
212
= note: expected reference `&{integer}`
213
213
found mutable reference `&mut _`
214
214
note: to declare a mutable binding use: `mut x`
215
- --> $DIR/well-typed-edition-2024.rs:93 :10
215
+ --> $DIR/well-typed-edition-2024.rs:108 :10
216
216
|
217
217
LL | let [&mut mut x] = &mut [&0];
218
218
| ^^^^^^^^^^
@@ -223,7 +223,7 @@ LL + let [mut x] = &mut [&0];
223
223
|
224
224
225
225
error[E0308]: mismatched types
226
- --> $DIR/well-typed-edition-2024.rs:98 :10
226
+ --> $DIR/well-typed-edition-2024.rs:113 :10
227
227
|
228
228
LL | let [&mut &x] = &mut [&0];
229
229
| ^^^^^^^ --------- this expression has type `&mut [&{integer}; 1]`
@@ -234,7 +234,7 @@ LL | let [&mut &x] = &mut [&0];
234
234
found mutable reference `&mut _`
235
235
236
236
error[E0308]: mismatched types
237
- --> $DIR/well-typed-edition-2024.rs:103 :10
237
+ --> $DIR/well-typed-edition-2024.rs:118 :10
238
238
|
239
239
LL | let [&mut &ref x] = &mut [&0];
240
240
| ^^^^^^^^^^^ --------- this expression has type `&mut [&{integer}; 1]`
@@ -245,7 +245,7 @@ LL | let [&mut &ref x] = &mut [&0];
245
245
found mutable reference `&mut _`
246
246
247
247
error[E0308]: mismatched types
248
- --> $DIR/well-typed-edition-2024.rs:108 :10
248
+ --> $DIR/well-typed-edition-2024.rs:123 :10
249
249
|
250
250
LL | let [&mut &(mut x)] = &mut [&0];
251
251
| ^^^^^^^^^^^^^ --------- this expression has type `&mut [&{integer}; 1]`
0 commit comments