2021-02-21 10:29:43 +00:00
|
|
|
error[E0308]: `if` and `else` have incompatible types
|
|
|
|
--> $DIR/issue-82361.rs:10:9
|
|
|
|
|
|
|
|
|
LL | / if true {
|
|
|
|
LL | | a
|
|
|
|
| | - expected because of this
|
|
|
|
LL | | } else {
|
|
|
|
LL | | b
|
2021-06-28 18:22:47 +00:00
|
|
|
| | ^ expected `usize`, found `&usize`
|
2021-02-21 10:29:43 +00:00
|
|
|
LL | | };
|
|
|
|
| |_____- `if` and `else` have incompatible types
|
2021-06-28 18:22:47 +00:00
|
|
|
|
|
|
|
|
help: consider dereferencing the borrow
|
|
|
|
|
|
|
|
|
LL | *b
|
2021-06-22 02:07:19 +00:00
|
|
|
| +
|
2021-02-21 10:29:43 +00:00
|
|
|
|
|
|
|
error[E0308]: `if` and `else` have incompatible types
|
|
|
|
--> $DIR/issue-82361.rs:16:9
|
|
|
|
|
|
|
|
|
LL | / if true {
|
|
|
|
LL | | 1
|
|
|
|
| | - expected because of this
|
|
|
|
LL | | } else {
|
|
|
|
LL | | &1
|
2021-06-28 18:22:47 +00:00
|
|
|
| | ^^ expected integer, found `&{integer}`
|
2021-02-21 10:29:43 +00:00
|
|
|
LL | | };
|
|
|
|
| |_____- `if` and `else` have incompatible types
|
2021-06-28 18:22:47 +00:00
|
|
|
|
|
|
|
|
help: consider removing the borrow
|
|
|
|
|
|
2021-06-22 02:07:19 +00:00
|
|
|
LL - &1
|
|
|
|
LL + 1
|
2022-06-08 17:34:57 +00:00
|
|
|
|
|
2021-02-21 10:29:43 +00:00
|
|
|
|
|
|
|
error[E0308]: `if` and `else` have incompatible types
|
|
|
|
--> $DIR/issue-82361.rs:22:9
|
|
|
|
|
|
|
|
|
LL | / if true {
|
|
|
|
LL | | 1
|
|
|
|
| | - expected because of this
|
|
|
|
LL | | } else {
|
|
|
|
LL | | &mut 1
|
2021-06-28 18:22:47 +00:00
|
|
|
| | ^^^^^^ expected integer, found `&mut {integer}`
|
2021-02-21 10:29:43 +00:00
|
|
|
LL | | };
|
|
|
|
| |_____- `if` and `else` have incompatible types
|
2021-06-28 18:22:47 +00:00
|
|
|
|
|
|
|
|
help: consider removing the borrow
|
|
|
|
|
|
2021-06-22 02:07:19 +00:00
|
|
|
LL - &mut 1
|
|
|
|
LL + 1
|
2022-06-08 17:34:57 +00:00
|
|
|
|
|
2021-02-21 10:29:43 +00:00
|
|
|
|
|
|
|
error: aborting due to 3 previous errors
|
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0308`.
|