[COMMITTED 31/32] gccrs: nr2.0: Adjust test issue-2812.rs

2025-04-08 Thread arthur . cohen
From: Owen Avery gcc/testsuite/ChangeLog: * rust/compile/issue-2812.rs: Avoid multiple definition error. * rust/compile/nr2/exclude: Remove issue-2812.rs. Signed-off-by: Owen Avery --- gcc/testsuite/rust/compile/issue-2812.rs | 4 ++-- gcc/testsuite/rust/compile/nr2/exclude

[COMMITTED 10/32] gccrs: feature: Add min_specialization feature

2025-04-08 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * checks/errors/rust-feature.cc (Feature::create): Handle `#![feature(min_specialization)]`. * checks/errors/rust-feature.h: Likewise. --- gcc/rust/checks/errors/rust-feature.cc | 4 gcc/rust/checks/errors/rust-feature.h | 1 + 2

[COMMITTED 04/32] gccrs: Fix ICE when resolving lifetimes without name

2025-04-08 Thread arthur . cohen
From: Philip Herron We dont need to assert here the lifetime code already supports this case. Fixes Rust-GCC#3657 gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-base.cc: remove assertion gcc/testsuite/ChangeLog: * rust/compile/issue-3657.rs: New test. Signed-off-by: Phi

[COMMITTED 02/32] gccrs: nr2.0: Handle global paths

2025-04-08 Thread arthur . cohen
From: Owen Avery gcc/rust/ChangeLog: * resolve/rust-forever-stack.h (ForeverStack::ForeverStack): Initialize extern_prelude. (ForeverStack::resolve_path): Add parameter has_opening_scope_resolution. (ForeverStack::extern_prelude): Add field. * reso

[COMMITTED 06/32] gccrs: Fix recusive type query and nullptr on type path

2025-04-08 Thread arthur . cohen
From: Philip Herron This was a small fix to sort out the segfault to check for nullptr on the TypePath cases for query type. But when this happened opened up a few bugs that were hidden under the carpet namely: compile/issue-2905-{1,2}.rs which has a recursive type query which needs to ne handled

[COMMITTED 03/32] gccrs: Fix ICE when doing shift checks on const decl

2025-04-08 Thread arthur . cohen
From: Philip Herron Const decls are just delcarations wrapping the value into the DECL_INITIAL and the shift checks we have assume no decls are involved and its just flat values. This patch simply unwraps the constant values if they exist. Fixes Rust-GCC#3665 gcc/rust/ChangeLog: * rust

[COMMITTED 07/32] gccrs: Fix ICE on invalid match arms

2025-04-08 Thread arthur . cohen
From: Philip Herron We hit assertions on empty enum or unknown variant, this catches the error and emits a new diagnostic. Fixes Rust-GCC#3656 gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit): emit error gcc/testsuite/ChangeLog: * rust

[COMMITTED 14/32] gccrs: nr2.0: Improve test script

2025-04-08 Thread arthur . cohen
From: Owen Avery gcc/testsuite/ChangeLog: * rust/compile/nr2/compile.exp: Avoid absolute paths in output, adjust phrasing of output, and avoid false XPASS output when tests are run in parallel. Signed-off-by: Owen Avery --- gcc/testsuite/rust/compile/nr2/compile.exp |

[COMMITTED 09/32] gccrs: Fix ICE when hitting invalid types for generics

2025-04-08 Thread arthur . cohen
From: Philip Herron We need to check upfront if the type is valid or not. Then error with a decent message. Fixes Rust-GCC#3643 Fixes Rust-GCC#3646 Fixes Rust-GCC#3654 Fixes Rust-GCC#3663 Fixes Rust-GCC#3671 gcc/rust/ChangeLog: * resolve/rust-ast-resolve-type.cc (ResolveRelativeTypePat

[COMMITTED 21/32] gccrs: Remove unused error constructor and getter

2025-04-08 Thread arthur . cohen
From: Pierre-Emmanuel Patry These constructor for eroneous state are not in use anymore since we replaced this error state with an optional in the parent nodes. gcc/rust/ChangeLog: * ast/rust-expr.h: Remove error getter and constructor. Signed-off-by: Pierre-Emmanuel Patry --- gcc/ru

[COMMITTED 11/32] gccrs: hir: Add default qualifier to function, lower it properly

2025-04-08 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * ast/rust-ast.cc (Function::Function): Rename is_default -> has_default. (Function::operator=): Likewise. * ast/rust-item.h (class Function): Add `is_default` method. * hir/rust-ast-lower-implitem.cc (ASTLowerImplI

[COMMITTED 05/32] gccrs: Fix ICE when there are 2 functions named main

2025-04-08 Thread arthur . cohen
From: Philip Herron We need to setup the main_identifier_node for MAIN_DECL_P checks in the middle-end. But it is valid to have a main function/method on impl blocks. So we need to flag if this is a "root" item or not, which is one that is jsut an HIR::Function on part of the Crate::items as oppp

[COMMITTED 18/32] gccrs: Add check for label

2025-04-08 Thread arthur . cohen
From: Pierre-Emmanuel Patry gcc/rust/ChangeLog: * ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Visit loop label only if it exists. gcc/testsuite/ChangeLog: * rust/compile/nr2/exclude: Remove passing test. Signed-off-by: Pierre-Emmanuel Patry --- gcc/rust/ast/r

[COMMITTED 19/32] gccrs: Visit loop label before predicate expression

2025-04-08 Thread arthur . cohen
From: Pierre-Emmanuel Patry If the label is referenced within the while predicate expression it has to be resolved before the latter. gcc/rust/ChangeLog: * ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Change default visit order. gcc/testsuite/ChangeLog: * rust/c

[COMMITTED 12/32] gccrs: Fix ICE for reserved lifetime name

2025-04-08 Thread arthur . cohen
From: Philip Herron This is a reserved name so this changes the assertion to a diagnostic. Fixes Rust-GCC#3647 gcc/rust/ChangeLog: * typecheck/rust-typecheck-context.cc (TypeCheckContext::lookup_lifetime): emit error gcc/testsuite/ChangeLog: * rust/compile/issue-3647.rs: New

[COMMITTED 08/32] gccrs: Fix ICE on raw reference

2025-04-08 Thread arthur . cohen
From: Philip Herron This patch adds support for raw references which enforce the pointer type away from a reference type. Fixes Rust-GCC#3667 gcc/rust/ChangeLog: * backend/rust-compile-base.cc (HIRCompileBase::address_expression): allow optional type * backend/rust-compile-bas

[COMMITTED 22/32] gccrs: Update ast visitor with proper check for looplabel

2025-04-08 Thread arthur . cohen
From: Pierre-Emmanuel Patry The visitor was visiting loop label even when they did not exist. gcc/rust/ChangeLog: * ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Add check for loop label before visiting it. Signed-off-by: Pierre-Emmanuel Patry --- gcc/rust/ast/rust-ast-

[COMMITTED 16/32] gccrs: Revert part of 44ffe1193269

2025-04-08 Thread arthur . cohen
From: Pierre-Emmanuel Patry This commit got rid of msvc specific code and remove the else clause, this triggered warning with tl::expected::value function. gcc/rust/ChangeLog: * util/expected.h: Use gcc_unreachable within gcc context. Signed-off-by: Pierre-Emmanuel Patry --- gcc/rust

[COMMITTED 13/32] gccrs: nr2.0: Remove duplicate self visit

2025-04-10 Thread arthur . cohen
From: Owen Avery gcc/rust/ChangeLog: * ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Remove explicit visitation of a function's self parameter, as if it exists it'll be visited as one of the function parameters. gcc/testsuite/ChangeLog: * rust/comp

[COMMITTED 20/32] gccrs: Make loop label truly optional

2025-04-10 Thread arthur . cohen
From: Pierre-Emmanuel Patry A loop label error state was in use to represent missing loop label but this may be easily forgotten and the optional nature of the label was misrepresented. gcc/rust/ChangeLog: * ast/rust-ast-builder.cc (Builder::block): Call with a nullopt instead o

[COMMITTED 25/32] gccrs: Resolve labels within break or continue expressions

2025-04-10 Thread arthur . cohen
From: Pierre-Emmanuel Patry gcc/rust/ChangeLog: * resolve/rust-late-name-resolver-2.0.cc (Late::visit): Add call to label resolution if there is one label. (Late::resolve_label): Look for labels and emit an error message on failure. * resolve/rust-late-nam

[COMMITTED 01/35] gccrs: Fix function name to printf

2025-03-31 Thread arthur . cohen
From: Pierre-Emmanuel Patry Function could not be found and triggered an error message. gcc/testsuite/ChangeLog: * rust/compile/feature_rust_attri0.rs: Add extern function declaration and change name to printf. * rust/compile/nr2/exclude: Remove now passing test from exc

[COMMITTED 05/35] gccrs: parser: Parse let-else statements

2025-03-31 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * parse/rust-parse-impl.h (Parser::parse_let_stmt): Add new parsing in case of `else` token. --- gcc/rust/parse/rust-parse-impl.h | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust

[COMMITTED 06/35] gccrs: dump: Handle let-else properly

2025-03-31 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * ast/rust-ast-collector.cc (TokenCollector::visit): Add handling for diverging else expression. --- gcc/rust/ast/rust-ast-collector.cc | 8 1 file changed, 8 insertions(+) diff --git a/gcc/rust/ast/rust-ast-collector.cc b/gcc

[COMMITTED 03/35] gccrs: Remove now passing test from exclusion list

2025-03-31 Thread arthur . cohen
From: Pierre-Emmanuel Patry Those tests were malformed and failed with the new name resolution because of it. gcc/testsuite/ChangeLog: * rust/compile/nr2/exclude: Remove test from exclusion list. Signed-off-by: Pierre-Emmanuel Patry --- gcc/testsuite/rust/compile/nr2/exclude | 5

[COMMITTED 04/35] gccrs: ast: Add optional diverging else to AST::LetStmt

2025-03-31 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * ast/rust-stmt.h (class LetStmt): Add optional expression for diverging else. * ast/rust-ast-builder.cc (Builder::let): Use new API. --- gcc/rust/ast/rust-ast-builder.cc | 3 ++- gcc/rust/ast/rust-stmt.h | 29

[COMMITTED 094/146] gccrs: lower: Correctly lower parenthesized types

2025-03-28 Thread arthur . cohen
From: Arthur Cohen This is useful for handling multiple trait bounds, and required for better handling of auto traits. gcc/rust/ChangeLog: * hir/rust-ast-lower-type.cc (ASTLoweringType::visit): Add implementation for ParenthesizedType. * hir/rust-ast-lower-type.h

[COMMITTED 130/146] gccrs: ast-collector: Adapt to lang item type path segments

2025-03-28 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * ast/rust-ast-collector.cc (TokenCollector::visit): Fix collector to better handle lang item type path segments. --- gcc/rust/ast/rust-ast-collector.cc | 23 +++ 1 file changed, 15 insertions(+), 8 deletions(-) diff

[COMMITTED 02/35] gccrs: Fix testcase module path

2025-03-31 Thread arthur . cohen
From: Pierre-Emmanuel Patry Those tests are coming from libcore and module inlining was wrong, in libcore there was a use declaration to import those modules which was missing here. gcc/testsuite/ChangeLog: * rust/compile/issue-2330.rs: Use complete path from crate root. * rust/

[COMMITTED 14/35] gccrs: fix unconstrained infer vars on generic associated type

2025-03-31 Thread arthur . cohen
From: Philip Herron The trick here is that when Bar::test is resolved it resolves to the trait method: fn , T> (placeholder) -> placeholder Which is fine so we need to setup the associated types for Bar which means looking up the associated impl block then setting up the projection of A = T s

[COMMITTED 15/35] gccrs: Fix core library test with proper canonical path

2025-03-31 Thread arthur . cohen
From: Pierre-Emmanuel Patry Import from core library was wrong, it misses several crate directives since we're no longer dealing with multiple files. gcc/testsuite/ChangeLog: * rust/compile/issue-2905-2.rs: Import from core library into a single file misses the crate directives.

[COMMITTED 17/35] gccrs: Add check for super traits being implemented by Self

2025-03-31 Thread arthur . cohen
From: Philip Herron We need to recursively check the super traits of the predicate the Self type is trying to implement. Otherwise its cannot implement it. Fixes Rust-GCC#3553 gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-item.cc (TypeCheckItem::resolve_impl_block_substitutions)

[COMMITTED 07/35] gccrs: name-resolution: Handle let-else properly

2025-03-31 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * resolve/rust-ast-resolve-stmt.h: Add handling for diverging else. * resolve/rust-late-name-resolver-2.0.cc (Late::visit): Likewise. --- gcc/rust/resolve/rust-ast-resolve-stmt.h| 7 --- gcc/rust/resolve/rust-late-name-resolver

[COMMITTED 35/35] gccrs: Fix SEGV when type path resolver fails outright

2025-03-31 Thread arthur . cohen
From: Philip Herron When we resolve paths we resolve to Types first we walk each segment to the last module which has no type but then in the event that the child of a module is not found we have a null root_tyty which needs to be caught and turned into an ErrorType node. Fixes Rust-GCC#3613 gc

[COMMITTED 20/35] gccrs: Fix ICE when doing method resolution on trait predicates

2025-03-31 Thread arthur . cohen
From: Philip Herron We need to ensure we are adding methods to the possible candidates. Fixes Rust-GCC#3554 gcc/rust/ChangeLog: * typecheck/rust-hir-dot-operator.cc: gcc/testsuite/ChangeLog: * rust/compile/issue-3554-1.rs: New test. * rust/compile/issue-3554-2.rs: New

[COMMITTED 33/35] gccrs: fix ice when setting up regions

2025-03-31 Thread arthur . cohen
From: Philip Herron num regions is based on the used arguments of regions which can be less than the substutions requirements. So lets check for that and allow anon regions to be created for them. Fixes Rust-GCC#3605 gcc/rust/ChangeLog: * typecheck/rust-tyty-subst.h: check for min rang

[COMMITTED 23/35] gccrs: Update exclusion list

2025-03-31 Thread arthur . cohen
From: Pierre-Emmanuel Patry gcc/testsuite/ChangeLog: * rust/compile/nr2/exclude: Remove now passing tests from exclusion list. Signed-off-by: Pierre-Emmanuel Patry --- gcc/testsuite/rust/compile/nr2/exclude | 6 -- 1 file changed, 6 deletions(-) diff --git a/gcc/testsuite

[COMMITTED 22/35] gccrs: Resolve module final self segment in use decls

2025-03-31 Thread arthur . cohen
From: Pierre-Emmanuel Patry Lowercase self suffix with path was not resolved properly, this should point to the module right before. gcc/rust/ChangeLog: * resolve/rust-forever-stack.hxx: Add a new specialized function to retrieve the last "real" segment depending on the namespac

[COMMITTED 34/35] gccrs: fix crash in parse repr options and missing delete call

2025-03-31 Thread arthur . cohen
From: Philip Herron Fixes Rust-GCC#3606 gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-base.cc (TypeCheckBase::parse_repr_options): check for null and empty and add missing delete call gcc/testsuite/ChangeLog: * rust/compile/issue-3606.rs: New test. Signed-off-b

[COMMITTED 30/35] gccrs: Fix ICE in array ref constexpr

2025-03-31 Thread arthur . cohen
From: Philip Herron Since 898d55ad7e2 was fixed to remove the VIEW_CONVERT_EXPR from array expressions we can now turn on the array element access const expr. Fixes Rust-GCC#3563 gcc/rust/ChangeLog: * backend/rust-constexpr.cc (eval_store_expression): turn this back on gcc/testsuite/C

[COMMITTED 18/35] gccrs: Fix ICE when compiling block expressions in array capacity

2025-03-31 Thread arthur . cohen
From: Philip Herron We need to reuse the existing compile_constant_item helper which handles the case if this is a simple expression, fn-call or a block expression. The patch extracts out this helper as a static method so this can be used in more places. Fixes Rust-GCC#3566 gcc/rust/ChangeLog:

[COMMITTED 31/35] gccrs: FIX ICE when working with HIR::BareFunctionType

2025-03-31 Thread arthur . cohen
From: Philip Herron Fixes Rust-GCC#3615 gcc/rust/ChangeLog: * hir/rust-hir-dump.cc (Dump::visit): check has type * hir/tree/rust-hir-type.cc (BareFunctionType::BareFunctionType): likewise gcc/testsuite/ChangeLog: * rust/compile/issue-3615.rs: New test. Signed-off-by:

[COMMITTED 21/35] gccrs: Give the builtin unit struct an actual locus

2025-03-31 Thread arthur . cohen
From: Philip Herron This has been a pet peeve of mine for a while because the gimple never emitted the struct () name properly it was always empty which for record types they always require a real locus or they dont get a proper name. gcc/rust/ChangeLog: * backend/rust-compile-base.cc (

[COMMITTED 10/35] rust: Lower minimum supported Rust version to 1.49

2025-03-31 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * checks/errors/borrowck/ffi-polonius/Cargo.lock: Regenerate. * checks/errors/borrowck/ffi-polonius/Cargo.toml: Update to use source patching instead of vendoring, lower edition to 2018. * checks/errors/borrowck/ffi

[COMMITTED 32/35] gccrs: FIX ICE for malformed repr attribute

2025-03-31 Thread arthur . cohen
From: Philip Herron Fixes Rust-GCC#3614 gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-base.cc (TypeCheckBase::parse_repr_options): check for input gcc/testsuite/ChangeLog: * rust/compile/issue-3614.rs: New test. Signed-off-by: Philip Herron --- gcc/rust/typecheck/rus

[COMMITTED 24/35] gccrs: Add new test to highlight namespace for self import

2025-03-31 Thread arthur . cohen
From: Pierre-Emmanuel Patry gcc/testsuite/ChangeLog: * rust/compile/self_import_namespace.rs: New test. Signed-off-by: Pierre-Emmanuel Patry --- .../rust/compile/self_import_namespace.rs | 14 ++ 1 file changed, 14 insertions(+) create mode 100644 gcc/testsuite/r

[COMMITTED 16/35] gccrs: Fix ICE when array elements are not a value

2025-03-31 Thread arthur . cohen
From: Philip Herron We need to check for error_mark_node when doing adjustments from coercion sites otherwise we hit assetions as part of the coercion. That fixes the ICE but the reason for the error_mark_node is because the array element value. Fixes Rust-GCC#3567 gcc/rust/ChangeLog:

[COMMITTED 032/145] gccrs: Change lookup_hir_extern_item return type

2025-03-17 Thread arthur . cohen
From: Pierre-Emmanuel Patry Wrap the return type with an optional and make the return type a pair with the parent hid. gcc/rust/ChangeLog: * backend/rust-compile-resolve-path.cc (HIRCompileBase::query_compile): Adapt code around new return type. * checks/errors/rust-cons

[COMMITTED 029/145] gccrs: Change return type of lookup_defid

2025-03-17 Thread arthur . cohen
From: Pierre-Emmanuel Patry Change the return type to an optional. gcc/rust/ChangeLog: * backend/rust-compile-base.cc (HIRCompileBase::resolve_method_address): Change calling code to accomodate new return type. * checks/errors/privacy/rust-privacy-reporter.cc: Li

[COMMITTED 027/145] gccrs: Change crate_num_to_nodeid return type

2025-03-17 Thread arthur . cohen
From: Pierre-Emmanuel Patry Change the function's return type to an optional. gcc/rust/ChangeLog: * resolve/rust-ast-resolve-toplevel.h: Adapt the code to the new return type. * rust-session-manager.cc (Session::load_extern_crate): Likewise. * util/rust-hir-map.c

[COMMITTED 045/145] gccrs: Change lookup_canonical_path's return path

2025-03-17 Thread arthur . cohen
From: Pierre-Emmanuel Patry Change the function's return type to wrap it within an optional. gcc/rust/ChangeLog: * backend/rust-compile-base.cc: Change call site to accomodate new return type. * backend/rust-compile-base.h: Change parameter to use a reference. *

[COMMITTED 038/145] gccrs: Change lookup_hir_generic_param return type

2025-03-17 Thread arthur . cohen
From: Pierre-Emmanuel Patry Wrap the function's return type with an optional. gcc/rust/ChangeLog: * util/rust-hir-map.cc (Mappings::insert_hir_generic_param): Change call site to accomodate the new return type. (Mappings::lookup_hir_generic_param): Wrap the function's re

[COMMITTED 043/145] gccrs: Change lookup_hir_struct_field return type

2025-03-17 Thread arthur . cohen
From: Pierre-Emmanuel Patry Wrap the function's return type within an optional to differentiate between a null pointer and a missing value. gcc/rust/ChangeLog: * util/rust-hir-map.cc (Mappings::insert_hir_struct_field): Change call site to accomodate new return type. (Ma

[COMMITTED 040/145] gccrs: Change lookup_hir_smt's return type with optional

2025-03-17 Thread arthur . cohen
From: Pierre-Emmanuel Patry Wrap the function's return type within an optional in order to differentiate missing values from null pointers. gcc/rust/ChangeLog: * util/rust-hir-map.cc (Mappings::insert_hir_stmt): Change call site to accomodate new return type. (Mappings::

[COMMITTED 036/145] gccrs: Change lookup_hir_expr return type to optional

2025-03-17 Thread arthur . cohen
From: Pierre-Emmanuel Patry Wrap the function's return type with an optional in order to differentiate missing values from null pointers. gcc/rust/ChangeLog: * backend/rust-mangle-v0.cc (v0_path): Adapt call site to new returned type. * util/rust-hir-map.cc (Mappings::lo

[COMMITTED 024/145] gccrs: Change return type for lookup_hir_impl_block

2025-03-17 Thread arthur . cohen
From: Pierre-Emmanuel Patry Change the return type to an optiona. This allows to differentiate between missing hir impl block and null pointers. gcc/rust/ChangeLog: * typecheck/rust-type-util.cc (query_type): Change call to the function in order to accomodate the new return type

[COMMITTED 046/145] gccrs: Change lookup_macro_def return type

2025-03-17 Thread arthur . cohen
From: Pierre-Emmanuel Patry Wrap the function's return type within an optional. gcc/rust/ChangeLog: * resolve/rust-early-name-resolver-2.0.cc (Early::insert_once): Change call site to accomodate the new return type. (Early::visit): Likewise. * resolve/rust-early-

[COMMITTED 050/145] gccrs: mingw: Fix build with patch from Liu Hao

2025-03-17 Thread arthur . cohen
From: Arthur Cohen This commit adds Liu Hao's patch from https://github.com/lhmouse/MINGW-packages/blob/5859d27b2b6101204a08ad9702cb2937f8797be9/mingw-w64-gcc/0100-rust-fix.patch gcc/rust/ChangeLog: * checks/errors/borrowck/rust-borrow-checker.cc (mkdir_wrapped): R

[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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 021/145] gccrs: Change return type for lookup_hir_item to optional

2025-03-17 Thread arthur . cohen
From: Pierre-Emmanuel Patry gcc/rust/ChangeLog: * backend/rust-compile-resolve-path.cc (HIRCompileBase::query_compile): Adapt function call to new return type. * backend/rust-mangle-v0.cc (v0_path): Likewise. * checks/errors/rust-const-checker.cc (ConstChecker::c

[COMMITTED 030/145] gccrs: Change lookup_local_defid return type to optional

2025-03-17 Thread arthur . cohen
From: Pierre-Emmanuel Patry Make the API more convenient by changing the function's return type. We can now differentiate between a stored null pointer and a missing value. gcc/rust/ChangeLog: * util/rust-hir-map.cc (Mappings::insert_defid_mapping): Adapt call to new return type

[COMMITTED 031/145] gccrs: Change return type of lookup trait defid functions.

2025-03-17 Thread arthur . cohen
From: Pierre-Emmanuel Patry Wrap the return type with an optional. gcc/rust/ChangeLog: * backend/rust-compile-base.cc (HIRCompileBase::resolve_method_address): Update code around lookup return type. * typecheck/rust-tyty-bounds.cc (TypeCheckBase::get_predicate_from_boun

[COMMITTED 033/145] gccrs: Change lookup_module function return type

2025-03-17 Thread arthur . cohen
From: Pierre-Emmanuel Patry Wrap the return type into an optional. gcc/rust/ChangeLog: * checks/errors/privacy/rust-visibility-resolver.cc: Update function call to match the new return type. * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_root_path):

[COMMITTED 028/145] gccrs: Change crate name retrieval function return types

2025-03-17 Thread arthur . cohen
From: Pierre-Emmanuel Patry Change their return type to a const reference in order to avoid copies when possible. Also wrap this new return type into an optional. gcc/rust/ChangeLog: * checks/errors/borrowck/rust-borrow-checker.cc (BorrowChecker::go): Adapt the code to the new r

[COMMITTED 035/145] gccrs: Change lookup_hir_implitem return type

2025-03-17 Thread arthur . cohen
From: Pierre-Emmanuel Patry Wrap the return type within an optional. Now return the parent id within a pair instead of taking an out reference. gcc/rust/ChangeLog: * backend/rust-compile-item.cc (CompileItem::visit): Change call site to accept new return type. * backend/

[COMMITTED 037/145] gccrs: Change lookup_hir_path_expr_seg return type

2025-03-17 Thread arthur . cohen
From: Pierre-Emmanuel Patry Make the function's return type optional in order to differentiate between null pointers and missing value. gcc/rust/ChangeLog: * util/rust-hir-map.cc (Mappings::insert_hir_path_expr_seg): Change call site to accomodate the new return type. (M

[COMMITTED 039/145] gccrs: Change lookup_hir_type return type with an optional

2025-03-17 Thread arthur . cohen
From: Pierre-Emmanuel Patry Wrap the function's return type with an optional in order to tell appart a null pointer from a missing value. gcc/rust/ChangeLog: * util/rust-hir-map.cc (Mappings::insert_hir_type): Change call site to accomodate the new return type. (Mappings

[COMMITTED 025/145] gccrs: Change return type of lookup_impl_block_type

2025-03-17 Thread arthur . cohen
From: Pierre-Emmanuel Patry Change the return type to an optional. gcc/rust/ChangeLog: * typecheck/rust-type-util.cc (query_type): Adapt code to accomodate the new return type. * util/rust-hir-map.cc (Mappings::lookup_impl_block_type): Change the function's retur

[COMMITTED 020/145] gccrs: Change return type of resolve_nodeid_to_stmt

2025-03-17 Thread arthur . cohen
From: Pierre-Emmanuel Patry Change the return type to an optional. gcc/rust/ChangeLog: * util/rust-hir-map.cc (Mappings::resolve_nodeid_to_stmt): Change the return type and remove pointer out argument. * util/rust-hir-map.h: Update function prototype. Signed-off-by: Pie

[COMMITTED 001/145] gccrs: contrib: Add libgrust to update-copyright.py script

2025-03-17 Thread arthur . cohen
From: Sahil Yeole contrib/ChangeLog: * update-copyright.py: Add libgrust folder. Signed-off-by: Sahil Yeole --- contrib/update-copyright.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/contrib/update-copyright.py b/contrib/update-copyright.py index 0e45609d5eb..838c44f33eb 100

[COMMITTED 041/145] gccrs: Change lookup_hir_param return type with optional

2025-03-17 Thread arthur . cohen
From: Pierre-Emmanuel Patry Wrap the function's return type within an optional to differentiate between a null ppointer and a missing value. gcc/rust/ChangeLog: * util/rust-hir-map.cc (Mappings::insert_hir_param): Change call site to accomodate new return type. (Mappings

[COMMITTED 009/145] gccrs: borrowck: Testsuite

2025-03-17 Thread arthur . cohen
From: Jakub Dupak gcc/testsuite/ChangeLog: * rust/borrowck/borrowck.exp: New test. * rust/borrowck/position_dependant_outlives.rs: New test. * rust/borrowck/reference.rs: New test. * rust/borrowck/return_ref_to_local.rs: New test. * rust/borrowck/subset.rs

[COMMITTED 013/145] gccrs: Remove unused Context parameter for some backend methods

2025-03-17 Thread arthur . cohen
From: Owen Avery gcc/rust/ChangeLog: * backend/rust-compile-base.cc (HIRCompileBase::compile_function_body): Adjust unit_expression calls. (HIRCompileBase::unit_expression): Remove unused Context parameter. * backend/rust-compile-base.h (HI

<    7   8   9   10   11   12   13   14   15   >