rust/tests/ui/binop/nested-assignment-may-be-deref.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
254 B
Rust
Raw Normal View History

pub fn bad(x: &mut bool) {
if true
*x = true {}
//~^ ERROR cannot multiply `bool` by `&mut bool`
}
pub fn bad2(x: &mut bool) {
let y: bool;
y = true
*x = true;
//~^ ERROR cannot multiply `bool` by `&mut bool`
}
fn main() {}