summaryrefslogtreecommitdiffstats
path: root/tests/ui/rfc-2497-if-let-chains/ast-lowering-does-not-wrap-let-chains.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/rfc-2497-if-let-chains/ast-lowering-does-not-wrap-let-chains.rs')
-rw-r--r--tests/ui/rfc-2497-if-let-chains/ast-lowering-does-not-wrap-let-chains.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/ui/rfc-2497-if-let-chains/ast-lowering-does-not-wrap-let-chains.rs b/tests/ui/rfc-2497-if-let-chains/ast-lowering-does-not-wrap-let-chains.rs
new file mode 100644
index 000000000..d851fac8e
--- /dev/null
+++ b/tests/ui/rfc-2497-if-let-chains/ast-lowering-does-not-wrap-let-chains.rs
@@ -0,0 +1,16 @@
+// run-pass
+
+#![feature(let_chains)]
+#![allow(irrefutable_let_patterns)]
+
+fn main() {
+ let first = Some(1);
+ let second = Some(2);
+ let mut n = 0;
+ if let x = first && let y = second && 1 == 1 {
+ assert_eq!(x, first);
+ assert_eq!(y, second);
+ n = 1;
+ }
+ assert_eq!(n, 1);
+}