[COMMITTED 035/144] gccrs: emit error code for E0758

2025-03-19 Thread arthur . cohen
From: Raiki Tamura gcc/rust/ChangeLog: * lex/rust-lex.cc (Lexer::build_token): Emit error code. * lex/rust-lex.h: Fix comment. Signed-off-by: Raiki Tamura --- gcc/rust/lex/rust-lex.cc | 9 ++--- gcc/rust/lex/rust-lex.h | 9 + 2 files changed, 11 insertions(+), 7 d

[COMMITTED 029/144] gccrs: ast: Introduce class hierarchy for lang item paths

2025-03-19 Thread arthur . cohen
From: Arthur Cohen Create a base Path class which is derived into two children classes for regular paths and lang item paths. This allows it to hold either the segments of a fully formed path, or the node ID of a lang-item path. This is required in order to create these special paths which do not

[COMMITTED 019/144] gccrs: Simplify construction of BIR::Statement

2025-03-19 Thread arthur . cohen
From: Kushal Pal gcc/rust/ChangeLog: * checks/errors/borrowck/rust-bir-builder-internal.h: Use `make_*` functions to create BIR::Statements. * checks/errors/borrowck/rust-bir.h: Make a complete constructor and introduce `make_*` functions to create various

[COMMITTED 122/144] rust: fix ICE during name resolution for impls on unit-types

2025-03-19 Thread arthur . cohen
From: Philip Herron The canonical paths need to support unit-types which are technically a TupleType with no fields. This handles this case and adds an unreachable. Fixes #3036 gcc/rust/ChangeLog: * resolve/rust-ast-resolve-type.cc (ResolveTypeToCanonicalPath::visit): add unit-type ca

[COMMITTED 057/144] gccrs: Make inline mov compiles

2025-03-19 Thread arthur . cohen
From: badumbatish gcc/rust/ChangeLog: * backend/rust-compile-asm.cc (CompileAsm::asm_build_expr): Remove debug * expand/rust-macro-builtins-asm.cc (expand_inline_asm_strings): properly formatted via rust instead of c (parse_asm): formatted comment

[COMMITTED 043/144] gccrs: Scaffolding new compile-asm files

2025-03-19 Thread arthur . cohen
From: badumbatish gcc/rust/ChangeLog: * Make-lang.in: Scaffolding new compile-asm files * backend/rust-compile-expr.cc (CompileExpr::visit): Likewise * hir/tree/rust-hir-expr.h: Likewise * backend/rust-compile-asm.cc: New file. Likewise * backend/r

[COMMITTED 128/144] gccrs: Handle TypeAlias during toplevel resolution 2.0

2025-03-19 Thread arthur . cohen
From: Owen Avery gcc/rust/ChangeLog: * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit): Handle TypeAlias. * resolve/rust-toplevel-name-resolver-2.0.h (TopLevel::visit): Likewise. gcc/testsuite/ChangeLog: * rust/compile/nr2/exclude: Remove ty

[COMMITTED 040/144] gccrs: Make sure CompileExpr::visit is reached

2025-03-19 Thread arthur . cohen
From: jjasmine gcc/rust/ChangeLog: * hir/tree/rust-hir.cc (InlineAsm::accept_vis): Make sure CompileExpr::visit is reached * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Likewise gcc/testsuite/ChangeLog: * rust/compile/inline_asm_compile_

[COMMITTED 125/144] gccrs: Fix ICE when typechecking non-trait item when we expect one

2025-03-19 Thread arthur . cohen
From: Philip Herron We just had an assertion here for this case where we expect a trait. This changes the assertion into error handling producing the correct error code with fixit suggestion like rustc. Fixes #2499 gcc/rust/ChangeLog: * typecheck/rust-hir-trait-resolve.cc (TraitResolv

[COMMITTED 127/144] gccrs: Fix some issues with canonical path fetching in name resolution 2.0

2025-03-19 Thread arthur . cohen
From: Owen Avery gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-enumitem.cc: Add includes. (TypeCheckEnumItem::visit): Fetch canonical paths properly when name resolution 2.0 is enabled. * typecheck/rust-hir-type-check-implitem.cc: Add includes. (Type

[COMMITTED 124/144] gccrs: Add test case to show ICE is fixed

2025-03-19 Thread arthur . cohen
From: Philip Herron This was resolved in: 18422c9c386 which was missing the name resolution step for unit-types. Fixes #2203 gcc/testsuite/ChangeLog: * rust/compile/nr2/exclude: * rust/compile/issue-2203.rs: New test. Signed-off-by: Philip Herron --- gcc/testsuite/rust/compi

[COMMITTED 048/144] gccrs: Added new test for prep of output {}

2025-03-19 Thread arthur . cohen
From: badumbatish gcc/testsuite/ChangeLog: * rust/compile/inline_asm_parse_output_operand.rs: New test. --- .../compile/inline_asm_parse_output_operand.rs | 18 ++ 1 file changed, 18 insertions(+) create mode 100644 gcc/testsuite/rust/compile/inline_asm_parse_output_op

[COMMITTED 018/144] gccrs: Loan errors with locations

2025-03-19 Thread arthur . cohen
From: Kushal Pal gcc/rust/ChangeLog: * checks/errors/borrowck/rust-borrow-checker-diagnostics.cc (BorrowCheckerDiagnostics::report_loan_errors): Add label to where the borrow occurs and where the invalid access occurs. (BorrowCheckerDiagnostics::get_statement):

[COMMITTED 066/144] gccrs: Strong type LoanId

2025-03-19 Thread arthur . cohen
From: Kushal Pal gcc/rust/ChangeLog: * checks/errors/borrowck/rust-bir-dump.cc (Dump::visit): Use new API, i.e get_loan_id() instead of get_loan(). * checks/errors/borrowck/rust-bir-fact-collector.h (points): Use value of LoanId in Polonius facts. * checks

[COMMITTED 023/144] gccrs: Map locations to placeholder regions

2025-03-19 Thread arthur . cohen
From: Kushal Pal Mapped placeholder regions to their respective HIR nodes so we can fetch locations during error reporting. gcc/rust/ChangeLog: * checks/errors/borrowck/rust-bir-builder.h: Map regions to their respective HIR nodes. * checks/errors/borrowck/rust-bir.h (st

[COMMITTED 025/144] gccrs: Move errors with locations

2025-03-19 Thread arthur . cohen
From: Kushal Pal gcc/rust/ChangeLog: * checks/errors/borrowck/rust-borrow-checker-diagnostics.cc (BorrowCheckerDiagnostics::report_move_errors): Specify locations for code causing errors and related moves. gcc/testsuite/ChangeLog: * rust/borrowck/test_move.rs: T

[COMMITTED 027/144] gccrs: ast: PathPattern: Remove `remove_all_segments` method

2025-03-19 Thread arthur . cohen
From: Arthur Cohen This method was used only for stripping PathPattern AST nodes during `cfg-strip`, which seems like a misnomer and makes it a good candidate for simplification. gcc/rust/ChangeLog: * ast/rust-path.h (class PathInExpression): Remove `remove_all_segments` method,

[COMMITTED 038/144] gccrs: Fix the parser's operand and flags storage

2025-03-19 Thread arthur . cohen
From: badumbatish gcc/rust/ChangeLog: * expand/rust-macro-builtins-asm.cc (parse_reg_operand): Fix parsing logic & reassignment logic (parse_reg_operand_in): Fix parsing (parse_reg_operand_out): Fix parsing (parse_reg_operand_inout): Fix parsing (p

[COMMITTED 042/144] gccrs: Setting up interfaces for codegen

2025-03-19 Thread arthur . cohen
From: jjasmine gcc/rust/ChangeLog: * backend/rust-compile-expr.cc (CompileExpr::visit): Setting up interfaces for codegen * hir/tree/rust-hir-expr.h: Likewise. --- gcc/rust/backend/rust-compile-expr.cc | 6 -- gcc/rust/hir/tree/rust-hir-expr.h | 26 +

[COMMITTED 082/144] gccrs: Create new test system for name resolution 2.0

2025-03-19 Thread arthur . cohen
From: Owen Avery This runs the standard compile/**.rs tests with name resolution 2.0 enabled. The exclude file can be used to exclude tests which are not yet working with name resolution 2.0. gcc/testsuite/ChangeLog: * rust/compile/nr2/compile.exp: New test. * rust/compile/nr2/e

[COMMITTED 049/144] gccrs: Added counting to check for asm_construct_outputs

2025-03-19 Thread arthur . cohen
From: badumbatish gcc/rust/ChangeLog: * backend/rust-compile-asm.cc (CompileAsm::asm_construct_outputs): Set up counting to check --- gcc/rust/backend/rust-compile-asm.cc | 7 +++ 1 file changed, 7 insertions(+) diff --git a/gcc/rust/backend/rust-compile-asm.cc b/gcc/rust/

[COMMITTED 041/144] gccrs: Local testing for build_string and debug()

2025-03-19 Thread arthur . cohen
From: jjasmine gcc/rust/ChangeLog: * backend/rust-compile-expr.cc (CompileExpr::visit): Local testing for build_string and debug() --- gcc/rust/backend/rust-compile-expr.cc | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gcc/rust/backend/rust-compile-expr

[COMMITTED 014/144] gccrs: Add location support to BIR::Statement

2025-03-19 Thread arthur . cohen
From: Kushal Pal This commit adds location_t to BIR::Statement where type is ASSIGNMENT this information will be later used for reporting borrow-checking errors. gcc/rust/ChangeLog: * checks/errors/borrowck/rust-bir-builder-expr-stmt.cc (ExprStmtBuilder::visit): Added location p

[COMMITTED 031/144] gccrs: attributes: Start handling prelude_import properly

2025-03-19 Thread arthur . cohen
From: Arthur Cohen This commit adds basic handling for the `#[prelude_import]` attribute, without doing anything functionality wise. gcc/rust/ChangeLog: * checks/errors/rust-feature-gate.cc (FeatureGate::visit): Add base feature gating for `#[feature(prelude_import)]`. *

[COMMITTED 050/144] gccrs: Start work on expand inline asm

2025-03-19 Thread arthur . cohen
From: badumbatish gcc/rust/ChangeLog: * expand/rust-macro-builtins-asm.cc (parse_reg_operand): Remove warnings (parse_reg_operand_out): Remove warnings (expand_inline_asm): New function for eventual expansion (parse_asm): Use expand_inline_asm gcc/testsui

[COMMITTED 059/144] gccrs: Rehaul, Apply code review from Arthur

2025-03-19 Thread arthur . cohen
From: badumbatish gcc/rust/ChangeLog: * backend/rust-compile-asm.cc (CompileAsm::visit): Change API, public/private, comments, formatting from code review (CompileAsm::asm_build_expr): Likewise. (CompileAsm::tree_codegen_asm): Likewise. * backend/r

[COMMITTED 143/144] gccrs: Use name resolver 2.0 in pattern checker

2025-03-19 Thread arthur . cohen
From: Owen Avery gcc/rust/ChangeLog: * checks/errors/rust-hir-pattern-analysis.cc: Add includes. (PatternChecker::visit): Use name resolver 2.0 when enabled. Signed-off-by: Owen Avery --- .../checks/errors/rust-hir-pattern-analysis.cc | 16 +++- 1 file changed, 1

[COMMITTED 063/144] gccrs: Strong type PlaceId

2025-03-19 Thread arthur . cohen
From: Kushal Pal gcc/rust/ChangeLog: * checks/errors/borrowck/rust-bir-dump.cc (renumber_places): Use value of PlaceId as index. (Dump::visit_place): Likewise. (Dump::visit_scope): Likewise. (Dump::go): Refill `place_map` with for loop instead of u

[COMMITTED 108/144] gccrs: Add default resolver parent functions by default

2025-03-19 Thread arthur . cohen
From: Pierre-Emmanuel Patry gcc/rust/ChangeLog: * resolve/rust-finalize-imports-2.0.h: Add parent member functions from default resolver. Signed-off-by: Pierre-Emmanuel Patry --- gcc/rust/resolve/rust-finalize-imports-2.0.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a

[COMMITTED 070/144] gccrs: Used `IndexVec` for Scopes

2025-03-19 Thread arthur . cohen
From: Kushal Pal gcc/rust/ChangeLog: * checks/errors/borrowck/rust-bir-place.h: Used `IndexVec` with ScopeId as index. Signed-off-by: Kushal Pal --- .../checks/errors/borrowck/rust-bir-place.h | 25 +-- 1 file changed, 12 insertions(+), 13 deletions(-) diff

[COMMITTED 067/144] gccrs: Strong type ScopeId

2025-03-19 Thread arthur . cohen
From: Kushal Pal gcc/rust/ChangeLog: * checks/errors/borrowck/rust-bir-builder-expr-stmt.cc (ExprStmtBuilder::setup_loop): Use value of ScopeId. (ExprStmtBuilder::visit): Use continue scope id instead of continue basic block id. * checks/errors/borrowck/ru

[COMMITTED 141/144] gccrs: Use name resolver 2.0 in const checker

2025-03-19 Thread arthur . cohen
From: Owen Avery gcc/rust/ChangeLog: * checks/errors/rust-const-checker.cc: Add includes. (ConstChecker::visit): Use name resolver 2.0 to lookup function definitions when name resolution 2.0 is enabled. gcc/testsuite/ChangeLog: * rust/compile/nr2/exclude: Remove

[COMMITTED 117/144] gccrs: Add box definition to avoid error

2025-03-19 Thread arthur . cohen
From: Pierre-Emmanuel Patry Box definition is part of the standard library and cannot be found during name resolution. This simple definition prevent any error from being emitted. gcc/testsuite/ChangeLog: * rust/compile/box_syntax_feature_gate.rs: Add box land item definition.

Код безопасности для учетной записи Майкрософт

2025-03-19 Thread Служба технической поддержки учетных записей Майкрософт
Используйте для учетной записи Майкрософт gc**t...@gcc.gnu.org следующий код безопасности. Код безопасности: 141211 Если вы не узнаете учетную запись Майкрософт gc**t...@gcc.gnu.org, вы можете щелкнуть https://account.live.com/dp?ft=-DtmAsBRNn4g995WFEbyX5qTs*mnIihUdmpS8hg3sA3c

Подтверждение безопасности учетной записи Майкрософт

2025-03-19 Thread Служба технической поддержки учетных записей Майкрософт
Здравствуйте, Rust! Ваша учетная запись gcc-rust@gcc.gnu.org будет закрыта 18.04.2025. Нам жалко, что вы нас покидаете. Если вы передумаете и решите продолжить пользоваться этой учетной записью Майкрософт, просто войдите в нее до 18.04.2025. Ваши файлы, данные и сведения не будут удаляться до эт

Проверка адреса электронной почты

2025-03-19 Thread Служба технической поддержки учетных записей Майкрософт
Учетная запись Майкрософт Проверка адреса электронной почты Чтобы завершить настройку учетной записи Майкрософт, нам нужно убедиться, что это ваш адрес электронной почты. Для проверки адреса электронной почты используйте этот код безопасности: 367853 Если вы не запрашивали этот код, можете сме

Проверка адреса электронной почты

2025-03-19 Thread Служба технической поддержки учетных записей Майкрософт
Учетная запись Майкрософт Проверка адреса электронной почты Чтобы завершить настройку учетной записи Майкрософт, нам нужно убедиться, что это ваш адрес электронной почты. Для проверки адреса электронной почты используйте этот код безопасности: 409181 Если вы не запрашивали этот код, можете сме

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

2025-03-19 Thread Andrew Pinski
This moves is_floating_point over to using FLOAT_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/

[COMMITTED 088/144] gccrs: Remove some overloaded methods from DefaultResolver.

2025-03-19 Thread arthur . cohen
From: Owen Avery gcc/rust/ChangeLog: * resolve/rust-default-resolver.cc (DefaultResolver::visit): Remove some empty overloads which DefaultASTVisitor::visit should be able to handle. * resolve/rust-default-resolver.h (DefaultResolver::visit): Likewise. gc

[PATCH v2 0/4] rust: Small cleanups of rust-gcc.cc

2025-03-19 Thread Andrew Pinski
This is a set of 4 patches that do some small cleanups of rust-gcc.cc The first patch might fix a bug in some cases but I am not 100% sure since I suspect complex types here might only be floating point types but who knows. The rest are using GCC's checks better or just other small changes that hel

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

2025-03-19 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

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

2025-03-19 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119333 Andrew Pinski changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

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

2025-03-19 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

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

2025-03-19 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::

[COMMITTED 115/144] gccrs: Make node id getter const.

2025-03-19 Thread arthur . cohen
From: Pierre-Emmanuel Patry gcc/rust/ChangeLog: * ast/rust-ast.h: Node id getter could be const. Signed-off-by: Pierre-Emmanuel Patry --- gcc/rust/ast/rust-ast.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/rust/ast/rust-ast.h b/gcc/rust/ast/rust-ast.h index

[COMMITTED 138/144] gccrs: Use name resolver 2.0 in MarkLive

2025-03-19 Thread arthur . cohen
From: Owen Avery gcc/rust/ChangeLog: * checks/lints/rust-lint-marklive.cc (MarkLive::visit_path_segment): Use name resolver 2.0 when enabled. (MarkLive::visit): Likewise. Signed-off-by: Owen Avery --- gcc/rust/checks/lints/rust-lint-marklive.cc | 31 +++

[COMMITTED 110/144] gccrs: Move failing test to xfail

2025-03-19 Thread arthur . cohen
From: Pierre-Emmanuel Patry We want to begin experimenting with this new name resolution 2.0 algorithm as soon as possible. This test highlight a problem where the compiler should emit an error and should be fixed soon. gcc/testsuite/ChangeLog: * rust/compile/name_resolution21.rs: Move

[Bug rust/119353] [15 regression] Rust fails to build (build failure: error[E0554]: `#![feature]` may not be used on the stable release channel)

2025-03-19 Thread cohenarthur at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119353 --- Comment #9 from Arthur Cohen --- This should now be fixed by our latest patch upload. If anyone would like to try again and report back please do, and I'll close this out -- You are receiving this mail because: You are on the CC list for t

[COMMITTED 078/144] gccrs: Emit error on auto-traits

2025-03-19 Thread arthur . cohen
From: "benjamin.thos" Throw an error when auto-traits used without feature attribute. gcc/rust/ChangeLog: * checks/errors/rust-feature-gate.cc (FeatureGate::visit): Emit error on trait when auto field member true. * checks/errors/rust-feature-gate.h: add prototype of tra

[Bug rust/119353] [15 regression] Rust fails to build (build failure: error[E0554]: `#![feature]` may not be used on the stable release channel)

2025-03-19 Thread doko at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119353 --- Comment #8 from Matthias Klose --- mentioned on irc, #gcc: https://github.com/Rust-GCC/gccrs/commit/1bd6cdbd8d2a6e0bfaaf5c8ef61ca453f09899cf that works for me on x86_64-linux-gnu at least -- You are receiving this mail because: You are on

[Bug rust/119353] [15 regression] Rust fails to build (build failure: error[E0554]: `#![feature]` may not be used on the stable release channel)

2025-03-19 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119353 Eric Botcazou changed: What|Removed |Added CC||ebotcazou at gcc dot gnu.org

[COMMITTED 134/144] gccrs: Provide input operand for gccrs

2025-03-19 Thread arthur . cohen
From: badumbatish gcc/rust/ChangeLog: * backend/rust-compile-asm.cc (CompileAsm::asm_construct_inputs): Provide input operand for gccrs * expand/rust-macro-builtins-asm.cc (parse_reg_operand_in): Move expr to In (expand_inline_asm_strings): Add com

[COMMITTED 135/144] gccrs: Fix compiler error on ast wrong implicit construct push_back

2025-03-19 Thread arthur . cohen
From: badumbatish gcc/rust/ChangeLog: * expand/rust-macro-builtins-asm.cc (parse_reg_operand_in): Fix compiler error on ast wrong implicit construct push_back --- gcc/rust/expand/rust-macro-builtins-asm.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gcc

[COMMITTED 139/144] gccrs: Make const references to ForeverStack more useful

2025-03-19 Thread arthur . cohen
From: Owen Avery gcc/rust/ChangeLog: * resolve/rust-forever-stack.h (ForeverStack::to_canonical_path): Make const. (ForeverStack::to_rib): Add const overload. (ForeverStack::reverse_iter): Add const overloads. (ForeverStack::ConstDfsResult): Add. (

[COMMITTED 144/144] gccrs: Handle external static items in toplevel resolver 2.0

2025-03-19 Thread arthur . cohen
From: Owen Avery gcc/rust/ChangeLog: * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit): Handle ExternalStaticItem. * resolve/rust-toplevel-name-resolver-2.0.h (TopLevel::visit): Likewise. Signed-off-by: Owen Avery --- gcc/rust/resolve/rust-toplevel

[COMMITTED 083/144] gccrs: Check if the type has been correctly resolved

2025-03-19 Thread arthur . cohen
From: Pierre-Emmanuel Patry We did not check the optional was valid, this lead to rogue dereference and undefined behaviors. gcc/rust/ChangeLog: * resolve/rust-late-name-resolver-2.0.cc (Late::visit): Add optional check. Signed-off-by: Pierre-Emmanuel Patry --- gcc/rust/resol

[COMMITTED 089/144] rust: fix ICE when compiling impl block for !

2025-03-19 Thread arthur . cohen
From: Philip Herron We need to resolve the never type which is its own special AST node so it doesnt magically get handled like the regular builtin type paths such as i32. Fixes #3035 gcc/rust/ChangeLog: * resolve/rust-ast-resolve-type.cc (ResolveType::visit): handle never type

[COMMITTED 136/144] gccrs: Disambiguate generic args during name resolution 2.0

2025-03-19 Thread arthur . cohen
From: Owen Avery gcc/rust/ChangeLog: * resolve/rust-late-name-resolver-2.0.cc (Late::visit): Visit GenericArgs and GenericArg, the former because the latter involves a non-virtual member function call. * resolve/rust-late-name-resolver-2.0.h (Late::visit):

[COMMITTED 086/144] gccrs: adjust hir dump of BlockExpr

2025-03-19 Thread arthur . cohen
From: Marc Poulhiès Add tail_reachable and label fields to the dump. gcc/rust/ChangeLog: * hir/rust-hir-dump.cc (Dump::visit): Add missing fields. Signed-off-by: Marc Poulhiès --- gcc/rust/hir/rust-hir-dump.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gcc/rust/hir/rust-hi

[COMMITTED 098/144] gccrs: imports: Make FinalizeImports a resolver visitor as well

2025-03-19 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * resolve/rust-finalize-imports-2.0.cc (FinalizeImports::go): Turn static method into method. (FinalizeImports::visit): New. * resolve/rust-finalize-imports-2.0.h (class FinalizeImports): Make FinalizeImports a visito

[COMMITTED 062/144] gccrs: Avoid accidental insertion into map

2025-03-19 Thread arthur . cohen
From: Owen Avery gcc/rust/ChangeLog: * resolve/rust-ast-resolve-pattern.cc (PatternDeclaration::check_bindings_consistency): Check if outer_bindings_map contains an entry before indexing. Signed-off-by: Owen Avery --- gcc/rust/resolve/rust-ast-resolve-pattern.cc | 3 ++

[COMMITTED 090/144] gccrs: rust fix ICE when hir lowering qualified path expressions without an as

2025-03-19 Thread arthur . cohen
From: Philip Herron Qualified path expressions usually are ::... but the as is optional this adds the extra checking in hir lowering to not hit that nullptr. Fixes #3082 gcc/rust/ChangeLog: * hir/rust-ast-lower-type.cc (ASTLowerQualifiedPathInType::visit): check for valid as se

[COMMITTED 103/144] gccrs: Loop on expansion if a new export has been defined

2025-03-19 Thread arthur . cohen
From: Pierre-Emmanuel Patry When a use statement requires a reexported item it cannot find it in the same pass, an additional pass shall be performed. This means we need to detect whether a new item has been reexported and resolve until the end. gcc/rust/ChangeLog: * resolve/rust-early-

[COMMITTED 105/144] gccrs: Remove empty visit functions

2025-03-19 Thread arthur . cohen
From: Pierre-Emmanuel Patry We can let the default visitor visit those nodes anyway so we're sure all nodes can be reached. gcc/rust/ChangeLog: * resolve/rust-default-resolver.cc (DefaultResolver::visit): Remove empty visit function implementations. * resolve/rust-defaul

[COMMITTED 104/144] gccrs: Mark virtual function override in default resolver

2025-03-19 Thread arthur . cohen
From: Pierre-Emmanuel Patry Those function prototype were not marked as override and throwing warning. gcc/rust/ChangeLog: * resolve/rust-default-resolver.h: Make most visit function override. Signed-off-by: Pierre-Emmanuel Patry --- gcc/rust/resolve/rust-default-resolver.h | 178 +++

[COMMITTED 102/144] gccrs: Fix missing error on duplicated nodes

2025-03-19 Thread arthur . cohen
From: Pierre-Emmanuel Patry When we tried to insert a shadowable node and another shadowable node has been inserted before, we didn't emit any error if the node has already been inserted previously and failed silently. gcc/rust/ChangeLog: * resolve/rust-rib.cc (Rib::insert): Emit an err

[COMMITTED 106/144] gccrs: Remove regular visit code

2025-03-19 Thread arthur . cohen
From: Pierre-Emmanuel Patry Regular visit code can be replaced with default visit functions. gcc/rust/ChangeLog: * resolve/rust-default-resolver.cc (DefaultResolver::visit): Remove default visit code and replace it with call to default visitor. * resolve/rust-default-res

[COMMITTED 107/144] gccrs: Change lambda content with default visitor call

2025-03-19 Thread arthur . cohen
From: Pierre-Emmanuel Patry We can reduce code duplication by using the default visitor functions from within the scoped lambda function. gcc/rust/ChangeLog: * resolve/rust-default-resolver.cc (DefaultResolver::visit): Use default visitor instead. Signed-off-by: Pierre-Emmanuel

[COMMITTED 126/144] gccrs: Improve Rib::Definition shadowing

2025-03-19 Thread arthur . cohen
From: Owen Avery gcc/rust/ChangeLog: * resolve/rust-finalize-imports-2.0.cc (GlobbingVisitor::visit): Replace calls to insert_shadowable with insert_globbed. * resolve/rust-forever-stack.h (ForeverStack::insert_globbed): Add. * resolve/rust-forever

[COMMITTED 123/144] gccrs: add test case to show impl block on ! works

2025-03-19 Thread arthur . cohen
From: Philip Herron The resolution with ! was fixed in: 09cfe530f9c this adds a test case to show the other issue is also fixed. Fixes #2951 gcc/testsuite/ChangeLog: * rust/compile/nr2/exclude: nr2 is crashing here * rust/compile/issue-2951.rs: New test. Signed-off-by: Philip

[COMMITTED 130/144] gccrs: Insert static items into the value namespace

2025-03-19 Thread arthur . cohen
From: Owen Avery gcc/rust/ChangeLog: * backend/rust-compile-item.cc (CompileItem::visit): Check canonical path of StaticItem properly when name resolution 2.0 is enabled. * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit): Insert static items i

[COMMITTED 129/144] gccrs: Rework InlineAsmOperand

2025-03-19 Thread arthur . cohen
From: Owen Avery Not thrilled with some of this boilerplate, but it does seem like an improvement. gcc/rust/ChangeLog: * ast/rust-expr.h (InlineAsmOperand): Replace multiple mutually-exclusive tl::optional fields with a std::unique_ptr and modify nested classes to allow

[COMMITTED 051/144] gccrs: Move strip double quotes, add scaffold expand

2025-03-19 Thread arthur . cohen
From: badumbatish gcc/rust/ChangeLog: * backend/rust-compile-asm.cc (strip_double_quotes): Move strip double quotes to parse phase (CompileAsm::asm_construct_string_tree): Likewise * backend/rust-compile-asm.h (strip_double_quotes): Likewise * expand/rust-

[Bug rust/119353] [15 regression] Rust fails to build (build failure: error[E0554]: `#![feature]` may not be used on the stable release channel)

2025-03-19 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119353 Eric Botcazou changed: What|Removed |Added Status|NEW |RESOLVED Resolution|---

[COMMITTED 003/144] gccrs: [gccrs#3045] #[may_dangle] in safe impl

2025-03-19 Thread arthur . cohen
From: Liam Naddell gcc/rust/ChangeLog: * ast/rust-ast.cc: Fix Attribute constructors to copy inner_attribute * checks/errors/rust-unsafe-checker.cc: Add pass for #[may_dangle] in safe impl's * hir/rust-ast-lower-item.cc: Add support for unsafe impl'

[COMMITTED 005/144] gccrs: ffi-polonius: Remove usage of extern types.

2025-03-19 Thread arthur . cohen
From: Arthur Cohen This will allow us to revert our dependency on extern types, which would help our godbolt build as well as our various builders. gcc/rust/ChangeLog: * checks/errors/borrowck/ffi-polonius/src/gccrs_ffi.rs: Remove extern type feature. * checks/errors/bor

[PATCHSET] Update Rust frontend 19/03/2024 2/4

2025-03-19 Thread arthur . cohen
Hi everyone, This is the second of the patchsets we plan on upstreaming in the coming days. This one notably contains the commit which fixes PR119353, which had not yet been upstreamed but was present in our development repo for a while. We will continue working on improving our support for all di

[COMMITTED 002/144] gccrs: Add rustc test directory for testsuite adaptor

2025-03-19 Thread arthur . cohen
From: Muhammad Mahad gcc/testsuite/ChangeLog: * rust/rustc/README.md: information about rustc external directory. * rust/rustc/rustc.exp: New test. Signed-off-by: Muhammad Mahad --- gcc/testsuite/rust/rustc/README.md | 4 gcc/testsuite/rust/rustc/rustc.exp | 35 +

[COMMITTED 009/144] gccrs: Fix the parser's operand and flags storage

2025-03-19 Thread arthur . cohen
From: badumbatish gcc/rust/ChangeLog: * ast/rust-expr.h (struct InlineAsmOperand): Add construction for register_type * expand/rust-macro-builtins-asm.cc (parse_reg_operand): Fix parsing logic & reassignment logic (parse_reg_operand_in): Fix parsing

[COMMITTED 001/144] gccrs: Properly striping struct fields when using attrs

2025-03-19 Thread arthur . cohen
From: Antonio Gomes gcc/rust/ChangeLog: * expand/rust-cfg-strip.cc: Strip struct expr fields and strip fields in struct definition * expand/rust-cfg-strip.h: Signatures for new function maybe_strip_struct_expr_fields gcc/testsuite/ChangeLog: * rust/compile

[COMMITTED 109/144] gccrs: Make AST default visitor visit functions public

2025-03-19 Thread arthur . cohen
From: Pierre-Emmanuel Patry Make those functions public so they can be used within a lambda on GCC 4.8. gcc/rust/ChangeLog: * ast/rust-ast-visitor.h: Make visit functions public. Signed-off-by: Pierre-Emmanuel Patry --- gcc/rust/ast/rust-ast-visitor.h | 1 - 1 file changed, 1 deletio

[COMMITTED 093/144] gccrs: toplevel: Build list of imports for Early to resolve

2025-03-19 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * resolve/rust-toplevel-name-resolver-2.0.cc: Comment out handle_use call and error emission. * resolve/rust-toplevel-name-resolver-2.0.h: Create ImportKind class. --- .../rust-toplevel-name-resolver-2.0.cc| 37 +++-

[COMMITTED 113/144] gccrs: Update exclude list with working tests

2025-03-19 Thread arthur . cohen
From: Pierre-Emmanuel Patry gcc/testsuite/ChangeLog: * rust/compile/nr2/exclude: Remove working tests from nr2 exclude list. Signed-off-by: Pierre-Emmanuel Patry --- gcc/testsuite/rust/compile/nr2/exclude | 27 +- 1 file changed, 1 insertion(+), 26 deletions(-)

[COMMITTED 028/144] gccrs: ast: Remove PathExpr abstract class

2025-03-19 Thread arthur . cohen
From: Arthur Cohen Inherit directly from ExprWithoutBlock instead. gcc/rust/ChangeLog: * ast/rust-ast.h (class PathExpr): Remove class. * ast/rust-path.h (class PathInExpression): Inherit from ExprWithoutBlock. (class QualifiedPathInExpression): Likewise. --- gcc/rust/

[COMMITTED 058/144] gccrs: Fix return type of asm mov 5 to i32:0, tortured

2025-03-19 Thread arthur . cohen
From: badumbatish gcc/testsuite/ChangeLog: * rust/execute/inline_asm_mov_x_5.rs: Move to... * rust/execute/torture/inline_asm_mov_x_5.rs: ...here. --- gcc/testsuite/rust/execute/{ => torture}/inline_asm_mov_x_5.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) rename g

[COMMITTED 052/144] gccrs: Lower the HIR to tree with CompileExpr

2025-03-19 Thread arthur . cohen
From: badumbatish gcc/rust/ChangeLog: * backend/rust-compile-asm.cc (CompileAsm::asm_construct_outputs): Lower the HIR to tree with CompileExpr * backend/rust-compile-asm.h: Remove static from method --- gcc/rust/backend/rust-compile-asm.cc | 15 +++ gcc/rust

[COMMITTED 114/144] gccrs: Change resolved type segment

2025-03-19 Thread arthur . cohen
From: Pierre-Emmanuel Patry gcc/rust/ChangeLog: * resolve/rust-late-name-resolver-2.0.h: Add visit function prototype. * resolve/rust-late-name-resolver-2.0.cc (Late::visit): Change resolved type segment. Signed-off-by: Pierre-Emmanuel Patry --- gcc/rust/resolve/rust-l

[COMMITTED 120/144] gccrs: Remove some passing test from nr2 passing list

2025-03-19 Thread arthur . cohen
From: Pierre-Emmanuel Patry gcc/testsuite/ChangeLog: * rust/compile/nr2/exclude: Remove cast_generics.rs, issue-1131.rs, issue-1383.rs and unsafe10.rs Signed-off-by: Pierre-Emmanuel Patry --- gcc/testsuite/rust/compile/nr2/exclude | 4 1 file changed, 4 deletions(-) diff

[COMMITTED 056/144] gccrs: Use's array type when constring string tree

2025-03-19 Thread arthur . cohen
From: badumbatish gcc/rust/ChangeLog: * backend/rust-compile-asm.cc (CompileAsm::asm_build_expr): Use's array type when constring string tree (CompileAsm::asm_construct_string_tree): Use's array type when constring string tree --- gcc/rust/backend/rust-compile-as

[COMMITTED 060/144] gccrs: Provide new asm test case for amd64

2025-03-19 Thread arthur . cohen
From: badumbatish gcc/testsuite/ChangeLog: * rust/execute/torture/inline_asm_mov_x_5.rs: Move to... * rust/execute/torture/inline_asm_mov_x_5_ARM.rs: ...here. * rust/execute/torture/inline_asm_mov_x_5_x86_64.rs: New test. --- ...m_mov_x_5.rs => inline_asm_mov_x_5_ARM.rs}

[COMMITTED 053/144] gccrs: Perform type check on InlineAsm's operand

2025-03-19 Thread arthur . cohen
From: badumbatish gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Perform type check on InlineAsm's operand (typecheck_inline_asm_operand): Likewise --- .../typecheck/rust-hir-type-check-expr.cc | 65 +-- 1 file cha

[COMMITTED 099/144] gccrs: early: Do not emit errors for unresolved imports, store them instead

2025-03-19 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * resolve/rust-early-name-resolver-2.0.cc (Early::visit_attributes): Store errors for later. --- gcc/rust/resolve/rust-early-name-resolver-2.0.cc | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/gcc/rust/r

[COMMITTED 069/144] gccrs: Introduce `IndexVec`

2025-03-19 Thread arthur . cohen
From: Kushal Pal gcc/rust/ChangeLog: * checks/errors/borrowck/rust-bir-place.h (struct Loan): Introduce new class `IndexVec` inspired from IndexVec of rust. It acts as a wrapper around `std::vector` and lets user specify a strong type to use as index. Signed-off-

[COMMITTED 074/144] gccrs: Use `IndexVec` for bb_fold_map

2025-03-19 Thread arthur . cohen
From: Kushal Pal gcc/rust/ChangeLog: * checks/errors/borrowck/rust-bir-dump.cc (simplify_cfg): Used `IndexVec` for bb_fold_map. (Dump::go): Use strong type as index instead of value as now we are using `IndexVec`. (Dump::visit): Likewise. * checks/

[COMMITTED 121/144] rust: Add support for Clone and Copy derive on generic types

2025-03-19 Thread arthur . cohen
From: Philip Herron When we generate derivations for Copy and Clone we need to make sure the associated impl block sets up the generic parameters and arguments correctly. This patch introduces the framework to copy chunks of the AST because we need to make sure these new AST nodes have their own

[COMMITTED 132/144] gccrs: Allow identifiers and paths to reference types during nr2.0

2025-03-19 Thread arthur . cohen
From: Owen Avery gcc/rust/ChangeLog: * resolve/rust-late-name-resolver-2.0.cc (Late::visit): Allow IdentifierExpr and PathInExpression to reference types as well as values, remove ability for IdentifierExpr to reference labels. gcc/testsuite/ChangeLog: *

[COMMITTED 116/144] gccrs: This test requires the standard library

2025-03-19 Thread arthur . cohen
From: Pierre-Emmanuel Patry It requires the standard library and Copy to work correctly which we cannot provide. Stopping the compiler before the name resolution allow us to prevent an error whilst resolving Copy and keep the test's goal. gcc/testsuite/ChangeLog: * rust/compile/function

[COMMITTED 016/144] gccrs: Implement resolve expr for inline asm ast

2025-03-19 Thread arthur . cohen
From: badumbatish gcc/rust/ChangeLog: * resolve/rust-ast-resolve-expr.cc (ResolveExpr::visit): Implement resolve expr for inline asm ast (translate_operand): Likewise. * resolve/rust-ast-resolve-expr.h: Likewise. --- gcc/rust/resolve/rust-ast-resolve-expr.cc | 67

[COMMITTED 004/144] gccrs: Move procedural macro test to their own directory

2025-03-19 Thread arthur . cohen
From: Pierre-Emmanuel Patry gcc/testsuite/ChangeLog: * rust/compile/macros/proc/proc_macro.exp: New deja gnu file to execute proc-macro tests. * rust/compile/proc_macro_attribute_crate_type.rs: Move to... * rust/compile/macros/proc/attribute_crate_type.rs: ...here

[COMMITTED 010/144] gccrs: Use new constructors and control flow for operand

2025-03-19 Thread arthur . cohen
From: badumbatish gcc/rust/ChangeLog: * ast/rust-expr.h (struct InlineAsmOperand): changed to class (class InlineAsmOperand): Have appropriate constructor, and getter * expand/rust-macro-builtins-asm.cc (parse_reg_operand): Use the new implement constructo

  1   2   >