aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/checks/errors/rust-ast-validation.h
diff options
context:
space:
mode:
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>2023-11-08 16:50:50 +0100
committerArthur Cohen <arthur.cohen@embecosm.com>2024-01-16 19:13:13 +0100
commit93ca83c5efd6908b6c5602642004d0364bf9144b (patch)
tree8461fd36bb771bcbb409eb9a23432324811d6ac1 /gcc/rust/checks/errors/rust-ast-validation.h
parentea59190d54612f9f0e09c77a0601023ef43f861d (diff)
downloadgcc-93ca83c5efd6908b6c5602642004d0364bf9144b.zip
gcc-93ca83c5efd6908b6c5602642004d0364bf9144b.tar.gz
gcc-93ca83c5efd6908b6c5602642004d0364bf9144b.tar.bz2
gccrs: Add validation pass for label name
Prevent from using reserved keyword in label name. gcc/rust/ChangeLog: * ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Check if there is a label before visit. * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Emit an error when a label has a forbidden name. * checks/errors/rust-ast-validation.h: Add function prototype. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Diffstat (limited to 'gcc/rust/checks/errors/rust-ast-validation.h')
-rw-r--r--gcc/rust/checks/errors/rust-ast-validation.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/rust/checks/errors/rust-ast-validation.h b/gcc/rust/checks/errors/rust-ast-validation.h
index ef0b2ac..a21bcc4 100644
--- a/gcc/rust/checks/errors/rust-ast-validation.h
+++ b/gcc/rust/checks/errors/rust-ast-validation.h
@@ -35,6 +35,7 @@ public:
virtual void visit (AST::ConstantItem &const_item);
virtual void visit (AST::Lifetime &lifetime);
+ virtual void visit (AST::LoopLabel &label);
};
} // namespace Rust