aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>2023-11-07 19:13:57 +0100
committerArthur Cohen <arthur.cohen@embecosm.com>2024-01-16 19:13:13 +0100
commitff82ac5541641d836f145833b66765aa70ee8dc7 (patch)
treec3c190a03aa35d372503205409f661c6158c6221
parentea4cd6453d3a3af501edcc97d362f7c4e9e83995 (diff)
downloadgcc-ff82ac5541641d836f145833b66765aa70ee8dc7.zip
gcc-ff82ac5541641d836f145833b66765aa70ee8dc7.tar.gz
gcc-ff82ac5541641d836f145833b66765aa70ee8dc7.tar.bz2
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>
-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" }