aboutsummaryrefslogtreecommitdiff
path: root/gcc
AgeCommit message (Collapse)AuthorFilesLines
2025-03-17gccrs: Add potentially_nonpromoted_keywords set strjjasmine3-84/+110
gcc/rust/ChangeLog: * expand/rust-macro-builtins-asm.cc (parse_reg_operand): Add potentially_nonpromoted_keywords set str (check_identifier): likewise * expand/rust-macro-builtins-asm.h (parse_format_string): likewise gcc/testsuite/ChangeLog: * rust/compile/inline_asm_parse_operand.rs: fix warnings
2025-03-17gccrs: Successful parse of in and inout, albeit with strjjasmine3-10/+130
gcc/rust/ChangeLog: * expand/rust-macro-builtins-asm.cc (parse_reg_operand): Successful parse of in and inout, albeit with str (check_identifier): Likewise. (parse_asm_arg): Likewise. * expand/rust-macro-builtins-asm.h (parse_format_string): Likewise. gcc/testsuite/ChangeLog: * rust/compile/inline_asm_parse_operand.rs: New test.
2025-03-17gccrs: Scaffolding HIRFullVisitor for inline asmjjasmine4-3/+11
gcc/rust/ChangeLog: * ast/rust-ast-visitor.h: Scaffolding HIRFullVisitor for inline asm * ast/rust-ast.cc (InlineAsm::accept_vis): Likewise. * hir/tree/rust-hir-visitor.h (RUST_HIR_VISITOR_H): Likewise. * hir/tree/rust-hir.cc (InlineAsm::accept_vis): Likewise.
2025-03-17gccrs: Scaffolding ast visitor for InlineAsmjjasmine3-1/+10
gcc/rust/ChangeLog: * ast/rust-ast-visitor.h: Scaffolding ast visitor for InlineAsm * ast/rust-ast.cc (InlineAsm::accept_vis): Likewise. * ast/rust-expr.h: Likewise.
2025-03-17gccrs: Fix warningsjjasmine2-3/+10
gcc/rust/ChangeLog: * expand/rust-macro-builtins-asm.cc (parse_reg_operand): Fix compile warnings. (parse_options): Likewise. (parse_asm): Likewise. gcc/testsuite/ChangeLog: * rust/compile/inline_asm_illegal_options.rs:
2025-03-17gccrs: Partial unsafe support for inline asmjjasmine4-2/+23
gcc/rust/ChangeLog: * checks/errors/rust-unsafe-checker.cc (UnsafeChecker::visit): Partial unsafe support for inline asm * checks/errors/rust-unsafe-checker.h: Likewise. * hir/tree/rust-hir-expr.h: Likewise. * hir/tree/rust-hir.cc (InlineAsm::accept_vis): Likewise.
2025-03-17gccrs: Add support for AST to HIR inline asm translationjjasmine6-2/+89
gcc/rust/ChangeLog: * ast/rust-expr.h: Add support for AST to HIR inline asm translation * hir/rust-ast-lower-base.cc (ASTLoweringBase::visit): Likewise. * hir/rust-ast-lower-base.h: Likewise. * hir/rust-ast-lower-expr.cc (ASTLoweringExpr::visit): Likewise. * hir/rust-ast-lower-expr.h: Likewise. * hir/tree/rust-hir-expr.h (class InlineAsm): Likewise.
2025-03-17gccrs: Slim down the test casesjjasmine5-36/+3
gcc/testsuite/ChangeLog: * rust/compile/inline_asm_faulty_clobber.rs: compress the test * rust/compile/inline_asm_nop.rs: compress the test * rust/compile/inline_asm_faulty_clobber_1.rs: Removed. * rust/compile/inline_asm_faulty_clobber_2.rs: Removed. * rust/compile/inline_asm_nop_2.rs: Removed.
2025-03-17gccrs: Refactoring for inline asm prjjasmine9-172/+142
gcc/rust/ChangeLog: * ast/rust-expr.h (struct AnonConst): major refactoring of inline asm, mostly concerns naming convention, trinary conditionals, warnings, adding rust_unreachables in not-yet supported errors. (struct InlineAsmRegOrRegClass): Likewise. (struct InlineAsmOperand): Likewise. * expand/rust-macro-builtins-asm.cc (parse_clobber_abi): Likewise. (parse_reg): Likewise. (parse_operand): Likewise. (parse_reg_operand): Likewise. (check_and_set): Likewise. (parse_options): Likewise. (parse_format_string): Likewise. (parse_asm_arg): Likewise. (parse_asm): Likewise. * expand/rust-macro-builtins-asm.h (parse_asm_arg): Likewise. (check_identifier): Likewise. (check_and_set): Likewise. (parse_operand): Likewise. (parse_reg_operand): Likewise. (parse_options): Likewise. (parse_reg): Likewise. (parse_clobber_abi): Likewise. * expand/rust-macro-builtins.cc (enum class): Likewise. (inline_asm_maker): Likewise. * checks/errors/borrowck/ffi-polonius/Cargo.lock: Removed. Likewise. gcc/testsuite/ChangeLog: * rust/compile/inline_asm_faulty_clobber.rs: Likewise. * rust/compile/inline_asm_faulty_clobber_1.rs: Likewise. * rust/compile/inline_asm_faulty_clobber_2.rs: Likewise. * rust/compile/inline_asm_illegal_options.rs: Likewise.
2025-03-17gccrs: Got AST::Fragment to be created from InlineAsmjjasmine2-10/+150
gcc/rust/ChangeLog: * ast/rust-expr.h (struct AnonConst): Got AST::Fragment to be created from InlineAsm. (struct InlineAsmOperand): Likewise. (class InlineAsm): Likewise. * expand/rust-macro-builtins-asm.cc (parse_reg_operand): Likewise. (parse_asm): likewise
2025-03-17gccrs: Working towards parse_reg and parse_reg_operandjjasmine2-13/+20
gcc/rust/ChangeLog: * expand/rust-macro-builtins-asm.cc (parse_reg): Working towards parse_reg and parse_reg_operand (parse_reg_operand): Working towards parse_reg and parse_reg_operand (parse_asm_arg): Add todo about errors * expand/rust-macro-builtins-asm.h (parse_global_asm): remove dead code. (parse_nonglobal_asm): remove dead code.
2025-03-17gccrs: Renamed parseAsmArg to conform to other function namesjjasmine2-5/+5
gcc/rust/ChangeLog: * expand/rust-macro-builtins-asm.cc (parseAsmArg): Renamed parseAsmArg to conform to other function names (parse_asm_arg): Likewise. (parse_asm): Likewise. * expand/rust-macro-builtins-asm.h (parseAsmArg): Likewise. (parse_asm_arg): Likewise.
2025-03-17gccrs: Big Refactor after meetingjjasmine3-56/+157
gcc/rust/ChangeLog: * ast/rust-expr.h (struct InlineAsmRegOrRegClass): Remove union (struct InlineAsmOperand): Make instances of inside struct. * expand/rust-macro-builtins-asm.cc (parse_clobber_abi): Change signature with inlineAsmCtx. (parse_reg): Likewise. (parse_operand): Likewise. (parse_reg_operand): Likewise. (check_and_set): Likewise. (parse_options): Likewise. (parse_format_string): Likewise. (parseAsmArg): Likewise. (parse_asm): Likewise. * expand/rust-macro-builtins-asm.h (class InlineAsmContext): Likewise. (parseAsmArg): Likewise. (check_and_set): Likewise. (parse_reg_operand): Likewise. (parse_options): Likewise. (parse_reg): Likewise. (parse_clobber_abi): Likewise.
2025-03-17gccrs: Remove global_asm and non_global_asm handlerjjasmine3-20/+23
gcc/rust/ChangeLog: * expand/rust-macro-builtins-asm.cc (MacroBuiltin::global_asm_handler): Remove global_asm and non_global_asm handler (MacroBuiltin::nonglobal_asm_handler): Likewise. (MacroBuiltin::asm_handler): Likewise. * expand/rust-macro-builtins.cc (enum class): Likewise. (inline_asm_maker): Likewise. * expand/rust-macro-builtins.h: Likewise.
2025-03-17gccrs: Safegaurd InlineAsm's clone_expr_...jjasmine1-0/+1
Safegaurd InlineAsm's clone_expr_... with unreachable since we would never use them. gcc/rust/ChangeLog: * ast/rust-expr.h: Safegaurd InlineAsm's clone_expr_... with unreachable.
2025-03-17gccrs: Rename InlineAsmOptions to InlineAsmOptionjjasmine5-27/+26
Rename InlineAsmOptions to InlineAsmOption for clarity gcc/rust/ChangeLog: * ast/rust-ast-full-decls.h (enum class): Rename InlineAsmOptions to InlineAsmOption for clarity * ast/rust-expr.h (enum class): Likewise. * expand/rust-macro-builtins-asm.cc (check_and_set): Likewise. (parse_options): Likewise. * expand/rust-macro-builtins-asm.h (check_and_set): Likewise. * hir/tree/rust-hir-expr.h: Likewise.
2025-03-17gccrs: Scaffolding parse_regjjasmine3-1/+93
gcc/rust/ChangeLog: * ast/rust-expr.h (struct InlineAsmRegOrRegClass): Scaffolding parse_reg * expand/rust-macro-builtins-asm.cc (parse_reg): Likewise. (parse_operand): Likewise. (parseAsmArg): Likewise.
2025-03-17gccrs: Resolve static decl warningjjasmine1-3/+3
gcc/rust/ChangeLog: * expand/rust-macro-builtins-asm.h (parseAsmArg): Resolve static decl warning (parse_nonglobal_asm): Resolve static decl warning
2025-03-17gccrs: Add checks for duplicate options in inline asmjjasmine2-10/+38
gcc/rust/ChangeLog: * expand/rust-macro-builtins-asm.cc (check_and_set): Add checks for duplicate options in inline asm (parse_options): likewise. gcc/testsuite/ChangeLog: * rust/compile/inline_asm_illegal_options.rs: New test.
2025-03-17gccrs: Wraps inline_asm tests in unsafe {}jjasmine6-6/+18
gcc/testsuite/ChangeLog: * rust/compile/inline_asm_faulty_clobber.rs: Wraps inline_asm tests in unsafe {} * rust/compile/inline_asm_faulty_clobber_1.rs: likewise. * rust/compile/inline_asm_faulty_clobber_2.rs: likewise. * rust/compile/inline_asm_ident_first.rs: likewise. * rust/compile/inline_asm_nop.rs: likewise. * rust/compile/inline_asm_nop_2.rs: likewise.
2025-03-17gccrs: Parsing of options(...) done.jjasmine4-18/+28
This is without any mutually exclusive options checked, or any relationship with reg_operands. Very primitive. gcc/rust/ChangeLog: * ast/rust-expr.h: parsing of options(...) * expand/rust-macro-builtins-asm.cc (check_and_set): likewise. (parse_options): likewise. (parseAsmArg): likewise. * expand/rust-macro-builtins-asm.h (check_and_set): likewise. gcc/testsuite/ChangeLog: * rust/compile/inline_asm_legal_options.rs: New test.
2025-03-17gccrs: Implemented parse_clobber_abi to pass new testsjjasmine2-23/+61
gcc/rust/ChangeLog: * expand/rust-macro-builtins-asm.cc (parse_clobber_abi): implemented parse_clobber_abi (parse_format_string): likewise. (parseAsmArg): likewise. (parse_asm): likewise. * expand/rust-macro-builtins-asm.h (parseAsmArg): likewise.
2025-03-17gccrs: Added faulty tests for inline asm cloberringjjasmine3-0/+30
gcc/testsuite/ChangeLog: * rust/compile/inline_asm_faulty_clobber.rs: New test. * rust/compile/inline_asm_faulty_clobber_1.rs: New test. * rust/compile/inline_asm_faulty_clobber_2.rs: New test.
2025-03-17gccrs: Add tests parsing with trailing commas inline asmjjasmine1-0/+10
gcc/testsuite/ChangeLog: * rust/compile/inline_asm_nop_2.rs: New test.
2025-03-17gccrs: Top level parsing test for asm!jjasmine1-0/+10
gcc/testsuite/ChangeLog: * rust/compile/inline_asm_ident_first.rs: New test.
2025-03-17gccrs: Add a simple no-op test for asm!jjasmine1-0/+10
gcc/testsuite/ChangeLog: * rust/compile/inline_asm_nop.rs: Simple test for asm!
2025-03-17gccrs: Replace scaffolded InlineAsm with real InlineAsm.jjasmine2-80/+40
Replace scaffolded InlineAsm with real InlineAsm node in rust-expr.h gcc/rust/ChangeLog: * expand/rust-macro-builtins-asm.cc (parseDirSpec): replace scaffolded InlineAsm with real InlineAsm. (parse_clobber_abi): likewise. (check_and_set): likewise. (parse_options): likewise. (parseAsmArg): likewise. (parse_asm): likewise. * expand/rust-macro-builtins-asm.h (struct AsmParseError): likewise. (enum InlineAsmDirSpec): likewise. (enum InlineAsmRegOrRegClass): likewise. (struct AsmArg): likewise. (parseAsmArg): likewise. (check_and_set): likewise. (parse_operand): likewise. (parse_options): likewise. (parse_reg): likewise. (parse_clobber_abi): likewise.
2025-03-17gccrs: Make InlineAsm non-abstract for usage in parsing.jjasmine1-8/+36
gcc/rust/ChangeLog: * ast/rust-expr.h: Make InlineAsm non-abstract for usage in parsing.
2025-03-17gccrs: Introduced is_global_asm to InlineAsm ASTjjasmine1-0/+1
gcc/rust/ChangeLog: * ast/rust-expr.h: Introduced is_global_asm to InlineAsm AST
2025-03-17gccrs: First draft of parse_option finishedjjasmine2-7/+85
Finish up on parse_option, formatted parse_clobber_abi gcc/rust/ChangeLog: * expand/rust-macro-builtins-asm.cc (parse_clobber_abi): format (check_and_set): helper function, is try_set_option equivalent (parse_options): new function * expand/rust-macro-builtins-asm.h (enum InlineAsmOptions): removed (check_and_set): decl of helper function
2025-03-17gccrs: Fix clobber_api bracketsjjasmine1-8/+8
gcc/rust/ChangeLog: * expand/rust-macro-builtins-asm.cc (parse_clobber_abi): title.
2025-03-17gccrs: Working on parse_options for a bit morejjasmine1-1/+13
gcc/rust/ChangeLog: * expand/rust-macro-builtins-asm.cc (parse_options): title.
2025-03-17gccrs: Introduce first implementation of parse_clobber_abijjasmine2-2/+81
gcc/rust/ChangeLog: * expand/rust-macro-builtins-asm.cc (parse_clobber_abi): title. (parseAsmArg): title. * expand/rust-macro-builtins-asm.h (parse_clobber_abi): title.
2025-03-17gccrs: Working on parseAsmArgjjasmine2-79/+159
gcc/rust/ChangeLog: * expand/rust-macro-builtins-asm.cc (enum InlineAsmRegOrRegClass): title. (parseAsmArg): title. (check_identifier): title. (parse_operand): title. (parse_options): title. (parse_reg): title. (parseDirSpec): title. (parse_asm): title.
2025-03-17gccrs: Almost done with top level parsingjjasmine3-4/+186
gcc/rust/ChangeLog: * expand/rust-macro-builtins-asm.cc (struct AsmParseError): title. (enum InlineAsmDirSpec): title. (enum InlineAsmOptions): title. (struct AsmArg): title. (parseAsmArg): title. (parse_global_asm): title. (parse_nonglobal_asm): title. (parse_asm): title. (parseDirSpec): title. (parse_format_string): title. (MacroBuiltin::global_asm_handler): title. (MacroBuiltin::nonglobal_asm_handler): title. * expand/rust-macro-builtins.cc: title. * expand/rust-macro-builtins.h: title.
2025-03-17gccrs: Add regression tests for exclusive range patternPierre-Emmanuel Patry2-0/+25
Add a few test to check the exclusive range pattern feature. This feature is experimental and shall not be enabled in stable rust. gcc/testsuite/ChangeLog: * rust/compile/exclusive_range_pattern.rs: New test. * rust/compile/exclusive_range_pattern_feature_gate.rs: New test. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2025-03-17gccrs: Add exclusive_range_pattern feature gatePierre-Emmanuel Patry5-5/+17
This syntax is experimental and shall be explicitely enabled in the crate attributes as it cannot be used in stable rust. gcc/rust/ChangeLog: * checks/errors/rust-feature-gate.cc (FeatureGate::visit): Gate the excluded pattern. * checks/errors/rust-feature-gate.h: Update the function prototype and delete two empty implementations in order to use default visitor behavior. * checks/errors/rust-feature.cc (Feature::create): Add the new exclusive range pattern feature gate. * checks/errors/rust-feature.h: Add new feature enum variant for exclusive range patterns. * parse/rust-parse-impl.h (Parser::parse_pattern_no_alt): Forward the token location to the AST. (Parser::parse_ident_leading_pattern): Likewise. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2025-03-17gccrs: Parse exclusive range patternPierre-Emmanuel Patry4-27/+72
Exclusive range pattern were not handled by the parser as this an experimental feature. gcc/rust/ChangeLog: * ast/rust-pattern.cc (tokenid_to_rangekind): Add a new function to get a range kind from the current token type. (RangePattern::as_string): Change the string representation for range pattern in order to handle excluded ranges. * ast/rust-pattern.h (enum class): Add new enum class to differentiate range kinds. (tokenid_to_rangekind): New prototype for a function that converts a token id to it's corresponding range kind. (class RangePattern): Change the class to accept a range kind instead of an ellipsis boolean. * hir/rust-ast-lower-pattern.cc (ASTLoweringPattern::visit): Abort when an excluded pattern has been found as we do not handle their lowering yet. * parse/rust-parse-impl.h (Parser::parse_literal_or_range_pattern): Parse excluded range patterns. (Parser::parse_pattern_no_alt): Likewise. (Parser::parse_ident_leading_pattern): Likewise. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2025-03-17gccrs: Add some test for raw_ref_op to prevent regressionsPierre-Emmanuel Patry4-0/+40
Add a test for the feature gate, as well as some test to ensure the raw keyword stays weak. Also add some tests to check whether the raw_ref_op syntax is parsed correctly. gcc/testsuite/ChangeLog: * rust/compile/not_raw_ref_op.rs: New test. * rust/compile/raw_ref_op.rs: New test. * rust/compile/raw_ref_op_feature_gate.rs: New test. * rust/compile/raw_ref_op_invalid.rs: New test. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2025-03-17gccrs: Add raw_ref_op feature gatePierre-Emmanuel Patry4-1/+14
Raw ref operators are still experimental and shall not slip within stable rust, they should therefore be feature gated. gcc/rust/ChangeLog: * checks/errors/rust-feature-gate.cc (FeatureGate::visit): Gate raw borrow. * checks/errors/rust-feature-gate.h: Update function prototype. * checks/errors/rust-feature.cc: Add raw_ref_op gate. * checks/errors/rust-feature.h: Likewise. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2025-03-17gccrs: Prevent raw reference from being lowered silentlyPierre-Emmanuel Patry2-6/+9
We do not handle those kind of references yet, we shall not let them pass as a regular reference. gcc/rust/ChangeLog: * ast/rust-expr.h: Add a getter for mutability. * hir/rust-ast-lower-expr.cc (ASTLoweringExpr::visit): Panic when a raw reference is met. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2025-03-17gccrs: Parse raw ref operatorPierre-Emmanuel Patry6-23/+86
The raw ref operator is an unstable feature required to obtain a pointer to unaligned adresses (mainly unaligned struct fields) without UB. gcc/rust/ChangeLog: * ast/rust-ast-builder.cc (Builder::ref): Adapt constructor to the new API. * ast/rust-ast-collector.cc (TokenCollector::visit): Emit a raw weak keyword when required. * ast/rust-ast.cc (BorrowExpr::as_string): Change as_string representation to handle raw ref operator. * ast/rust-expr.h (class BorrowExpr): Add raw discriminant. * expand/rust-macro-builtins-include.cc: Adapt constructor to the new API. * parse/rust-parse-impl.h: Handle the raw weak keyword. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2025-03-17gccrs: Add a new regression test over struct expr fieldPierre-Emmanuel Patry1-0/+22
We want to prevent regressions on struct expr field attribute parsing. gcc/testsuite/ChangeLog: * rust/compile/struct_expr_field_attributes.rs: New test. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2025-03-17gccrs: Add outer attributes to struct expr fieldsPierre-Emmanuel Patry3-16/+42
Struct fields can have outer attributes on their field for various purpose, this behavior should be reflected upon struct expr fields. gcc/rust/ChangeLog: * ast/rust-ast-collector.cc (TokenCollector::visit): Output field attributes. * ast/rust-expr.h (class StructExprField): Add outer attributes member. * parse/rust-parse-impl.h (Parser::parse_struct_expr_field): Parse outer attributes and store them in the appropriate AST node. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2025-03-17gccrs: Add two new tests related to may_dangle attributePierre-Emmanuel Patry2-0/+18
First test checks the may_dangle outer atttribute on generic params can be parsed. The second one tests whether may_dangle attributes are correctly feature gated. gcc/testsuite/ChangeLog: * rust/compile/dropck_eyepatch_feature_gate.rs: New test. * rust/compile/may_dangle.rs: New test. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2025-03-17gccrs: Add dropck_eyepatch feature gate for may_danglePierre-Emmanuel Patry5-3/+48
Add a new feature gate for may_dangle generic param outer attributes. gcc/rust/ChangeLog: * checks/errors/rust-feature-gate.cc: Visit and gate may_dangle attributes. * checks/errors/rust-feature-gate.h: Update visit function prototype and add a new member function to check on a set of attributes whether one is may_dangle. * checks/errors/rust-feature.cc (Feature::create): Add new dropck_eyepatch feature. * checks/errors/rust-feature.h: Likewise. * util/rust-attribute-values.h: Add new may_dangle attribute value. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2025-03-17gccrs: Allow multiple outer attributes on generic paramsPierre-Emmanuel Patry7-35/+37
Previously generic params only allowed one outer attribute in front of them. gcc/rust/ChangeLog: * ast/rust-ast-collector.cc (TokenCollector::visit): Visit outer attributes. * ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Change outer attribute visit, we need to visit all of them. * ast/rust-ast.cc (LifetimeParam::as_string): Change as_string implementation to allow multiple outer attributes. (TypeParam::as_string): Likewise. * ast/rust-ast.h (class LifetimeParam): Allow multiple outer attributes. * ast/rust-item.h (class TypeParam): Likewise. * ast/rust-path.h: Likewise. * parse/rust-parse-impl.h (Parser::parse_generic_param): Change call to outer attribute parsing to collect several attributes. (Parser::parse_lifetime_param): Likewise. (Parser::parse_type_param): Likewise. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2025-03-17gccrs: Fix generic parameter parsingPierre-Emmanuel Patry1-1/+1
Generic parameter parsing failed when an outer attribute was used on it. gcc/rust/ChangeLog: * parse/rust-parse-impl.h (Parser::parse_generic_param): Change token reference to be the last token after all outer attributes have been parsed. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2025-03-17gccrs: Add new test for box syntaxPierre-Emmanuel Patry2-0/+11
Add a new test to prevent regressions on the box syntax as well as its feature gate. gcc/testsuite/ChangeLog: * rust/compile/box_syntax.rs: New test. * rust/compile/box_syntax_feature_gate.rs: New test. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2025-03-17gccrs: Add feature gate for box syntaxPierre-Emmanuel Patry4-4/+19
The box syntax is experimental even though it is used in the standard library. It should be feature gated to prevent anyone from using it in stable rust. gcc/rust/ChangeLog: * checks/errors/rust-feature-gate.cc (FeatureGate::visit): Allow visitor recursion in functions. Also add the gate for the box syntax. * checks/errors/rust-feature-gate.h: Remove several recursion fences in the feature gate visitor. * checks/errors/rust-feature.cc (Feature::create): Add a new feature. (Feature::as_name): Likewise. * checks/errors/rust-feature.h: Add box_syntax gate. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>