]> gcc.gnu.org Git - gcc.git/commit
gccrs: Emit an error on unsafe modules
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Tue, 21 Nov 2023 17:51:21 +0000 (18:51 +0100)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 30 Jan 2024 11:36:47 +0000 (12:36 +0100)
commit5959f32d28ff76b3e9c177914f034aae72c9a835
treec6f3c8d87bc2277341d1101a1978d6daca69cbf1
parentd6a0d96559b30ffac3dba5be675272f0d8e12a1e
gccrs: Emit an error on unsafe modules

An error should be emitted on unsafe modules during the AST validation
pass as the syntax allows those even though they're not alowed later down
the line.

gcc/rust/ChangeLog:

* ast/rust-item.h: Add safety getter to modules.
* checks/errors/rust-ast-validation.cc (ASTValidation::visit): Check
a module's safety and emit an error when meeting an unsafe module.
* checks/errors/rust-ast-validation.h: Add function prototype.
* parse/rust-parse-impl.h (Parser::parse_module): Move the module locus
to the first token instead of the mod keyword.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
gcc/rust/ast/rust-item.h
gcc/rust/checks/errors/rust-ast-validation.cc
gcc/rust/checks/errors/rust-ast-validation.h
gcc/rust/parse/rust-parse-impl.h
This page took 0.058702 seconds and 5 git commands to generate.