os-rust/tests/ui/lazy-and-or.rs

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

13 lines
310 B
Rust
Raw Normal View History

// run-pass
fn incr(x: &mut isize) -> bool { *x += 1; assert!((false)); return false; }
2010-06-23 21:03:09 -07:00
pub fn main() {
2015-01-25 22:05:03 +01:00
let x = 1 == 2 || 3 == 3;
2013-03-28 18:39:09 -07:00
assert!((x));
let mut y: isize = 10;
2014-10-14 21:07:11 -04:00
println!("{}", x || incr(&mut y));
assert_eq!(y, 10);
2013-03-28 18:39:09 -07:00
if true && x { assert!((true)); } else { assert!((false)); }
}