aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>2023-11-07 19:13:57 +0100
committerP-E-P <32375388+P-E-P@users.noreply.github.com>2023-11-14 18:27:16 +0000
commit0789030ed463d0f0d7b5dcee2b598e1d8014bce0 (patch)
treeffc6b0b95c6e54e9363c5db78fef4af661712fb7 /gcc
parentafbc038914ccaf8fcc97815846926760e7b23d55 (diff)
downloadgcc-0789030ed463d0f0d7b5dcee2b598e1d8014bce0.zip
gcc-0789030ed463d0f0d7b5dcee2b598e1d8014bce0.tar.gz
gcc-0789030ed463d0f0d7b5dcee2b598e1d8014bce0.tar.bz2
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>
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/rust/compile/lifetime_name_validation.rs6
1 files changed, 6 insertions, 0 deletions
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 0000000..2d67bd6
--- /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" }