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:17
|
LL | if let Some(&Some(&mut x)) = &Some(&mut Some(0)) {
| ^^^^^^^^^^^^^ ------------------- this expression has type `&Option<&mut Option<{integer}>>`
| |
| types differ in mutability
|
= note: expected mutable reference `&mut Option<{integer}>`
found reference `&_`
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
--> $DIR/pattern-errors.rs:50:17
|
LL | if let Some(&Some(Some(&mut x))) = &Some(Some(&mut Some(0))) {
| ^^^^^^^^^^^^^^^^^^^ ------------------------- this expression has type `&Option