[Bug rust/119341] New: statement_list in rust-gcc.cc can use range for

2025-03-17 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119341 Bug ID: 119341 Summary: statement_list in rust-gcc.cc can use range for Product: gcc Version: 15.0 Status: UNCONFIRMED Keywords: internal-improvement Severity: normal

[COMMITTED 119/145] gccrs: expand: Switch semicolon boolean to an enum instead.

2025-03-17 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * ast/rust-ast-fragment.h (enum class): Add InvocKind and AsmKind enums. * ast/rust-macro.h: Switch semicolon boolean to InvocKind enum. * expand/rust-expand-visitor.cc (ExpandVisitor::visit): Likewise. * expand/rust-macro-bu

[PATCH 4/4] rust: Add comment inside block [PR119342]

2025-03-17 Thread Andrew Pinski
Inside a BLOCK node, all of the variables of the scope/block are chained together and that connects them to the block. This just adds a comment to that effect as reading the code it is not so obvious why they need to be chained together. gcc/rust/ChangeLog: PR rust/119342 * rust-g

[Bug rust/119341] statement_list in rust-gcc.cc can use range for

2025-03-17 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119341 Andrew Pinski changed: What|Removed |Added URL||https://gcc.gnu.org/piperma

[PATCH 2/4] rust: Use error_operand_p in rust-gcc.cc

2025-03-17 Thread Andrew Pinski
Just a simple cleanupof the code to use error_operand_p instead of directly comparing against error_mark_node. This also moves some cdoe around when dealing with error_operand_p just to be faster and/or slightly tighten up the code slightly. gcc/rust/ChangeLog: * rust-gcc.cc (Bvariable::

[PATCH 3/4] rust: use range for inside rust-gcc.cc [PR119341]

2025-03-17 Thread Andrew Pinski
There are some places inside rust-gcc.cc which are candidates to use range for instead of iterators directly. This changes the locations I saw and makes the code slightly more readable. gcc/rust/ChangeLog: PR rust/119341 * rust-gcc.cc (function_type): Use range fors. (func

[PATCH 1/4] rust: Use REAL_TYPE_P instead of manual checking

2025-03-17 Thread Andrew Pinski
This moves is_floating_point over to using REAL_TYPE_P instead of manually checking. Note before it would return true for all COMPLEX_TYPE but complex types' inner type could be integral. Also fixes up the comment to be in more of the GNU style. Bootstrapped and tested on x86_64-linux-gnu. gcc/r

[COMMITTED 122/145] gccrs: Add RAW_STRING_LITERAL

2025-03-17 Thread arthur . cohen
From: ansh gcc/rust/ChangeLog: * ast/rust-ast-collector.cc (TokenCollector::visit): Handle case for RAW_STRING_LITERAL. * ast/rust-ast.cc (AttributeParser::parse_meta_item_inner): Likewise. (AttributeParser::parse_literal): Likewise. * ast/rust-ast

[Bug rust/119341] statement_list in rust-gcc.cc can use range for

2025-03-17 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119341 --- Comment #3 from Andrew Pinski --- function_ptr_type uses it already for an example. -- You are receiving this mail because: You are on the CC list for the bug.

[Bug rust/119341] statement_list in rust-gcc.cc can use range for

2025-03-17 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119341 --- Comment #2 from Andrew Pinski --- function_type_variadic -- You are receiving this mail because: You are on the CC list for the bug.

[Bug rust/119341] statement_list in rust-gcc.cc can use range for

2025-03-17 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119341 --- Comment #1 from Andrew Pinski --- a few others: block_add_statements block function_set_parameters -- You are receiving this mail because: You are on the CC list for the bug.

[Bug rust/119341] statement_list in rust-gcc.cc can use range for

2025-03-17 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119341 Andrew Pinski changed: What|Removed |Added Ever confirmed|0 |1 Status|UNCONFIRMED

[Bug rust/119342] New: block in rust-gcc.cc could use some comments

2025-03-17 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119342 Bug ID: 119342 Summary: block in rust-gcc.cc could use some comments Product: gcc Version: 15.0 Status: UNCONFIRMED Keywords: internal-improvement Severity: normal

[Bug rust/119333] [15 regression] Rust bootstrap fails with cargo trying to download polonius crates

2025-03-17 Thread dkm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119333 Marc Poulhiès changed: What|Removed |Added See Also||https://github.com/Rust-GCC

[COMMITTED 145/145] gccrs: [E0576] Associated `item` not found in given `type`

2025-03-17 Thread arthur . cohen
From: Muhammad Mahad gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-type.cc (TypeCheckType::visit): Add rich error message and error code similiar to rustc with associaed type and trait name gcc/testsuite/ChangeLog: * rust/compile/unknown-associated-item.rs

[Bug rust/119333] [15 regression] Rust bootstrap fails with cargo trying to download polonius crates

2025-03-17 Thread sjames at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119333 Sam James changed: What|Removed |Added See Also||https://github.com/Rust-GCC

[Bug rust/119333] [15 regression] Rust bootstrap fails with cargo trying to download polonius crates

2025-03-17 Thread sjames at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119333 --- Comment #1 from Sam James --- In libgrust/libformat_parser/Makefile.am, we have: ``` # TODO: Improve `cargo` invocation with host specific flags, possibly creating a $(CARGO) variable? $(LIBFORMAT_PARSER): $(srcdir)/Cargo.toml $(srcdir)/src/

[COMMITTED 126/145] gccrs: Added tl::expected to parse_operand

2025-03-17 Thread arthur . cohen
From: jjasmine Added tl::expected to parse_operand by implementing the validation inside the parse_reg_operand function. gcc/rust/ChangeLog: * ast/rust-expr.h: Added tl::expected to parse_operand * expand/rust-macro-builtins-asm.cc (parse_reg): Likewise. (parse_r

[COMMITTED 139/145] gccrs: Update pattern with \r* for dg-output tests

2025-03-17 Thread arthur . cohen
From: badumbatish First scan with "rg -v '\\r' gcc/testsuite/rust | rg 'dg-output'" gcc/testsuite/ChangeLog: * rust/execute/torture/issue-2187.rs: Update pattern with \r* for dg-output tests * rust/execute/xfail/macro1.rs: Likewise --- gcc/testsuite/rust/execute/torture

[COMMITTED 110/145] gccrs: Refactoring and supporting more parse_reg_operand

2025-03-17 Thread arthur . cohen
From: jjasmine gcc/rust/ChangeLog: * ast/rust-expr.h (struct InlineAsmOperand): Refactoring and supporting more parse_reg_operand * expand/rust-macro-builtins-asm.cc (parse_reg_operand): Likewise. (rust_debug): Likewise. --- gcc/rust/ast/rust-expr.h

[COMMITTED 109/145] gccrs: Fix visitor-related warnings

2025-03-17 Thread arthur . cohen
From: jjasmine gcc/rust/ChangeLog: * ast/rust-ast-collector.cc (TokenCollector::visit): Fix visitor-related warnings * ast/rust-ast-collector.h: Likewise. * ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Likewise. * ast/rust-ast-visitor.h: Likewise.

[Bug rust/119333] [15 regression] Rust bootstrap fails with cargo trying to download polonius crates

2025-03-17 Thread dkm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119333 --- Comment #3 from Marc Poulhiès --- Correct. Not sure about having a .cargo at toplevel currently, so I'll simply --offline for bck, and we'll be able to revisit. https://github.com/Rust-GCC/gccrs/pull/3505 -- You are receiving this mail bec

[COMMITTED 136/145] gccrs: Fix nightly rustc warnings

2025-03-17 Thread arthur . cohen
From: Kushal Pal libgrust/ChangeLog: * libformat_parser/Cargo.toml: Used crate-type instead of depricated crate_type. * libformat_parser/generic_format_parser/src/lib.rs: Remove dead code. * libformat_parser/src/lib.rs: Likewise. Signed-off-by: Kushal Pal

[COMMITTED 142/145] gccrs: Added options for ParseMode

2025-03-17 Thread arthur . cohen
From: badumbatish gcc/rust/ChangeLog: * ast/rust-fmt.cc (Pieces::collect): Added options for ParseMode * ast/rust-fmt.h (collect_pieces): Likewise. (struct Pieces): Likewise. * expand/rust-macro-builtins-format-args.cc (MacroBuiltin::format_args_handler):

[COMMITTED 137/145] gccrs: Introduce new class to handle borrow errors

2025-03-17 Thread arthur . cohen
From: Kushal Pal gcc/rust/ChangeLog: * Make-lang.in: Compile new file. * checks/errors/borrowck/rust-borrow-checker.cc (BorrowChecker::go): Use new class to report errors. * checks/errors/borrowck/rust-borrow-checker-diagnostics.cc: New file. * checks/erro

[COMMITTED 129/145] gccrs: Addresses warning, put warn unused in right place

2025-03-17 Thread arthur . cohen
From: jjasmine gcc/rust/ChangeLog: * expand/rust-macro-builtins-asm.cc (parse_reg_operand): Addresses warning, put warn unused in right place (parse_reg_operand_inout): Likewise. (parse_asm_arg): Likewise. * expand/rust-macro-builtins-asm.h (enum WARN_UNUS

[COMMITTED 118/145] gccrs: expand: Keep track of semicoloned builtin macros

2025-03-17 Thread arthur . cohen
From: Arthur Cohen This is quite a rough fix (like a lot of the macro expansion code...) but it allows built-in macros to be treated as statements. I *think* asm!() might be the only one where it really matters, but also doing something like { line!(); } will now work, whereas before the ma

[COMMITTED 114/145] gccrs: Move parser and last_token_id to InlineAsmCtx

2025-03-17 Thread arthur . cohen
From: jjasmine gcc/rust/ChangeLog: * expand/rust-macro-builtins-asm.cc (parse_clobber_abi): Move parser and last_token_id to InlineAsmCtx to prepapre for tl::expected. (parse_reg): Likewise. (parse_operand): Likewise. (parse_reg_operand): Likewise.

[COMMITTED 141/145] gccrs: Change assertion of constructor

2025-03-17 Thread arthur . cohen
From: badumbatish Change the assert of (expr != nullptr) to (this->expr != nullptr) because we assigned (std::move(expr)) to this->expr, no need to assert expr gcc/rust/ChangeLog: * ast/rust-expr.h (struct AnonConst): Change assertion of constructor (struct InlineAsmOper

[COMMITTED 123/145] gccrs: Finish incorporating expected of parse_reg_operand

2025-03-17 Thread arthur . cohen
From: jjasmine gcc/rust/ChangeLog: * expand/rust-macro-builtins-asm.cc (parse_clobber_abi): Finish incorporating expected of parse_reg_operand (parse_reg): Likewise. (parse_reg_operand): Likewise. (parse_reg_operand_in): Likewise. (parse_reg_operan

[COMMITTED 128/145] gccrs: Add WARN_UNUSED_RESULT parse error

2025-03-17 Thread arthur . cohen
From: jjasmine gcc/rust/ChangeLog: * expand/rust-macro-builtins-asm.h (enum InlineAsmParseError): Add WARN_UNUSED_RESULT parse error (enum WARN_UNUSED_RESULT): Likewise. Signed-off-by: badumbatish --- gcc/rust/expand/rust-macro-builtins-asm.h | 3 ++- 1 file changed, 2

[COMMITTED 131/145] gccrs: Store parse result of parse_format_string(s)

2025-03-17 Thread arthur . cohen
From: badumbatish gcc/rust/ChangeLog: * ast/rust-expr.h (struct TupleTemplateStr): Store parse result of parse_format_string(s) * expand/rust-macro-builtins-asm.cc (parse_format_strings): Likewise Signed-off-by: badumbatish --- gcc/rust/ast/rust-expr.h

[COMMITTED 127/145] gccrs: Added a test that is expected to fail

2025-03-17 Thread arthur . cohen
From: jjasmine gcc/rust/ChangeLog: * expand/rust-macro-builtins-asm.cc (parse_clobber_abi): added comments (parse_options): Likewise (parse_asm_arg): Likewise (parse_asm): Likewise * expand/rust-macro-builtins-asm.h: Likewise gcc/testsuite/ChangeL

[COMMITTED 111/145] gccrs: Partial support for operand

2025-03-17 Thread arthur . cohen
From: jjasmine gcc/rust/ChangeLog: * ast/rust-expr.h (struct InlineAsmOperand): Partial support for operand * expand/rust-macro-builtins-asm.cc (parse_reg_operand): Likewise. (parse_label): Likewise. * expand/rust-macro-builtins-asm.h (parse_label): Likewi

[COMMITTED 140/145] gccrs: [gccrs#3046] ICE on failing to find enum variant

2025-03-17 Thread arthur . cohen
From: Liam Naddell gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-expr.cc: Fix ICE caused by not finding enum variant by adding new error message gcc/testsuite/ChangeLog: * rust/compile/issue-3046.rs: Add test for new error message Signed-off-by: Lia

[COMMITTED 130/145] gccrs: Clean up monadic operations on expected<>

2025-03-17 Thread arthur . cohen
From: jjasmine gcc/rust/ChangeLog: * expand/rust-macro-builtins-asm.cc (parse_asm): Clean up monadic operations on expected<> Signed-off-by: badumbatish --- gcc/rust/expand/rust-macro-builtins-asm.cc | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/g

[COMMITTED 105/145] gccrs: Scaffolding ast visitor for InlineAsm

2025-03-17 Thread arthur . cohen
From: jjasmine 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. --- gcc/rust/ast/rust-ast-visitor.h | 2 ++ gcc/rust/ast/rust-ast.cc| 7 ++

[Bug rust/119333] [15 regression] Rust bootstrap fails with cargo trying to download polonius crates

2025-03-17 Thread sjames at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119333 Sam James changed: What|Removed |Added Target Milestone|--- |15.0 -- You are receiving this mail becaus

[Bug rust/119333] New: [15 regression] Rust bootstrap fails with cargo trying to download polonius crates

2025-03-17 Thread sjames at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119333 Bug ID: 119333 Summary: [15 regression] Rust bootstrap fails with cargo trying to download polonius crates Product: gcc Version: 15.0 Status: UNCONFIRMED Keywo

[COMMITTED 124/145] gccrs: Finish expected parse_reg_operand

2025-03-17 Thread arthur . cohen
From: jjasmine gcc/rust/ChangeLog: * expand/rust-macro-builtins-asm.cc (parse_reg_operand_in): Finish expected parse_reg_operand (parse_reg_operand_unexpected): Likewise * expand/rust-macro-builtins-asm.h (parse_reg_operand_unexpected): Likewise Signed-off-by: b

[COMMITTED 101/145] gccrs: Slim down the test cases

2025-03-17 Thread arthur . cohen
From: jjasmine 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_clob

[COMMITTED 096/145] gccrs: Big Refactor after meeting

2025-03-17 Thread arthur . cohen
From: jjasmine 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.

[COMMITTED 097/145] gccrs: Renamed parseAsmArg to conform to other function names

2025-03-17 Thread arthur . cohen
From: jjasmine 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.

[COMMITTED 103/145] gccrs: Partial unsafe support for inline asm

2025-03-17 Thread arthur . cohen
From: jjasmine 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

[COMMITTED 117/145] gccrs: Fix optional trait parsing

2025-03-17 Thread arthur . cohen
From: dave gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-item.cc (TypeCheckItem::visit): Check for ?Trait in visitor gcc/testsuite/ChangeLog: * rust/compile/issue-2725.rs: New test. Signed-off-by: Dave Evans --- gcc/rust/typecheck/rust-hir-type-check-item.cc | 18

[COMMITTED 100/145] gccrs: Refactoring for inline asm pr

2025-03-17 Thread arthur . cohen
From: jjasmine 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 InlineAsmRegOrRegClas

[COMMITTED 106/145] gccrs: Scaffolding HIRFullVisitor for inline asm

2025-03-17 Thread arthur . cohen
From: jjasmine 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::acc

[COMMITTED 099/145] gccrs: Got AST::Fragment to be created from InlineAsm

2025-03-17 Thread arthur . cohen
From: jjasmine 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.

[COMMITTED 088/145] gccrs: Parsing of options(...) done.

2025-03-17 Thread arthur . cohen
From: jjasmine 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_opti

[COMMITTED 098/145] gccrs: Working towards parse_reg and parse_reg_operand

2025-03-17 Thread arthur . cohen
From: jjasmine 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

[COMMITTED 138/145] gccrs: Improve error messages for operator expressions

2025-03-17 Thread arthur . cohen
From: Antonio Gomes gcc/rust/ChangeLog: * hir/tree/rust-hir-expr.h: Add new get_operator_str method in ArithmeticOrLogicalExpr and CompoundAssignmentExpr * hir/tree/rust-hir.cc: Likewise * typecheck/rust-hir-type-check-expr.cc: Improve error message for ope

[COMMITTED 134/145] rust: fix HIR dump for MatchExpr

2025-03-17 Thread arthur . cohen
From: Marc Poulhiès The visitor was still using the as_string() method. gcc/rust/ChangeLog: * hir/rust-hir-dump.cc (Dump::do_matcharm): New. (Dump::do_matchcase): New. (Dump::visit(MatchExpr)): Adjust, don't use as_string. * hir/rust-hir-dump.h (Dump::do_matcharm

[COMMITTED 133/145] gccrs: [gccrs#3051] Remove unnecessary #include from rust-expr.h

2025-03-17 Thread arthur . cohen
From: Liam Naddell gcc/rust/ChangeLog: * ast/rust-expr.h: Remove unnecessary include. Signed-off-by: Liam Naddell --- gcc/rust/ast/rust-expr.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/gcc/rust/ast/rust-expr.h b/gcc/rust/ast/rust-expr.h index 8fc89d87878..25afe235e4e

[COMMITTED 144/145] gccrs: [gccrs#2987] Patch ICE when deriving Clone and Copy

2025-03-17 Thread arthur . cohen
From: Liam Naddell gcc/rust/ChangeLog: * expand/rust-expand-visitor.cc: Fix ICE caused by unique_ptr UB and buggy iterator use gcc/testsuite/ChangeLog: * rust/compile/issue-2987.rs: Add test for deriving Clone and Copy at the same time Signed-off-by: Liam Naddell

[COMMITTED 115/145] gccrs: Expected first layer done

2025-03-17 Thread arthur . cohen
From: jjasmine gcc/rust/ChangeLog: * expand/rust-macro-builtins-asm.cc (parse_reg): Expected first layer done (parse_reg_operand): Likewise. (parse_asm_arg): Likewise. (parse_format_strings): Likewise. (parse_asm): Likewise. (validate): Lik

[COMMITTED 113/145] gccrs: Update parser to parse strings in the first stage

2025-03-17 Thread arthur . cohen
From: jjasmine gcc/rust/ChangeLog: * expand/rust-macro-builtins-asm.cc (parse_reg_operand): Update parser to parse strings in the first stage (parse_label): not needed right now --- gcc/rust/expand/rust-macro-builtins-asm.cc | 62 +- 1 file changed, 1

[COMMITTED 112/145] gccrs: Scaffolding validation of asm!

2025-03-17 Thread arthur . cohen
From: jjasmine gcc/rust/ChangeLog: * expand/rust-macro-builtins-asm.cc (parse_asm): Scaffolding validation of asm! (validate): Likewise * expand/rust-macro-builtins-asm.h (validate): Likewise --- gcc/rust/expand/rust-macro-builtins-asm.cc | 31 +--

[COMMITTED 120/145] gccrs: Add test case for using asm! outside of unsafe {}

2025-03-17 Thread arthur . cohen
From: jjasmine gcc/testsuite/ChangeLog: * rust/compile/inline_asm_outside_unsafe.rs: New test. --- .../rust/compile/inline_asm_outside_unsafe.rs | 11 +++ 1 file changed, 11 insertions(+) create mode 100644 gcc/testsuite/rust/compile/inline_asm_outside_unsafe.rs diff -

[COMMITTED 108/145] gccrs: Add potentially_nonpromoted_keywords set str

2025-03-17 Thread arthur . cohen
From: jjasmine 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/ChangeLo

[COMMITTED 125/145] gccrs: Scaffold expected on parse_options and asm_arg

2025-03-17 Thread arthur . cohen
From: jjasmine gcc/rust/ChangeLog: * expand/rust-macro-builtins-asm.cc (check_and_set): Scaffold expected on parse_options and asm_arg (parse_options): Likewise (parse_asm_arg): Likewise * expand/rust-macro-builtins-asm.h (check_and_set): Likewise

[COMMITTED 143/145] gccrs: Fix ffi and enum conventions

2025-03-17 Thread arthur . cohen
From: badumbatish gcc/rust/ChangeLog: * ast/rust-fmt.h (enum ParseMode): Drop typedef in Cpp libgrust/ChangeLog: * libformat_parser/generic_format_parser/src/lib.rs: Remove repr(C) * libformat_parser/src/bin.rs: Use ffi * libformat_parser/src/lib

[COMMITTED 084/145] gccrs: Top level parsing test for asm!

2025-03-17 Thread arthur . cohen
From: jjasmine gcc/testsuite/ChangeLog: * rust/compile/inline_asm_ident_first.rs: New test. --- gcc/testsuite/rust/compile/inline_asm_ident_first.rs | 10 ++ 1 file changed, 10 insertions(+) create mode 100644 gcc/testsuite/rust/compile/inline_asm_ident_first.rs diff --git a/g

[COMMITTED 135/145] gccrs: Added FFIVector to get Polonius output on C++ side

2025-03-17 Thread arthur . cohen
From: Kushal Pal gcc/rust/ChangeLog: * Make-lang.in: Compile new file, rust-polonius.cc * checks/errors/borrowck/ffi-polonius/src/gccrs_ffi.rs: Opaque type to represent FFIVector from C++. * checks/errors/borrowck/ffi-polonius/src/gccrs_ffi_generated.rs: C

[COMMITTED 121/145] gccrs: Added ExprType::InlineAsm

2025-03-17 Thread arthur . cohen
From: jjasmine gcc/rust/ChangeLog: * hir/tree/rust-hir-expr.h: Added ExprType::InlineAsm * hir/tree/rust-hir.h: Added ExprType::InlineAsm --- gcc/rust/hir/tree/rust-hir-expr.h | 3 +-- gcc/rust/hir/tree/rust-hir.h | 1 + 2 files changed, 2 insertions(+), 2 d

[COMMITTED 081/145] gccrs: Make InlineAsm non-abstract for usage in parsing.

2025-03-17 Thread arthur . cohen
From: jjasmine gcc/rust/ChangeLog: * ast/rust-expr.h: Make InlineAsm non-abstract for usage in parsing. --- gcc/rust/ast/rust-expr.h | 44 1 file changed, 36 insertions(+), 8 deletions(-) diff --git a/gcc/rust/ast/rust-expr.h b/gcc/rust/ast/rust

[COMMITTED 091/145] gccrs: Resolve static decl warning

2025-03-17 Thread arthur . cohen
From: jjasmine gcc/rust/ChangeLog: * expand/rust-macro-builtins-asm.h (parseAsmArg): Resolve static decl warning (parse_nonglobal_asm): Resolve static decl warning --- gcc/rust/expand/rust-macro-builtins-asm.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deleti

[COMMITTED 089/145] gccrs: Wraps inline_asm tests in unsafe {}

2025-03-17 Thread arthur . cohen
From: jjasmine 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

[COMMITTED 107/145] gccrs: Successful parse of in and inout, albeit with str

2025-03-17 Thread arthur . cohen
From: jjasmine 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):

[COMMITTED 116/145] gccrs: Partial second layer of expected in parsing asm

2025-03-17 Thread arthur . cohen
From: jjasmine gcc/rust/ChangeLog: * expand/rust-macro-builtins-asm.cc (parseDirSpec): Partial second layer of expected in parsing asm (parse_clobber_abi): Likewise (parse_operand): Likewise (parse_reg_operand): Likewise (parse_asm_arg): Likewise

[COMMITTED 080/145] gccrs: Introduced is_global_asm to InlineAsm AST

2025-03-17 Thread arthur . cohen
From: jjasmine gcc/rust/ChangeLog: * ast/rust-expr.h: Introduced is_global_asm to InlineAsm AST --- gcc/rust/ast/rust-expr.h | 1 + 1 file changed, 1 insertion(+) diff --git a/gcc/rust/ast/rust-expr.h b/gcc/rust/ast/rust-expr.h index a5afbffee99..84fb5e8ab33 100644 --- a/gcc/rust/ast/r

[COMMITTED 104/145] gccrs: Fix warnings

2025-03-17 Thread arthur . cohen
From: jjasmine 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: --- gcc/rust/expan

[COMMITTED 074/145] gccrs: Almost done with top level parsing

2025-03-17 Thread arthur . cohen
From: jjasmine 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. (

[COMMITTED 075/145] gccrs: Working on parseAsmArg

2025-03-17 Thread arthur . cohen
From: jjasmine 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

[COMMITTED 102/145] gccrs: Add support for AST to HIR inline asm translation

2025-03-17 Thread arthur . cohen
From: jjasmine 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::v

[COMMITTED 093/145] gccrs: Rename InlineAsmOptions to InlineAsmOption

2025-03-17 Thread arthur . cohen
From: jjasmine 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.c

[COMMITTED 092/145] gccrs: Scaffolding parse_reg

2025-03-17 Thread arthur . cohen
From: jjasmine 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. --- gcc/rust/ast/rust-expr.h

[COMMITTED 085/145] gccrs: Add tests parsing with trailing commas inline asm

2025-03-17 Thread arthur . cohen
From: jjasmine gcc/testsuite/ChangeLog: * rust/compile/inline_asm_nop_2.rs: New test. --- gcc/testsuite/rust/compile/inline_asm_nop_2.rs | 10 ++ 1 file changed, 10 insertions(+) create mode 100644 gcc/testsuite/rust/compile/inline_asm_nop_2.rs diff --git a/gcc/testsuite/rust/

[COMMITTED 079/145] gccrs: First draft of parse_option finished

2025-03-17 Thread arthur . cohen
From: jjasmine 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-mac

[COMMITTED 083/145] gccrs: Add a simple no-op test for asm!

2025-03-17 Thread arthur . cohen
From: jjasmine gcc/testsuite/ChangeLog: * rust/compile/inline_asm_nop.rs: Simple test for asm! --- gcc/testsuite/rust/compile/inline_asm_nop.rs | 10 ++ 1 file changed, 10 insertions(+) create mode 100644 gcc/testsuite/rust/compile/inline_asm_nop.rs diff --git a/gcc/testsuite/

[COMMITTED 070/145] gccrs: Add some test for raw_ref_op to prevent regressions

2025-03-17 Thread arthur . cohen
From: Pierre-Emmanuel Patry 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/com

[COMMITTED 095/145] gccrs: Remove global_asm and non_global_asm handler

2025-03-17 Thread arthur . cohen
From: jjasmine 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

[COMMITTED 078/145] gccrs: Fix clobber_api brackets

2025-03-17 Thread arthur . cohen
From: jjasmine gcc/rust/ChangeLog: * expand/rust-macro-builtins-asm.cc (parse_clobber_abi): title. --- gcc/rust/expand/rust-macro-builtins-asm.cc | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/gcc/rust/expand/rust-macro-builtins-asm.cc b/gcc/rust/e

[COMMITTED 087/145] gccrs: Implemented parse_clobber_abi to pass new tests

2025-03-17 Thread arthur . cohen
From: jjasmine 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 (parseAsmA

[COMMITTED 086/145] gccrs: Added faulty tests for inline asm cloberring

2025-03-17 Thread arthur . cohen
From: jjasmine 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. --- .../rust/compile/inline_asm_faulty_clobber.rs | 1

[COMMITTED 082/145] gccrs: Replace scaffolded InlineAsm with real InlineAsm.

2025-03-17 Thread arthur . cohen
From: jjasmine 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.

[COMMITTED 090/145] gccrs: Add checks for duplicate options in inline asm

2025-03-17 Thread arthur . cohen
From: jjasmine 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. --- gcc/rust/expan

[COMMITTED 069/145] gccrs: Add raw_ref_op feature gate

2025-03-17 Thread arthur . cohen
From: Pierre-Emmanuel Patry 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-featur

[COMMITTED 067/145] gccrs: Parse raw ref operator

2025-03-17 Thread arthur . cohen
From: Pierre-Emmanuel Patry 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/r

[COMMITTED 073/145] gccrs: Add regression tests for exclusive range pattern

2025-03-17 Thread arthur . cohen
From: Pierre-Emmanuel Patry 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_fea

[COMMITTED 066/145] gccrs: Add a new regression test over struct expr field

2025-03-17 Thread arthur . cohen
From: Pierre-Emmanuel Patry 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 --- .../compile/struct_expr_field_attributes.rs | 22 ++

[COMMITTED 071/145] gccrs: Parse exclusive range pattern

2025-03-17 Thread arthur . cohen
From: Pierre-Emmanuel Patry 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_str

[COMMITTED 076/145] gccrs: Introduce first implementation of parse_clobber_abi

2025-03-17 Thread arthur . cohen
From: jjasmine 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. --- gcc/rust/expand/rust-macro-builtins-asm.cc | 76 +- gcc/rust/ex

[COMMITTED 072/145] gccrs: Add exclusive_range_pattern feature gate

2025-03-17 Thread arthur . cohen
From: Pierre-Emmanuel Patry 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

[COMMITTED 077/145] gccrs: Working on parse_options for a bit more

2025-03-17 Thread arthur . cohen
From: jjasmine gcc/rust/ChangeLog: * expand/rust-macro-builtins-asm.cc (parse_options): title. --- gcc/rust/expand/rust-macro-builtins-asm.cc | 14 +- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/gcc/rust/expand/rust-macro-builtins-asm.cc b/gcc/rust/expand/

[COMMITTED 064/145] gccrs: Add two new tests related to may_dangle attribute

2025-03-17 Thread arthur . cohen
From: Pierre-Emmanuel Patry 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. * rus

[COMMITTED 061/145] gccrs: Fix generic parameter parsing

2025-03-17 Thread arthur . cohen
From: Pierre-Emmanuel Patry 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. Sig

[COMMITTED 063/145] gccrs: Add dropck_eyepatch feature gate for may_dangle

2025-03-17 Thread arthur . cohen
From: Pierre-Emmanuel Patry 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

[COMMITTED 062/145] gccrs: Allow multiple outer attributes on generic params

2025-03-17 Thread arthur . cohen
From: Pierre-Emmanuel Patry 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

[COMMITTED 059/145] gccrs: Add feature gate for box syntax

2025-03-17 Thread arthur . cohen
From: Pierre-Emmanuel Patry 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 recu

[COMMITTED 057/145] gccrs: Improve handling of ConstantItem during name resolution 2.0

2025-03-17 Thread arthur . cohen
From: Owen Avery gcc/rust/ChangeLog: * resolve/rust-default-resolver.cc (DefaultResolver::visit): Scope with Rib::Kind::ConstantItem instead of Rib::Kind::Item. * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit): Remove redundancy in ov

  1   2   >