Skip to content

Commit f397d55

Browse files
committed
let_chains: Add test protecting the precedence of && in relation to other things.
1 parent 170c8a8 commit f397d55

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// run-pass
2+
3+
#![allow(irrefutable_let_patterns)]
4+
5+
use std::ops::Range;
6+
7+
fn main() {
8+
let x: bool;
9+
// This should associate as: `(x = (true && false));`.
10+
x = true && false;
11+
assert!(!x);
12+
13+
fn _f1() -> bool {
14+
// Should associate as `(let _ = (return (true && false)))`.
15+
if let _ = return true && false {};
16+
}
17+
assert!(!_f1());
18+
}

0 commit comments

Comments
 (0)