rust/tests/ui/suggestions/issue-82361.rs
2023-01-11 09:32:08 +00:00

25 lines
423 B
Rust

// 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]
};
}