11error[E0308]: mismatched types
2- --> $DIR/well-typed-edition-2024.rs:14:22
2+ --> $DIR/well-typed-edition-2024.rs:30:23
33 |
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 `&_`
88 |
99 = note: expected type `{integer}`
1010 found reference `&_`
1111help: consider removing `&` from the pattern
1212 |
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+ |
1516
1617error[E0308]: mismatched types
17- --> $DIR/well-typed-edition-2024.rs:23:23
18+ --> $DIR/well-typed-edition-2024.rs:37:22
1819 |
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 `&_`
2324 |
2425 = note: expected type `{integer}`
2526 found reference `&_`
2627help: consider removing `&` from the pattern
2728 |
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+ | ~
3131
3232error[E0308]: mismatched types
33- --> $DIR/well-typed-edition-2024.rs:28 :17
33+ --> $DIR/well-typed-edition-2024.rs:42 :17
3434 |
3535LL | if let Some(&Some(x)) = &Some(Some(0)) {
3636 | ^^^^^^^^ -------------- this expression has type `&Option<Option<{integer}>>`
@@ -41,7 +41,7 @@ LL | if let Some(&Some(x)) = &Some(Some(0)) {
4141 found reference `&_`
4242
4343error[E0308]: mismatched types
44- --> $DIR/well-typed-edition-2024.rs:33 :22
44+ --> $DIR/well-typed-edition-2024.rs:47 :22
4545 |
4646LL | if let Some(Some(&mut x)) = &mut Some(&mut Some(0)) {
4747 | ^^^^^^ ----------------------- 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)) {
5151 = note: expected type `{integer}`
5252 found mutable reference `&mut _`
5353note: 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
5555 |
5656LL | if let Some(Some(&mut x)) = &mut Some(&mut Some(0)) {
5757 | ^^^^^^
@@ -61,33 +61,22 @@ LL | if let Some(Some(x)) = &mut Some(&mut Some(0)) {
6161 | ~
6262
6363error[E0308]: mismatched types
64- --> $DIR/well-typed-edition-2024.rs:38 :23
64+ --> $DIR/well-typed-edition-2024.rs:54 :23
6565 |
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}>>`
6868 | |
69- | expected integer, found `&_`
69+ | types differ in mutability
7070 |
71- = note: expected type ` {integer}`
72- found reference `&_`
71+ = note: expected mutable reference `&mut {integer}`
72+ found reference `&_`
7373help: consider removing `&` from the pattern
7474 |
75- LL | if let Some(&Some(x)) = &mut Some(&Some(0)) {
75+ LL | if let Some(&Some(x)) = Some(&Some(&mut 0)) {
7676 | ~
7777
7878error[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
9180 |
9281LL | if let Some(&Some(&x)) = &Some(&Some(0)) {
9382 | ^^ --------------- this expression has type `&Option<&Option<{integer}>>`
@@ -102,7 +91,7 @@ LL | if let Some(&Some(x)) = &Some(&Some(0)) {
10291 | ~
10392
10493error[E0308]: mismatched types
105- --> $DIR/well-typed-edition-2024.rs:60 :17
94+ --> $DIR/well-typed-edition-2024.rs:68 :17
10695 |
10796LL | if let Some(&Some(Some(&x))) = &Some(Some(&mut Some(0))) {
10897 | ^^^^^^^^^^^^^^^ ------------------------- 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))) {
113102 found reference `&_`
114103
115104error[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
132106 |
133107LL | if let Some(&Some(x)) = &mut Some(Some(0)) {
134108 | ^^^^^^^^ ------------------ this expression has type `&mut Option<Option<{integer}>>`
@@ -139,7 +113,33 @@ LL | if let Some(&Some(x)) = &mut Some(Some(0)) {
139113 found reference `&_`
140114
141115error[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
143143 |
144144LL | let [&mut x] = &mut [&0];
145145 | ^^^^^^ --------- this expression has type `&mut [&{integer}; 1]`
@@ -149,7 +149,7 @@ LL | let [&mut x] = &mut [&0];
149149 = note: expected reference `&{integer}`
150150 found mutable reference `&mut _`
151151note: 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
153153 |
154154LL | let [&mut x] = &mut [&0];
155155 | ^^^^^^
@@ -160,7 +160,7 @@ LL + let [x] = &mut [&0];
160160 |
161161
162162error[E0308]: mismatched types
163- --> $DIR/well-typed-edition-2024.rs:83 :10
163+ --> $DIR/well-typed-edition-2024.rs:98 :10
164164 |
165165LL | let [&mut ref x] = &mut [&0];
166166 | ^^^^^^^^^^ --------- this expression has type `&mut [&{integer}; 1]`
@@ -170,7 +170,7 @@ LL | let [&mut ref x] = &mut [&0];
170170 = note: expected reference `&{integer}`
171171 found mutable reference `&mut _`
172172note: 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
174174 |
175175LL | let [&mut ref x] = &mut [&0];
176176 | ^^^^^^^^^^
@@ -181,7 +181,7 @@ LL + let [ref x] = &mut [&0];
181181 |
182182
183183error[E0308]: mismatched types
184- --> $DIR/well-typed-edition-2024.rs:88 :10
184+ --> $DIR/well-typed-edition-2024.rs:103 :10
185185 |
186186LL | let [&mut ref mut x] = &mut [&0];
187187 | ^^^^^^^^^^^^^^ --------- this expression has type `&mut [&{integer}; 1]`
@@ -191,7 +191,7 @@ LL | let [&mut ref mut x] = &mut [&0];
191191 = note: expected reference `&{integer}`
192192 found mutable reference `&mut _`
193193note: 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
195195 |
196196LL | let [&mut ref mut x] = &mut [&0];
197197 | ^^^^^^^^^^^^^^
@@ -202,7 +202,7 @@ LL + let [ref mut x] = &mut [&0];
202202 |
203203
204204error[E0308]: mismatched types
205- --> $DIR/well-typed-edition-2024.rs:93 :10
205+ --> $DIR/well-typed-edition-2024.rs:108 :10
206206 |
207207LL | let [&mut mut x] = &mut [&0];
208208 | ^^^^^^^^^^ --------- this expression has type `&mut [&{integer}; 1]`
@@ -212,7 +212,7 @@ LL | let [&mut mut x] = &mut [&0];
212212 = note: expected reference `&{integer}`
213213 found mutable reference `&mut _`
214214note: 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
216216 |
217217LL | let [&mut mut x] = &mut [&0];
218218 | ^^^^^^^^^^
@@ -223,7 +223,7 @@ LL + let [mut x] = &mut [&0];
223223 |
224224
225225error[E0308]: mismatched types
226- --> $DIR/well-typed-edition-2024.rs:98 :10
226+ --> $DIR/well-typed-edition-2024.rs:113 :10
227227 |
228228LL | let [&mut &x] = &mut [&0];
229229 | ^^^^^^^ --------- this expression has type `&mut [&{integer}; 1]`
@@ -234,7 +234,7 @@ LL | let [&mut &x] = &mut [&0];
234234 found mutable reference `&mut _`
235235
236236error[E0308]: mismatched types
237- --> $DIR/well-typed-edition-2024.rs:103 :10
237+ --> $DIR/well-typed-edition-2024.rs:118 :10
238238 |
239239LL | let [&mut &ref x] = &mut [&0];
240240 | ^^^^^^^^^^^ --------- this expression has type `&mut [&{integer}; 1]`
@@ -245,7 +245,7 @@ LL | let [&mut &ref x] = &mut [&0];
245245 found mutable reference `&mut _`
246246
247247error[E0308]: mismatched types
248- --> $DIR/well-typed-edition-2024.rs:108 :10
248+ --> $DIR/well-typed-edition-2024.rs:123 :10
249249 |
250250LL | let [&mut &(mut x)] = &mut [&0];
251251 | ^^^^^^^^^^^^^ --------- this expression has type `&mut [&{integer}; 1]`
0 commit comments