blob: 8b32e4f7c0233fbaf3a248a542fbf72f7b4d6344 [file] [log] [blame] [edit]
error[E0308]: mismatched types
--> $DIR/pattern-errors.rs:22: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:35: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:40: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:47: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:52:17
|
LL | if let Some(&Some(Some(&mut x))) = &Some(Some(&mut Some(0))) {
| ^^^^^^^^^^^^^^^^^^^ ------------------------- this expression has type `&Option<Option<&mut Option<{integer}>>>`
| |
| expected `Option<&mut Option<{integer}>>`, found `&_`
|
= note: expected enum `Option<&mut Option<{integer}>>`
found reference `&_`
error[E0308]: mismatched types
--> $DIR/pattern-errors.rs:58:17
|
LL | if let Some(&mut Some(x)) = &Some(Some(0)) {
| ^^^^^^^^^^^^ -------------- this expression has type `&Option<Option<{integer}>>`
| |
| expected `Option<{integer}>`, found `&mut _`
|
= note: expected enum `Option<{integer}>`
found mutable reference `&mut _`
error[E0308]: mismatched types
--> $DIR/pattern-errors.rs:66:11
|
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 _`
note: to declare a mutable binding use: `mut x`
--> $DIR/pattern-errors.rs:66:11
|
LL | let &[&mut x] = &&mut [0];
| ^^^^^^
help: consider removing `&mut` from the pattern
|
LL - let &[&mut x] = &&mut [0];
LL + let &[x] = &&mut [0];
|
error[E0308]: mismatched types
--> $DIR/pattern-errors.rs:72:9
|
LL | let &[&mut x] = &mut &mut [0];
| ^^^^^^^^^ ------------- this expression has type `&mut &mut [{integer}; 1]`
| |
| types differ in mutability
|
= note: expected mutable reference `&mut &mut [{integer}; 1]`
found reference `&_`
error[E0308]: mismatched types
--> $DIR/pattern-errors.rs:78:11
|
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 _`
note: to declare a mutable binding use: `mut x`
--> $DIR/pattern-errors.rs:78:11
|
LL | let &[&mut ref x] = &&mut [0];
| ^^^^^^^^^^
help: consider removing `&mut` from the pattern
|
LL - let &[&mut ref x] = &&mut [0];
LL + let &[ref x] = &&mut [0];
|
error[E0308]: mismatched types
--> $DIR/pattern-errors.rs:84:9
|
LL | let &[&mut ref x] = &mut &mut [0];
| ^^^^^^^^^^^^^ ------------- this expression has type `&mut &mut [{integer}; 1]`
| |
| types differ in mutability
|
= note: expected mutable reference `&mut &mut [{integer}; 1]`
found reference `&_`
error[E0308]: mismatched types
--> $DIR/pattern-errors.rs:90:11
|
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 _`
note: to declare a mutable binding use: `mut x`
--> $DIR/pattern-errors.rs:90:11
|
LL | let &[&mut mut x] = &&mut [0];
| ^^^^^^^^^^
help: consider removing `&mut` from the pattern
|
LL - let &[&mut mut x] = &&mut [0];
LL + let &[mut x] = &&mut [0];
|
error[E0308]: mismatched types
--> $DIR/pattern-errors.rs:96:9
|
LL | let &[&mut mut x] = &mut &mut [0];
| ^^^^^^^^^^^^^ ------------- this expression has type `&mut &mut [{integer}; 1]`
| |
| types differ in mutability
|
= note: expected mutable reference `&mut &mut [{integer}; 1]`
found reference `&_`
error[E0308]: mismatched types
--> $DIR/pattern-errors.rs:116:10
|
LL | let [&&mut x] = &[&mut 0];
| ^^^^^^^ --------- this expression has type `&[&mut {integer}; 1]`
| |
| types differ in mutability
|
= note: expected mutable reference `&mut {integer}`
found reference `&_`
error[E0308]: mismatched types
--> $DIR/pattern-errors.rs:123:10
|
LL | let [&&mut x] = &mut [&mut 0];
| ^^^^^^^ ------------- this expression has type `&mut [&mut {integer}; 1]`
| |
| types differ in mutability
|
= note: expected mutable reference `&mut {integer}`
found reference `&_`
error[E0308]: mismatched types
--> $DIR/pattern-errors.rs:130:10
|
LL | let [&&mut ref x] = &[&mut 0];
| ^^^^^^^^^^^ --------- this expression has type `&[&mut {integer}; 1]`
| |
| types differ in mutability
|
= note: expected mutable reference `&mut {integer}`
found reference `&_`
error[E0308]: mismatched types
--> $DIR/pattern-errors.rs:137:10
|
LL | let [&&mut ref x] = &mut [&mut 0];
| ^^^^^^^^^^^ ------------- this expression has type `&mut [&mut {integer}; 1]`
| |
| types differ in mutability
|
= note: expected mutable reference `&mut {integer}`
found reference `&_`
error[E0308]: mismatched types
--> $DIR/pattern-errors.rs:144:10
|
LL | let [&&mut mut x] = &[&mut 0];
| ^^^^^^^^^^^ --------- this expression has type `&[&mut {integer}; 1]`
| |
| types differ in mutability
|
= note: expected mutable reference `&mut {integer}`
found reference `&_`
error[E0308]: mismatched types
--> $DIR/pattern-errors.rs:151:10
|
LL | let [&&mut mut x] = &mut [&mut 0];
| ^^^^^^^^^^^ ------------- this expression has type `&mut [&mut {integer}; 1]`
| |
| types differ in mutability
|
= note: expected mutable reference `&mut {integer}`
found reference `&_`
error[E0308]: mismatched types
--> $DIR/pattern-errors.rs:166:15
|
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
--> $DIR/pattern-errors.rs:172:15
|
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
--> $DIR/pattern-errors.rs:178:15
|
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`.