[Bug rust/119508] Hundreds of rust tests XPASS

2025-04-08 Thread mark at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119508 Mark Wielaard changed: What|Removed |Added Status|NEW |RESOLVED Resolution|---

[Bug rust/119508] Hundreds of rust tests XPASS

2025-04-08 Thread tschwinge at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119508 --- Comment #8 from Thomas Schwinge --- GCC/Rust master branch commit b9aaa6192f3310a0cb26f7773b31703a8c9c544c "nr2.0: Improve test script" you mean? Yes, likely -- but that's not yet in upstream GCC. -- You are receiving this mail because: Y

[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

[Bug rust/119508] Hundreds of rust tests XPASS

2025-04-08 Thread pierre-emmanuel.patry at embecosm dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119508 --- Comment #7 from Pierre-Emmanuel Patry --- 89ca1e3cb697a87f02682a1fb1f62f02d0671c57 Should have fixed this. -- You are receiving this mail because: You are on the CC list for the bug.

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

[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 17/32] gccrs: Resolve labels

2025-04-08 Thread arthur . cohen
From: Pierre-Emmanuel Patry gcc/rust/ChangeLog: * hir/rust-ast-lower.cc (ASTLoweringBlock::visit): Lower label only if it exists. * hir/tree/rust-hir-expr.cc (BlockExpr::BlockExpr): Make loop label optional. (BaseLoopExpr::BaseLoopExpr): Likewise.

[COMMITTED 32/32] gccrs: nr2.0: Adjust test macro6.rs

2025-04-08 Thread arthur . cohen
From: Owen Avery gcc/testsuite/ChangeLog: * rust/compile/macros/mbe/macro6.rs: Remove call of undefined function. * rust/compile/nr2/exclude: Remove macros/mbe/macro6.rs. Signed-off-by: Owen Avery --- gcc/testsuite/rust/compile/macros/mbe/macro6.rs | 2 +- gcc/testsuit

[COMMITTED 27/32] gccrs: Change optional to expected for parse_loop_label

2025-04-08 Thread arthur . cohen
From: Pierre-Emmanuel Patry gcc/rust/ChangeLog: * parse/rust-parse-impl.h (Parser::parse_loop_label): Change function return type to expected. (Parser::parse_labelled_loop_expr): Adapt call location to new return type. * parse/rust-parse.h (enum class): Up

[COMMITTED 28/32] gccrs: Rename label getter in ContinueExpr

2025-04-08 Thread arthur . cohen
From: Pierre-Emmanuel Patry gcc/rust/ChangeLog: * ast/rust-ast-collector.cc (TokenCollector::visit): Call unchecked getter. * ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Likewise. * ast/rust-ast.cc (ContinueExpr::as_string): Likewise. * hir

[COMMITTED 23/32] gccrs: Migrate error state to optionals

2025-04-08 Thread arthur . cohen
From: Pierre-Emmanuel Patry gcc/rust/ChangeLog: * ast/rust-ast-builder.cc (Builder::self_ref_param): Remove error state and use optional. * ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Check label before visiting. * ast/rust-ast.cc (ContinueExpr::as

[COMMITTED 24/32] gccrs: Fix unresolved label error message

2025-04-08 Thread arthur . cohen
From: Pierre-Emmanuel Patry gcc/rust/ChangeLog: * resolve/rust-ast-resolve-expr.cc (ResolveExpr::visit): Change error message to match rustc. gcc/testsuite/ChangeLog: * rust/compile/undeclared_label.rs: Change test expected string. Signed-off-by: Pierre-Emmanue

[COMMITTED 26/32] gccrs: Adapt testcase to name resolution 2.0

2025-04-08 Thread arthur . cohen
From: Pierre-Emmanuel Patry Name resolution 2.0 behavior matches more closely rustc's behavior and trying to prevent undeclared label error emission would break some other test. gcc/testsuite/ChangeLog: * rust/compile/invalid_label_name.rs: Adapt test to nr2. Signed-off-by: Pierre-Emma

[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 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 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 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 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 (ASTLowerImplItem::visi

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