]>
Commit | Line | Data |
---|---|---|
6a06907d XL |
1 | error[E0308]: `if` and `else` have incompatible types |
2 | --> $DIR/issue-82361.rs:10:9 | |
3 | | | |
4 | LL | / if true { | |
5 | LL | | a | |
6 | | | - expected because of this | |
7 | LL | | } else { | |
8 | LL | | b | |
94222f64 | 9 | | | ^ expected `usize`, found `&usize` |
6a06907d XL |
10 | LL | | }; |
11 | | |_____- `if` and `else` have incompatible types | |
94222f64 XL |
12 | | |
13 | help: consider dereferencing the borrow | |
14 | | | |
15 | LL | *b | |
16 | | + | |
6a06907d XL |
17 | |
18 | error[E0308]: `if` and `else` have incompatible types | |
19 | --> $DIR/issue-82361.rs:16:9 | |
20 | | | |
21 | LL | / if true { | |
22 | LL | | 1 | |
23 | | | - expected because of this | |
24 | LL | | } else { | |
25 | LL | | &1 | |
94222f64 | 26 | | | ^^ expected integer, found `&{integer}` |
6a06907d XL |
27 | LL | | }; |
28 | | |_____- `if` and `else` have incompatible types | |
94222f64 XL |
29 | | |
30 | help: consider removing the borrow | |
31 | | | |
32 | LL - &1 | |
33 | LL + 1 | |
923072b8 | 34 | | |
6a06907d XL |
35 | |
36 | error[E0308]: `if` and `else` have incompatible types | |
37 | --> $DIR/issue-82361.rs:22:9 | |
38 | | | |
39 | LL | / if true { | |
40 | LL | | 1 | |
41 | | | - expected because of this | |
42 | LL | | } else { | |
43 | LL | | &mut 1 | |
94222f64 | 44 | | | ^^^^^^ expected integer, found `&mut {integer}` |
6a06907d XL |
45 | LL | | }; |
46 | | |_____- `if` and `else` have incompatible types | |
94222f64 XL |
47 | | |
48 | help: consider removing the borrow | |
49 | | | |
50 | LL - &mut 1 | |
51 | LL + 1 | |
923072b8 | 52 | | |
6a06907d XL |
53 | |
54 | error: aborting due to 3 previous errors | |
55 | ||
56 | For more information about this error, try `rustc --explain E0308`. |