summaryrefslogtreecommitdiffstats
path: root/tests/ui/rfc-2497-if-let-chains/chains-without-let.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/rfc-2497-if-let-chains/chains-without-let.rs')
-rw-r--r--tests/ui/rfc-2497-if-let-chains/chains-without-let.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/ui/rfc-2497-if-let-chains/chains-without-let.rs b/tests/ui/rfc-2497-if-let-chains/chains-without-let.rs
new file mode 100644
index 000000000..e0dded152
--- /dev/null
+++ b/tests/ui/rfc-2497-if-let-chains/chains-without-let.rs
@@ -0,0 +1,20 @@
+fn and_chain() {
+ let z;
+ if true && { z = 3; true} && z == 3 {}
+ //~^ ERROR E0381
+}
+
+fn and_chain_2() {
+ let z;
+ true && { z = 3; true} && z == 3;
+ //~^ ERROR E0381
+}
+
+fn or_chain() {
+ let z;
+ if false || { z = 3; false} || z == 3 {}
+ //~^ ERROR E0381
+}
+
+fn main() {
+}