about summary refs log tree commit diff
path: root/tests/ui/parser/assoc-oddities-1.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/parser/assoc-oddities-1.rs')
-rw-r--r--tests/ui/parser/assoc-oddities-1.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/ui/parser/assoc-oddities-1.rs b/tests/ui/parser/assoc-oddities-1.rs
new file mode 100644
index 00000000000..5914805e5c1
--- /dev/null
+++ b/tests/ui/parser/assoc-oddities-1.rs
@@ -0,0 +1,11 @@
+// compile-flags: -Z parse-only
+
+fn main() {
+    // following lines below parse and must not fail
+    x = if c { a } else { b }();
+    x = if true { 1 } else { 0 } as *mut _;
+    // however this does not parse and probably should fail to retain compat?
+    // N.B., `..` here is arbitrary, failure happens/should happen ∀ops that aren’t `=`
+    // see assoc-oddities-2 and assoc-oddities-3
+    ..if c { a } else { b }[n]; //~ ERROR expected one of
+}