[gcc/devel/rust/master] Merge #1406
Thomas Schwinge
tschwinge@gcc.gnu.org
Fri Jul 22 21:25:49 GMT 2022
https://gcc.gnu.org/g:dec7ee4c5e703422ecb9bc94417645d66af7eaae
commit dec7ee4c5e703422ecb9bc94417645d66af7eaae
Merge: 15d4bdd84a7 8dc692afc2c
Author: bors[bot] <26634292+bors[bot]@users.noreply.github.com>
Date: Fri Jul 22 13:40:06 2022 +0000
Merge #1406
1406: Add Attribute checking visitor r=CohenArthur a=CohenArthur
This PR adds a new attribute checker visitor. Its role is to take care of validating builtin attributes and their inputs.
This is currently a draft as there are multiple issues:
1. The visitor is not complete
2. The lexer is broken, but was also broken before in that it didn't allow multiline string literals. There is a FIXME asking for how to check for an `EOF` character when parsing UTF-8 strings
3. The checking of attributes is very limited. Currently, only the `#[doc(alias = "...")]` is being checked. This is incomplete.
I'm looking for feedback on the implementation and advice for my issues. Thanks :)
Co-authored-by: Arthur Cohen <arthur.cohen@embecosm.com>
Diff:
gcc/rust/hir/rust-ast-lower-base.cc | 2 +
gcc/rust/lex/rust-codepoint.h | 4 +-
gcc/rust/lex/rust-lex.cc | 49 +-
gcc/rust/rust-session-manager.cc | 3 +
gcc/rust/util/rust-attributes.cc | 767 +++++++++++++++++++++
gcc/rust/util/rust-attributes.h | 200 ++++++
.../rust/compile/torture/check-doc-attr-string.rs | 11 +-
.../rust/compile/torture/undended-string-1.rs | 5 +
.../rust/compile/torture/undended-string-2.rs | 5 +
9 files changed, 1023 insertions(+), 23 deletions(-)
More information about the Gcc-cvs
mailing list