summaryrefslogtreecommitdiffstats
path: root/src/test/ui/rfc-2497-if-let-chains/chains-without-let.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/rfc-2497-if-let-chains/chains-without-let.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/test/ui/rfc-2497-if-let-chains/chains-without-let.rs b/src/test/ui/rfc-2497-if-let-chains/chains-without-let.rs
new file mode 100644
index 000000000..e0dded152
--- /dev/null
+++ b/src/test/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() {
+}