blob: c068f6d22b47695a203bb56fbb493840c6945f19 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
// run-rustfix
fn main() {
let a: usize = 123;
let b: &usize = &a;
if true {
a
} else {
b //~ ERROR `if` and `else` have incompatible types [E0308]
};
if true {
1
} else {
&1 //~ ERROR `if` and `else` have incompatible types [E0308]
};
if true {
1
} else {
&mut 1 //~ ERROR `if` and `else` have incompatible types [E0308]
};
}
|