2024-03-30 12:57:54 -05:00
|
|
|
error[E0308]: mismatched types
|
2024-04-02 10:54:29 -05:00
|
|
|
--> $DIR/ref_pat_everywhere-mutability-mismatch.rs:4:17
|
2024-03-30 12:57:54 -05:00
|
|
|
|
|
|
|
|
LL | if let Some(&x) = Some(0) {
|
|
|
|
| ^^ ------- this expression has type `Option<{integer}>`
|
|
|
|
| |
|
|
|
|
| expected integer, found `&_`
|
|
|
|
|
|
|
|
|
= note: expected type `{integer}`
|
|
|
|
found reference `&_`
|
|
|
|
help: consider removing `&` from the pattern
|
|
|
|
|
|
|
|
|
LL | if let Some(x) = Some(0) {
|
|
|
|
| ~
|
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
2024-04-02 10:54:29 -05:00
|
|
|
--> $DIR/ref_pat_everywhere-mutability-mismatch.rs:8:12
|
2024-03-30 12:57:54 -05:00
|
|
|
|
|
|
|
|
LL | if let &Some(x) = &mut Some(0) {
|
|
|
|
| ^^^^^^^^ ------------ this expression has type `&mut Option<{integer}>`
|
|
|
|
| |
|
|
|
|
| types differ in mutability
|
|
|
|
|
|
|
|
|
= note: expected mutable reference `&mut Option<{integer}>`
|
|
|
|
found reference `&_`
|
|
|
|
|
2024-04-02 10:54:29 -05:00
|
|
|
error[E0308]: mismatched types
|
|
|
|
--> $DIR/ref_pat_everywhere-mutability-mismatch.rs:12:17
|
|
|
|
|
|
|
|
|
LL | if let Some(&x) = &mut Some(0) {
|
|
|
|
| ^^ ------------ this expression has type `&mut Option<{integer}>`
|
|
|
|
| |
|
|
|
|
| expected integer, found `&_`
|
|
|
|
|
|
|
|
|
= note: expected type `{integer}`
|
|
|
|
found reference `&_`
|
|
|
|
help: consider removing `&` from the pattern
|
|
|
|
|
|
|
|
|
LL | if let Some(x) = &mut Some(0) {
|
|
|
|
| ~
|
|
|
|
|
|
|
|
error: aborting due to 3 previous errors
|
2024-03-30 12:57:54 -05:00
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0308`.
|