https://gcc.gnu.org/g:5210b2b07cc42b6f090ca981484ab164f7abf287
commit 5210b2b07cc42b6f090ca981484ab164f7abf287
Author: Pierre-Emmanuel Patry <pierre-emmanuel.pa...@embecosm.com>
Date:   Wed Nov 22 11:12:05 2023 +0100

    Add a regression test for async const functions
    
    Functions that are both async and const shall be rejected during the
    AST validation pass. This new test highlight this behavior.
    
    gcc/testsuite/ChangeLog:
    
            * rust/compile/const_async_function.rs: New test.
    
    Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.pa...@embecosm.com>

Diff:
---
 gcc/testsuite/rust/compile/const_async_function.rs | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gcc/testsuite/rust/compile/const_async_function.rs 
b/gcc/testsuite/rust/compile/const_async_function.rs
new file mode 100644
index 000000000000..fb1c4dd4c1d7
--- /dev/null
+++ b/gcc/testsuite/rust/compile/const_async_function.rs
@@ -0,0 +1,3 @@
+// { dg-additional-options "-frust-edition=2018" }
+const async fn weird_function() {}
+// { dg-error "functions cannot be both .const. and .async." "" { target *-*-* 
} .-1 }

Reply via email to