[gcc r14-8578] gccrs: Add a regression test for async const functions

Arthur Cohen cohenarthur@gcc.gnu.org
Tue Jan 30 11:58:50 GMT 2024


https://gcc.gnu.org/g:ac501a75b263a7dd7fa437c01aae53d41e30a515

commit r14-8578-gac501a75b263a7dd7fa437c01aae53d41e30a515
Author: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Date:   Wed Nov 22 11:12:05 2023 +0100

    gccrs: 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.patry@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 }


More information about the Gcc-cvs mailing list