about summary refs log tree commit diff
path: root/tests/ui/proc-macro/edition-gated-async-move-syntax-issue89699.rs
diff options
context:
space:
mode:
authorArthur Cohen <arthur.cohen@embecosm.com>2023-11-07 13:17:00 +0100
committerArthur Cohen <arthur.cohen@embecosm.com>2023-11-20 13:15:08 +0100
commitfd70a4ca1741d1147ba2288d909857566598efee (patch)
treef13c0a5ce7547e2abe779cf1871637fda79ba900 /tests/ui/proc-macro/edition-gated-async-move-syntax-issue89699.rs
parent19079cf804330a0d3d767a19a935c5eebdfeba0f (diff)
downloadrust-fd70a4ca1741d1147ba2288d909857566598efee.tar.gz
rust-fd70a4ca1741d1147ba2288d909857566598efee.zip
test: Add test for async-move in 2015 Rust proc macro
Add a test to ensure issue #89699 does not show up again. This test
emits an `async move` closure in a proc macro, which is used in a
test program compiled with edition 2015. We make sure the error message
is nice and shows up properly.
Diffstat (limited to 'tests/ui/proc-macro/edition-gated-async-move-syntax-issue89699.rs')
-rw-r--r--tests/ui/proc-macro/edition-gated-async-move-syntax-issue89699.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/ui/proc-macro/edition-gated-async-move-syntax-issue89699.rs b/tests/ui/proc-macro/edition-gated-async-move-syntax-issue89699.rs
new file mode 100644
index 00000000000..1a9d4601aca
--- /dev/null
+++ b/tests/ui/proc-macro/edition-gated-async-move-syntax-issue89699.rs
@@ -0,0 +1,10 @@
+// aux-build:edition-gated-async-move-syntax.rs
+// edition: 2015
+
+// Non-regression test for issue #89699, where a proc-macro emitting syntax only available in
+// edition 2018 and up (`async move`) is used on edition 2015
+
+extern crate edition_gated_async_move_syntax;
+
+#[edition_gated_async_move_syntax::foo]
+fn foo() {} //~ ERROR `async move` blocks are only allowed in Rust 2018 or later