2025-01-22 23:59:03 -08:00
|
|
|
error[E0308]: mismatched types
|
|
|
|
|
--> $DIR/pattern-errors.rs:20:27
|
|
|
|
|
|
|
|
|
|
|
LL | if let Some(&mut Some(&x)) = &Some(&mut Some(0)) {
|
|
|
|
|
| ^^ ------------------- this expression has type `&Option<&mut Option<{integer}>>`
|
|
|
|
|
| |
|
|
|
|
|
| expected integer, found `&_`
|
|
|
|
|
|
|
|
|
|
|
= note: expected type `{integer}`
|
|
|
|
|
found reference `&_`
|
|
|
|
|
help: consider removing `&` from the pattern
|
|
|
|
|
|
|
|
|
|
|
LL - if let Some(&mut Some(&x)) = &Some(&mut Some(0)) {
|
|
|
|
|
LL + if let Some(&mut Some(x)) = &Some(&mut Some(0)) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
|
|
|
|
--> $DIR/pattern-errors.rs:33:17
|
|
|
|
|
|
|
|
|
|
|
LL | if let Some(&mut Some(&_)) = &Some(&Some(0)) {
|
|
|
|
|
| ^^^^^^^^^^^^^ --------------- this expression has type `&Option<&Option<{integer}>>`
|
|
|
|
|
| |
|
|
|
|
|
| types differ in mutability
|
|
|
|
|
|
|
|
|
|
|
= note: expected reference `&Option<{integer}>`
|
|
|
|
|
found mutable reference `&mut _`
|
|
|
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
|
|
|
|
--> $DIR/pattern-errors.rs:38:23
|
|
|
|
|
|
|
|
|
|
|
LL | if let Some(&Some(&mut x)) = &Some(&mut Some(0)) {
|
|
|
|
|
| ^^^^^^ ------------------- this expression has type `&Option<&mut Option<{integer}>>`
|
|
|
|
|
| |
|
|
|
|
|
| expected integer, found `&mut _`
|
|
|
|
|
|
|
|
|
|
|
= note: expected type `{integer}`
|
|
|
|
|
found mutable reference `&mut _`
|
|
|
|
|
note: to declare a mutable binding use: `mut x`
|
|
|
|
|
--> $DIR/pattern-errors.rs:38:23
|
|
|
|
|
|
|
|
|
|
|
LL | if let Some(&Some(&mut x)) = &Some(&mut Some(0)) {
|
|
|
|
|
| ^^^^^^
|
|
|
|
|
help: consider removing `&mut` from the pattern
|
|
|
|
|
|
|
|
|
|
|
LL - if let Some(&Some(&mut x)) = &Some(&mut Some(0)) {
|
|
|
|
|
LL + if let Some(&Some(x)) = &Some(&mut Some(0)) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
|
|
|
|
--> $DIR/pattern-errors.rs:45:23
|
|
|
|
|
|
|
|
|
|
|
LL | if let Some(&Some(&mut _)) = &mut Some(&Some(0)) {
|
|
|
|
|
| ^^^^^^ ------------------- this expression has type `&mut Option<&Option<{integer}>>`
|
|
|
|
|
| |
|
|
|
|
|
| expected integer, found `&mut _`
|
|
|
|
|
|
|
|
|
|
|
= note: expected type `{integer}`
|
|
|
|
|
found mutable reference `&mut _`
|
|
|
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
2025-01-25 23:32:12 -08:00
|
|
|
--> $DIR/pattern-errors.rs:50:28
|
2025-01-22 23:59:03 -08:00
|
|
|
|
|
|
|
|
|
LL | if let Some(&Some(Some(&mut x))) = &Some(Some(&mut Some(0))) {
|
2025-01-25 23:32:12 -08:00
|
|
|
| ^^^^^
|
|
|
|
|
|
|
|
|
|
|
= note: cannot match inherited `&` with `&mut` pattern
|
|
|
|
|
help: replace this `&mut` pattern with `&`
|
|
|
|
|
|
|
|
|
|
|
LL - if let Some(&Some(Some(&mut x))) = &Some(Some(&mut Some(0))) {
|
|
|
|
|
LL + if let Some(&Some(Some(&x))) = &Some(Some(&mut Some(0))) {
|
2025-01-22 23:59:03 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
2025-01-25 23:32:12 -08:00
|
|
|
--> $DIR/pattern-errors.rs:56:17
|
2025-01-22 23:59:03 -08:00
|
|
|
|
|
|
|
|
|
LL | if let Some(&mut Some(x)) = &Some(Some(0)) {
|
2025-01-25 23:32:12 -08:00
|
|
|
| ^^^^^
|
|
|
|
|
|
|
|
|
|
|
= note: cannot match inherited `&` with `&mut` pattern
|
|
|
|
|
help: replace this `&mut` pattern with `&`
|
|
|
|
|
|
|
|
|
|
|
LL - if let Some(&mut Some(x)) = &Some(Some(0)) {
|
|
|
|
|
LL + if let Some(&Some(x)) = &Some(Some(0)) {
|
2025-01-22 23:59:03 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
2025-01-25 23:32:12 -08:00
|
|
|
--> $DIR/pattern-errors.rs:64:11
|
2025-01-22 23:59:03 -08:00
|
|
|
|
|
|
|
|
|
LL | let &[&mut x] = &&mut [0];
|
2025-01-25 23:32:12 -08:00
|
|
|
| ^^^^^
|
2025-01-22 23:59:03 -08:00
|
|
|
|
|
2025-01-25 23:32:12 -08:00
|
|
|
= note: cannot match inherited `&` with `&mut` pattern
|
|
|
|
|
help: replace this `&mut` pattern with `&`
|
2025-01-22 23:59:03 -08:00
|
|
|
|
|
|
|
|
|
LL - let &[&mut x] = &&mut [0];
|
2025-01-25 23:32:12 -08:00
|
|
|
LL + let &[&x] = &&mut [0];
|
2025-01-22 23:59:03 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
2025-01-25 23:32:12 -08:00
|
|
|
--> $DIR/pattern-errors.rs:70:11
|
2025-01-22 23:59:03 -08:00
|
|
|
|
|
|
|
|
|
LL | let &[&mut x] = &mut &mut [0];
|
2025-01-25 23:32:12 -08:00
|
|
|
| ^^^^^
|
2025-01-22 23:59:03 -08:00
|
|
|
|
|
2025-01-25 23:32:12 -08:00
|
|
|
= note: cannot match inherited `&` with `&mut` pattern
|
|
|
|
|
help: replace this `&mut` pattern with `&`
|
2025-01-22 23:59:03 -08:00
|
|
|
|
|
|
|
|
|
LL - let &[&mut x] = &mut &mut [0];
|
2025-01-25 23:32:12 -08:00
|
|
|
LL + let &[&x] = &mut &mut [0];
|
2025-01-22 23:59:03 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
2025-01-25 23:32:12 -08:00
|
|
|
--> $DIR/pattern-errors.rs:76:11
|
2025-01-22 23:59:03 -08:00
|
|
|
|
|
|
|
|
|
LL | let &[&mut ref x] = &&mut [0];
|
2025-01-25 23:32:12 -08:00
|
|
|
| ^^^^^
|
2025-01-22 23:59:03 -08:00
|
|
|
|
|
2025-01-25 23:32:12 -08:00
|
|
|
= note: cannot match inherited `&` with `&mut` pattern
|
|
|
|
|
help: replace this `&mut` pattern with `&`
|
2025-01-22 23:59:03 -08:00
|
|
|
|
|
|
|
|
|
LL - let &[&mut ref x] = &&mut [0];
|
2025-01-25 23:32:12 -08:00
|
|
|
LL + let &[&ref x] = &&mut [0];
|
2025-01-22 23:59:03 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
2025-01-25 23:32:12 -08:00
|
|
|
--> $DIR/pattern-errors.rs:82:11
|
2025-01-22 23:59:03 -08:00
|
|
|
|
|
|
|
|
|
LL | let &[&mut ref x] = &mut &mut [0];
|
2025-01-25 23:32:12 -08:00
|
|
|
| ^^^^^
|
2025-01-22 23:59:03 -08:00
|
|
|
|
|
2025-01-25 23:32:12 -08:00
|
|
|
= note: cannot match inherited `&` with `&mut` pattern
|
|
|
|
|
help: replace this `&mut` pattern with `&`
|
2025-01-22 23:59:03 -08:00
|
|
|
|
|
|
|
|
|
LL - let &[&mut ref x] = &mut &mut [0];
|
2025-01-25 23:32:12 -08:00
|
|
|
LL + let &[&ref x] = &mut &mut [0];
|
2025-01-22 23:59:03 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
2025-01-25 23:32:12 -08:00
|
|
|
--> $DIR/pattern-errors.rs:88:11
|
2025-01-22 23:59:03 -08:00
|
|
|
|
|
|
|
|
|
LL | let &[&mut mut x] = &&mut [0];
|
2025-01-25 23:32:12 -08:00
|
|
|
| ^^^^^
|
2025-01-22 23:59:03 -08:00
|
|
|
|
|
2025-01-25 23:32:12 -08:00
|
|
|
= note: cannot match inherited `&` with `&mut` pattern
|
|
|
|
|
help: replace this `&mut` pattern with `&`
|
2025-01-22 23:59:03 -08:00
|
|
|
|
|
|
|
|
|
LL - let &[&mut mut x] = &&mut [0];
|
2025-01-25 23:32:12 -08:00
|
|
|
LL + let &[&mut x] = &&mut [0];
|
2025-01-22 23:59:03 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
2025-01-25 23:32:12 -08:00
|
|
|
--> $DIR/pattern-errors.rs:94:11
|
2025-01-22 23:59:03 -08:00
|
|
|
|
|
|
|
|
|
LL | let &[&mut mut x] = &mut &mut [0];
|
2025-01-25 23:32:12 -08:00
|
|
|
| ^^^^^
|
2025-01-22 23:59:03 -08:00
|
|
|
|
|
2025-01-25 23:32:12 -08:00
|
|
|
= note: cannot match inherited `&` with `&mut` pattern
|
|
|
|
|
help: replace this `&mut` pattern with `&`
|
2025-01-22 23:59:03 -08:00
|
|
|
|
|
|
|
|
|
LL - let &[&mut mut x] = &mut &mut [0];
|
2025-01-25 23:32:12 -08:00
|
|
|
LL + let &[&mut x] = &mut &mut [0];
|
2025-01-22 23:59:03 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
2025-01-25 23:32:12 -08:00
|
|
|
--> $DIR/pattern-errors.rs:114:11
|
2025-01-22 23:59:03 -08:00
|
|
|
|
|
|
|
|
|
LL | let [&&mut x] = &[&mut 0];
|
|
|
|
|
| ^^^^^^ --------- this expression has type `&[&mut {integer}; 1]`
|
|
|
|
|
| |
|
|
|
|
|
| expected integer, found `&mut _`
|
|
|
|
|
|
|
|
|
|
|
= note: expected type `{integer}`
|
|
|
|
|
found mutable reference `&mut _`
|
|
|
|
|
help: consider removing `&mut` from the pattern
|
|
|
|
|
|
|
|
|
|
|
LL - let [&&mut x] = &[&mut 0];
|
|
|
|
|
LL + let [&x] = &[&mut 0];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
2025-01-25 23:32:12 -08:00
|
|
|
--> $DIR/pattern-errors.rs:121:11
|
2025-01-22 23:59:03 -08:00
|
|
|
|
|
|
|
|
|
LL | let [&&mut x] = &mut [&mut 0];
|
|
|
|
|
| ^^^^^^ ------------- this expression has type `&mut [&mut {integer}; 1]`
|
|
|
|
|
| |
|
|
|
|
|
| expected integer, found `&mut _`
|
|
|
|
|
|
|
|
|
|
|
= note: expected type `{integer}`
|
|
|
|
|
found mutable reference `&mut _`
|
|
|
|
|
help: consider removing `&mut` from the pattern
|
|
|
|
|
|
|
|
|
|
|
LL - let [&&mut x] = &mut [&mut 0];
|
|
|
|
|
LL + let [&x] = &mut [&mut 0];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
2025-01-25 23:32:12 -08:00
|
|
|
--> $DIR/pattern-errors.rs:128:11
|
2025-01-22 23:59:03 -08:00
|
|
|
|
|
|
|
|
|
LL | let [&&mut ref x] = &[&mut 0];
|
|
|
|
|
| ^^^^^^^^^^ --------- this expression has type `&[&mut {integer}; 1]`
|
|
|
|
|
| |
|
|
|
|
|
| expected integer, found `&mut _`
|
|
|
|
|
|
|
|
|
|
|
= note: expected type `{integer}`
|
|
|
|
|
found mutable reference `&mut _`
|
|
|
|
|
help: consider removing `&mut` from the pattern
|
|
|
|
|
|
|
|
|
|
|
LL - let [&&mut ref x] = &[&mut 0];
|
|
|
|
|
LL + let [&ref x] = &[&mut 0];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
2025-01-25 23:32:12 -08:00
|
|
|
--> $DIR/pattern-errors.rs:135:11
|
2025-01-22 23:59:03 -08:00
|
|
|
|
|
|
|
|
|
LL | let [&&mut ref x] = &mut [&mut 0];
|
|
|
|
|
| ^^^^^^^^^^ ------------- this expression has type `&mut [&mut {integer}; 1]`
|
|
|
|
|
| |
|
|
|
|
|
| expected integer, found `&mut _`
|
|
|
|
|
|
|
|
|
|
|
= note: expected type `{integer}`
|
|
|
|
|
found mutable reference `&mut _`
|
|
|
|
|
help: consider removing `&mut` from the pattern
|
|
|
|
|
|
|
|
|
|
|
LL - let [&&mut ref x] = &mut [&mut 0];
|
|
|
|
|
LL + let [&ref x] = &mut [&mut 0];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
2025-01-25 23:32:12 -08:00
|
|
|
--> $DIR/pattern-errors.rs:142:11
|
2025-01-22 23:59:03 -08:00
|
|
|
|
|
|
|
|
|
LL | let [&&mut mut x] = &[&mut 0];
|
|
|
|
|
| ^^^^^^^^^^ --------- this expression has type `&[&mut {integer}; 1]`
|
|
|
|
|
| |
|
|
|
|
|
| expected integer, found `&mut _`
|
|
|
|
|
|
|
|
|
|
|
= note: expected type `{integer}`
|
|
|
|
|
found mutable reference `&mut _`
|
|
|
|
|
help: consider removing `&mut` from the pattern
|
|
|
|
|
|
|
|
|
|
|
LL - let [&&mut mut x] = &[&mut 0];
|
|
|
|
|
LL + let [&mut x] = &[&mut 0];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
2025-01-25 23:32:12 -08:00
|
|
|
--> $DIR/pattern-errors.rs:149:11
|
2025-01-22 23:59:03 -08:00
|
|
|
|
|
|
|
|
|
LL | let [&&mut mut x] = &mut [&mut 0];
|
|
|
|
|
| ^^^^^^^^^^ ------------- this expression has type `&mut [&mut {integer}; 1]`
|
|
|
|
|
| |
|
|
|
|
|
| expected integer, found `&mut _`
|
|
|
|
|
|
|
|
|
|
|
= note: expected type `{integer}`
|
|
|
|
|
found mutable reference `&mut _`
|
|
|
|
|
help: consider removing `&mut` from the pattern
|
|
|
|
|
|
|
|
|
|
|
LL - let [&&mut mut x] = &mut [&mut 0];
|
|
|
|
|
LL + let [&mut x] = &mut [&mut 0];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
2025-01-25 23:32:12 -08:00
|
|
|
--> $DIR/pattern-errors.rs:164:15
|
2025-01-22 23:59:03 -08:00
|
|
|
|
|
|
|
|
|
LL | let [&mut &x] = &[&mut 0];
|
|
|
|
|
| ^^ --------- this expression has type `&[&mut {integer}; 1]`
|
|
|
|
|
| |
|
|
|
|
|
| expected integer, found `&_`
|
|
|
|
|
|
|
|
|
|
|
= note: expected type `{integer}`
|
|
|
|
|
found reference `&_`
|
|
|
|
|
help: consider removing `&` from the pattern
|
|
|
|
|
|
|
|
|
|
|
LL - let [&mut &x] = &[&mut 0];
|
|
|
|
|
LL + let [&mut x] = &[&mut 0];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
2025-01-25 23:32:12 -08:00
|
|
|
--> $DIR/pattern-errors.rs:170:15
|
2025-01-22 23:59:03 -08:00
|
|
|
|
|
|
|
|
|
LL | let [&mut &ref x] = &[&mut 0];
|
|
|
|
|
| ^^^^^^ --------- this expression has type `&[&mut {integer}; 1]`
|
|
|
|
|
| |
|
|
|
|
|
| expected integer, found `&_`
|
|
|
|
|
|
|
|
|
|
|
= note: expected type `{integer}`
|
|
|
|
|
found reference `&_`
|
|
|
|
|
help: consider removing `&` from the pattern
|
|
|
|
|
|
|
|
|
|
|
LL - let [&mut &ref x] = &[&mut 0];
|
|
|
|
|
LL + let [&mut ref x] = &[&mut 0];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
2025-01-25 23:32:12 -08:00
|
|
|
--> $DIR/pattern-errors.rs:176:15
|
2025-01-22 23:59:03 -08:00
|
|
|
|
|
|
|
|
|
LL | let [&mut &(mut x)] = &[&mut 0];
|
|
|
|
|
| ^^^^^^^^ --------- this expression has type `&[&mut {integer}; 1]`
|
|
|
|
|
| |
|
|
|
|
|
| expected integer, found `&_`
|
|
|
|
|
|
|
|
|
|
|
= note: expected type `{integer}`
|
|
|
|
|
found reference `&_`
|
|
|
|
|
help: consider removing `&` from the pattern
|
|
|
|
|
|
|
|
|
|
|
LL - let [&mut &(mut x)] = &[&mut 0];
|
|
|
|
|
LL + let [&mut mut x)] = &[&mut 0];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
error: aborting due to 21 previous errors
|
|
|
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0308`.
|