[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/r

[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 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-polonius

[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

[Bug rust/117869] rust fails to build with cargo command error

2025-03-31 Thread sjames at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117869 --- Comment #3 from Sam James --- Since r15-9083-gd560f3f9594339, 1.49 should work again, but it needs documenting still. -- You are receiving this mail because: You are on the CC list for the bug.

[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: