2021-02-21 04:29:43 -06: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 13:22:47 -05:00
|
|
|
| | ^ expected `usize`, found `&usize`
|
2021-02-21 04:29:43 -06:00
|
|
|
LL | | };
|
|
|
|
| |_____- `if` and `else` have incompatible types
|
2021-06-28 13:22:47 -05:00
|
|
|
|
|
|
|
|
help: consider dereferencing the borrow
|
|
|
|
|
|
|
|
|
LL | *b
|
|
|
|
| ^
|
2021-02-21 04:29:43 -06: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 13:22:47 -05:00
|
|
|
| | ^^ expected integer, found `&{integer}`
|
2021-02-21 04:29:43 -06:00
|
|
|
LL | | };
|
|
|
|
| |_____- `if` and `else` have incompatible types
|
2021-06-28 13:22:47 -05:00
|
|
|
|
|
|
|
|
help: consider removing the borrow
|
|
|
|
|
|
|
|
|
LL | 1
|
|
|
|
| --
|
2021-02-21 04:29:43 -06: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 13:22:47 -05:00
|
|
|
| | ^^^^^^ expected integer, found `&mut {integer}`
|
2021-02-21 04:29:43 -06:00
|
|
|
LL | | };
|
|
|
|
| |_____- `if` and `else` have incompatible types
|
2021-06-28 13:22:47 -05:00
|
|
|
|
|
|
|
|
help: consider removing the borrow
|
|
|
|
|
|
|
|
|
LL | 1
|
|
|
|
| --
|
2021-02-21 04:29:43 -06:00
|
|
|
|
|
|
|
error: aborting due to 3 previous errors
|
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0308`.
|