[gcc r14-8136] gccrs: Add regression test for lifetime name validation

Arthur Cohen cohenarthur@gcc.gnu.org
Tue Jan 16 18:16:45 GMT 2024


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

commit r14-8136-gff82ac5541641d836f145833b66765aa70ee8dc7
Author: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Date:   Tue Nov 7 19:13:57 2023 +0100

    gccrs: Add regression test for lifetime name validation
    
    Lifetime name are restricted and cannot be keyword, this commit add a
    test failing the ast validation pass due to some keyword name.
    
    gcc/testsuite/ChangeLog:
    
            * rust/compile/lifetime_name_validation.rs: New test.
    
    Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>

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

diff --git a/gcc/testsuite/rust/compile/lifetime_name_validation.rs b/gcc/testsuite/rust/compile/lifetime_name_validation.rs
new file mode 100644
index 00000000000..2d67bd6ee78
--- /dev/null
+++ b/gcc/testsuite/rust/compile/lifetime_name_validation.rs
@@ -0,0 +1,6 @@
+pub fn one<'continue>() {} // { dg-error "lifetimes cannot use keyword names" }
+pub fn two<'_>() {}
+
+pub fn three<'static>() {}
+
+pub fn four<'loop>() {} // { dg-error "lifetimes cannot use keyword names" }


More information about the Gcc-cvs mailing list