public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-8615] gccrs: Handle `async` keyword for regular implementations
@ 2024-01-30 12:02 Arthur Cohen
  0 siblings, 0 replies; only message in thread
From: Arthur Cohen @ 2024-01-30 12:02 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:7a0c487d2c54b3cf3a83563add89a87220a109c2

commit r14-8615-g7a0c487d2c54b3cf3a83563add89a87220a109c2
Author: Kushal Pal <kushalpal109@gmail.com>
Date:   Sat Jan 6 11:29:14 2024 +0530

    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>

Diff:
---
 gcc/rust/parse/rust-parse-impl.h         |  1 +
 gcc/testsuite/rust/compile/issue-2788.rs | 10 ++++++++++
 2 files changed, 11 insertions(+)

diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust/parse/rust-parse-impl.h
index 3055a3959cff..c14c75ce70dc 100644
--- a/gcc/rust/parse/rust-parse-impl.h
+++ b/gcc/rust/parse/rust-parse-impl.h
@@ -5600,6 +5600,7 @@ Parser<ManagedTokenSource>::parse_inherent_impl_item ()
 	    return nullptr;
 	  }
       }
+    case ASYNC:
     case EXTERN_KW:
     case UNSAFE:
     case FN_KW:
diff --git a/gcc/testsuite/rust/compile/issue-2788.rs b/gcc/testsuite/rust/compile/issue-2788.rs
new file mode 100644
index 000000000000..b3828fca6cb0
--- /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() {}
+}

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-01-30 12:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-30 12:02 [gcc r14-8615] gccrs: Handle `async` keyword for regular implementations Arthur Cohen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).