[PATCH 110/125] gccrs: borrowck: Use rust-system.h

2024-08-01 Thread Arthur Cohen
From: Jakub Dupak Replace direct usage of system headers. gcc/rust/ChangeLog: * checks/errors/borrowck/rust-bir-dump.cc: Use rust-system.h * checks/errors/borrowck/rust-bir-dump.h (RUST_BIR_DUMP_H): Use rust-system.h * checks/errors/borrowck/rust-bir-place.h (RUST_BIR_P

[PATCH 112/125] gccrs: borrowck: BIR: use callable API

2024-08-01 Thread Arthur Cohen
From: Jakub Dupak gcc/rust/ChangeLog: * checks/errors/borrowck/rust-bir-builder-expr-stmt.cc (ExprStmtBuilder::visit): Use callable API Signed-off-by: Jakub Dupak --- .../borrowck/rust-bir-builder-expr-stmt.cc| 23 --- 1 file changed, 5 insertions(+), 18 d

[PATCH 113/125] gccrs: borrowck: BIR: Place tree traverse API

2024-08-01 Thread Arthur Cohen
From: Jakub Dupak gcc/rust/ChangeLog: * checks/errors/borrowck/rust-bir-place.h: Create place tree traverse API. Signed-off-by: Jakub Dupak --- .../checks/errors/borrowck/rust-bir-place.h | 23 +++ 1 file changed, 23 insertions(+) diff --git a/gcc/rust/check

[PATCH 116/125] gccrs: borrowck: BIR: make BIR visitor const

2024-08-01 Thread Arthur Cohen
From: Jakub Dupak gcc/rust/ChangeLog: * checks/errors/borrowck/rust-bir-dump.cc (Dump::visit): const visitor * checks/errors/borrowck/rust-bir-dump.h: const visitor * checks/errors/borrowck/rust-bir-visitor.h: const visitor * checks/errors/borrowck/rust-bi

[PATCH 111/125] gccrs: borrowck: Unify BIR terminilogy (node->statement)

2024-08-01 Thread Arthur Cohen
From: Jakub Dupak gcc/rust/ChangeLog: * checks/errors/borrowck/bir-design-notes.md (nodes): Rename node to statement. (Nodes): Rename node to statement. * checks/errors/borrowck/rust-bir-builder-expr-stmt.cc (ExprStmtBuilder::visit): Rename node to statement.

[PATCH 123/125] gccrs: borrowck: Bump copyright notice

2024-08-01 Thread Arthur Cohen
From: Jakub Dupak gcc/rust/ChangeLog: * checks/errors/borrowck/ffi-polonius/src/gccrs_ffi.rs: Bump copyright. * checks/errors/borrowck/ffi-polonius/src/lib.rs: Bump copyright. * checks/errors/borrowck/polonius/rust-polonius-ffi.h: Bump copyright. * checks/errors/b

[PATCH 114/125] gccrs: borrowck: BIR: scope handling

2024-08-01 Thread Arthur Cohen
From: Jakub Dupak gcc/rust/ChangeLog: * checks/errors/borrowck/rust-bir-builder-expr-stmt.cc (ExprStmtBuilder::setup_loop): Loop handling. (ExprStmtBuilder::visit): Handle scopes. * checks/errors/borrowck/rust-bir-builder-internal.h (struct BuilderContext):

[PATCH 119/125] gccrs: borrowck: extract regions from types using VA

2024-08-01 Thread Arthur Cohen
From: Jakub Dupak Biggybag on variance analysis to extract regions of fields from ADT regions. gcc/rust/ChangeLog: * typecheck/rust-tyty-variance-analysis-private.h (class FieldVisitorCtx): Region extraction. * typecheck/rust-tyty-variance-analysis.cc (query_field_regio

[PATCH 120/125] gccrs: borrowck: Regions in BIR

2024-08-01 Thread Arthur Cohen
From: Jakub Dupak gcc/rust/ChangeLog: * checks/errors/borrowck/rust-bir-place.h (struct Lifetime): Extended regions and loans. (struct Loan): Representation of loan (result of borrowing) * checks/errors/borrowck/rust-bir-builder-expr-stmt.cc (ExprStmtBuilder::vis

[PATCH 057/125] gccrs: Split up rust-macro-builtins.cc

2024-08-01 Thread Arthur Cohen
From: jjasmine Fixes issue #2855 gcc/rust/ChangeLog: * Make-lang.in: add new .o builds for new .cc files * expand/rust-cfg-strip.h (RUST_CFG_STRIP_H): Add include guards for rust-cfg-strip * expand/rust-macro-builtins.cc (make_macro_path_str): moved to new respe

[PATCH 064/125] gccrs: typecheck: Start using nr2.0 properly

2024-08-01 Thread Arthur Cohen
Fetch the ImmutableNrCtx in order to access name resolver during typechecking. gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-item.cc (TypeCheckItem::visit): Start fetching name resolution information in the typechecker. * typecheck/rust-hir-type-check-type.cc (TypeC

[PATCH 121/125] gccrs: borrowck: Fact collector

2024-08-01 Thread Arthur Cohen
From: Jakub Dupak This is the main Polonius based logic which creates the information Polonius needs from BIR. It is largly guessed and rever engineered, so some aspects are probably wrong. gcc/rust/ChangeLog: * checks/errors/borrowck/rust-bir-fact-collector.h: New file. * check

[PATCH 072/125] gccrs: late: Add bool builtin type

2024-08-01 Thread Arthur Cohen
gcc/rust/ChangeLog: * resolve/rust-late-name-resolver-2.0.cc (Late::setup_builtin_types): Setup bool as builtin type. --- gcc/rust/resolve/rust-late-name-resolver-2.0.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/gcc/rust/resolve/rust-late-name-resolver-2.0.cc b/gcc/rust

[PATCH 073/125] gccrs: Add modules to type namespace

2024-08-01 Thread Arthur Cohen
From: Pierre-Emmanuel Patry gcc/rust/ChangeLog: * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit): Module should be added to the type namespace in order to be retrieved later. Signed-off-by: Pierre-Emmanuel Patry --- gcc/rust/resolve/rust-toplevel-name-resolver-2.

[PATCH 074/125] gccrs: Add name resolution for on globbing use decl

2024-08-01 Thread Arthur Cohen
From: Pierre-Emmanuel Patry This is the first part of the code required to enable globbing on use declarations. gcc/rust/ChangeLog: * resolve/rust-toplevel-name-resolver-2.0.cc (GlobbingVisitor::visit): Insert names into their namespace. (TopLevel::visit): Insert ast mod

[PATCH 088/125] gccrs: Struct are types, not values

2024-08-01 Thread Arthur Cohen
From: Pierre-Emmanuel Patry We shall search in the right namespace. The correct namespace for struct is type namespace. gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-item.cc (TypeCheckItem::visit): Change search location for struct types. Signed-off-by: Pierre-Emmanuel Pa

[PATCH 089/125] gccrs: Add constant identifiers to the value namespace

2024-08-01 Thread Arthur Cohen
From: Pierre-Emmanuel Patry Constants could not be resolved without their identifier in the right scope. gcc/rust/ChangeLog: * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit): Add constant identifiers to the resolver. Signed-off-by: Pierre-Emmanuel Patry --- gcc/

[PATCH 092/125] gccrs: Use new name resolver to compile constant items

2024-08-01 Thread Arthur Cohen
From: Pierre-Emmanuel Patry Constant items were handled only by the old resolver, this lead to an ICE when using the new resolver on some rust code containing a constant item as the new and the old resolver cannot be used at the same time. gcc/rust/ChangeLog: * backend/rust-compile-item

[PATCH 093/125] gccrs: Reinject Self parameter in new resolver

2024-08-01 Thread Arthur Cohen
From: Pierre-Emmanuel Patry The old resolver injected a Self generic parameter in order to help the trait solver. This is clearly sketchy at best and should be fixed in the future. gcc/rust/ChangeLog: * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit): Add Self gener

[PATCH 095/125] gccrs: Prevent getting immutable context with classic nr

2024-08-01 Thread Arthur Cohen
From: Pierre-Emmanuel Patry Immutable name resolution context is not initialized when the classic name resolution is in use. It can therefore not be used, the getter would error out. gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_root_path):

[PATCH 096/125] gccrs: Fix quoted string format

2024-08-01 Thread Arthur Cohen
From: Pierre-Emmanuel Patry This format dialog triggered a warning. gcc/rust/ChangeLog: * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::handle_use_dec): Replace the string format %<%s%> with the proper %qs format. Signed-off-by: Pierre-Emmanuel Patry --- gcc/rust/reso

[PATCH 101/125] gccrs: Add globbing name resolution 2.0 test

2024-08-01 Thread Arthur Cohen
From: Pierre-Emmanuel Patry Add a few test for globbing to highlight function call ambiguities. gcc/testsuite/ChangeLog: * rust/compile/name_resolution23.rs: New test. * rust/compile/name_resolution24.rs: New test. Signed-off-by: Pierre-Emmanuel Patry --- .../rust/compile/nam

[PATCH 102/125] gccrs: Change dfs function return type to support gcc 4.8

2024-08-01 Thread Arthur Cohen
From: Pierre-Emmanuel Patry GCC 4.8 does not handle pair with references correctly. We need to use a properly typed struct instead. gcc/rust/ChangeLog: * resolve/rust-forever-stack.h: Change dfs function prototype and declare dfs return type structure. * resolve/rust-for

[PATCH 105/125] gccrs: Recognize unstable as a builtin attribute

2024-08-01 Thread Arthur Cohen
From: Owen Avery gcc/rust/ChangeLog: * util/rust-attribute-values.h (Attributes::UNSTABLE): New. * util/rust-attributes.cc (__definitions): Add Attributes::UNSTABLE. gcc/testsuite/ChangeLog: * rust/compile/unstable-fn.rs: New test. Signed-off-by: Owen A

[PATCH 118/125] gccrs: borrowck: Free region representation

2024-08-01 Thread Arthur Cohen
From: Jakub Dupak gcc/rust/ChangeLog: * checks/errors/borrowck/rust-bir-free-region.h: New file. Signed-off-by: Jakub Dupak --- .../errors/borrowck/rust-bir-free-region.h| 107 ++ 1 file changed, 107 insertions(+) create mode 100644 gcc/rust/checks/errors/borrowck

[PATCH 124/125] gccrs: Visit type during resolution of inherent impl

2024-08-01 Thread Arthur Cohen
From: Pierre-Emmanuel Patry Inherent impl has a type it applies to. This type was not visited and thus not resolved. gcc/rust/ChangeLog: * resolve/rust-default-resolver.cc (DefaultResolver::visit): Visit inherent impl type. Signed-off-by: Pierre-Emmanuel Patry --- gcc/rust/re

Greetings sir.

2024-08-01 Thread Haniba Garang

[Bug rust/108087] -Wodr warnings in rust/rust-lang.cc (lang_type)

2024-08-01 Thread sjames at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108087 Sam James changed: What|Removed |Added See Also||https://gcc.gnu.org/bugzill

[Bug rust/108087] -Wodr warnings in rust/rust-lang.cc (lang_type)

2024-08-01 Thread sjames at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108087 Sam James changed: What|Removed |Added Target Milestone|--- |14.0 See Also|

[Bug rust/116187] New: -Wuninitialized warnings in libgrust/libproc_macro_internal/literal.cc

2024-08-01 Thread sjames at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116187 Bug ID: 116187 Summary: -Wuninitialized warnings in libgrust/libproc_macro_internal/literal.cc Product: gcc Version: 15.0 Status: UNCONFIRMED Severity: normal

<    1   2