aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust
diff options
context:
space:
mode:
authorKushal Pal <kushalpal109@gmail.com>2024-01-06 11:29:14 +0530
committerArthur Cohen <arthur.cohen@embecosm.com>2024-01-30 12:36:51 +0100
commit7a0c487d2c54b3cf3a83563add89a87220a109c2 (patch)
tree327c15489bb5c3a739c4562df5091fe6d7536969 /gcc/testsuite/rust
parentf7c8a712be233f492b21bb1a4c4a3aa5f07b184b (diff)
downloadgcc-7a0c487d2c54b3cf3a83563add89a87220a109c2.zip
gcc-7a0c487d2c54b3cf3a83563add89a87220a109c2.tar.gz
gcc-7a0c487d2c54b3cf3a83563add89a87220a109c2.tar.bz2
gccrs: Handle `async` keyword for regular implementations
Fixes #2788 gcc/rust/ChangeLog: * parse/rust-parse-impl.h (Parser::parse_inherent_impl_item): Added switch-case for ASYNC token. gcc/testsuite/ChangeLog: * rust/compile/issue-2788.rs: New test. Signed-off-by: Kushal Pal <kushalpal109@gmail.com>
Diffstat (limited to 'gcc/testsuite/rust')
-rw-r--r--gcc/testsuite/rust/compile/issue-2788.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/testsuite/rust/compile/issue-2788.rs b/gcc/testsuite/rust/compile/issue-2788.rs
new file mode 100644
index 0000000..b3828fc
--- /dev/null
+++ b/gcc/testsuite/rust/compile/issue-2788.rs
@@ -0,0 +1,10 @@
+// { dg-additional-options "-frust-compile-until=lowering" }
+struct Foo {
+ arg_1: u32,
+ arg_2: i32,
+}
+
+impl Foo {
+ async fn asynchronous_function_1(&self) {}
+ async fn asynchronous_function_2() {}
+}