about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/parser/builtin-syntax.rs7
-rw-r--r--tests/ui/parser/builtin-syntax.stderr14
2 files changed, 21 insertions, 0 deletions
diff --git a/tests/ui/parser/builtin-syntax.rs b/tests/ui/parser/builtin-syntax.rs
new file mode 100644
index 00000000000..c0b91a58073
--- /dev/null
+++ b/tests/ui/parser/builtin-syntax.rs
@@ -0,0 +1,7 @@
+fn main() {
+    builtin # foobar(); //~ ERROR unknown `builtin #` construct
+}
+
+fn not_identifier() {
+    builtin # {}(); //~ ERROR expected identifier after
+}
diff --git a/tests/ui/parser/builtin-syntax.stderr b/tests/ui/parser/builtin-syntax.stderr
new file mode 100644
index 00000000000..2679049fb5e
--- /dev/null
+++ b/tests/ui/parser/builtin-syntax.stderr
@@ -0,0 +1,14 @@
+error: unknown `builtin #` construct `foobar`
+  --> $DIR/builtin-syntax.rs:2:5
+   |
+LL |     builtin # foobar();
+   |     ^^^^^^^^^^^^^^^^
+
+error: expected identifier after `builtin #`
+  --> $DIR/builtin-syntax.rs:6:15
+   |
+LL |     builtin # {}();
+   |               ^
+
+error: aborting due to 2 previous errors
+