From: Arthur Cohen
gcc/rust/ChangeLog:
* resolve/rust-late-name-resolver-2.0.cc (Late::visit): Special case
lang item paths.
---
gcc/rust/resolve/rust-late-name-resolver-2.0.cc | 8 +++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/gcc/rust/resolve/rust-late-name
From: Arthur Cohen
gcc/rust/ChangeLog:
* ast/rust-ast-builder.cc (Builder::block): Change return type.
(Builder::loop): Use new APIs.
* ast/rust-ast-builder.h: Change return type of block functions.
---
gcc/rust/ast/rust-ast-builder.cc | 22 +++---
gcc
From: Owen Avery
gcc/rust/ChangeLog:
* expand/rust-expand-visitor.cc
(ExpandVisitor::visit): Override DefaultASTVisitor in order to
expand a module's items, rather than directly visit them.
* expand/rust-expand-visitor.h
(ExpandVisitor::visit): Add overrid
From: Arthur Cohen
gcc/rust/ChangeLog:
* util/rust-lang-item.h: Declare it.
* util/rust-lang-item.cc: Use it.
---
gcc/rust/util/rust-lang-item.cc | 2 ++
gcc/rust/util/rust-lang-item.h | 3 +++
2 files changed, 5 insertions(+)
diff --git a/gcc/rust/util/rust-lang-item.cc b
From: Owen Avery
gcc/rust/ChangeLog:
* ast/rust-path.h
(PathInExpression::get_pattern_node_id): Remove.
Signed-off-by: Owen Avery
---
gcc/rust/ast/rust-path.h | 2 --
1 file changed, 2 deletions(-)
diff --git a/gcc/rust/ast/rust-path.h b/gcc/rust/ast/rust-path.h
index c253703
From: Arthur Cohen
gcc/rust/ChangeLog:
* expand/rust-derive-debug.cc (ptrify): Remove function.
---
gcc/rust/expand/rust-derive-debug.cc | 8
1 file changed, 8 deletions(-)
diff --git a/gcc/rust/expand/rust-derive-debug.cc
b/gcc/rust/expand/rust-derive-debug.cc
index
From: Philip Herron
We have the type information for the resolved call lets tell the user about
it in the diagnostic and apply the correct error code.
Fixes Rust-GCC#2035
gcc/rust/ChangeLog:
* typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): improve
error diag
gcc/testsu
From: Pierre-Emmanuel Patry
Those tests are now passing.
gcc/testsuite/ChangeLog:
* rust/compile/nr2/exclude: Remove two mangling tests from exclusion
file.
Signed-off-by: Pierre-Emmanuel Patry
---
gcc/testsuite/rust/compile/nr2/exclude | 2 --
1 file changed, 2 deletions(-)
From: Owen Avery
gcc/rust/ChangeLog:
* resolve/rust-forever-stack.hxx
(ForeverStack::find_starting_point): Be more careful about
applying ForeverStack::find_closest_module.
(ForeverStack::resolve_segments): Allow traversal into parent
nodes when not in a m
From: Arthur Cohen
gcc/rust/ChangeLog:
* expand/rust-derive.cc (DeriveVisitor::derive): Call into DeriveEq.
* expand/rust-derive-eq.cc: New file.
* expand/rust-derive-eq.h: New file.
* Make-lang.in: Compile them.
gcc/testsuite/ChangeLog:
* rust/compile
From: Pierre-Emmanuel Patry
Import mapping was relying on resolve_path which in turn relies on
the cursor function. This means the mapping resolver should be called
from the correct scope instead of being called from the crate scope.
gcc/rust/ChangeLog:
* resolve/rust-early-name-resolve
From: Owen Avery
gcc/rust/ChangeLog:
* expand/rust-derive-clone.cc
(DeriveClone::clone_impl): Avoid using the same node id multiple
times.
(DeriveClone::clone_enum_identifier): Likewise.
(DeriveClone::clone_enum_tuple): Likewise.
* expand/rust-deri
From: Arthur Cohen
Collapses all of the OperatorExprs into Expr instead of first having to check
for OperatorExpr and
then check for each OperatorExpr::Kind.
gcc/rust/ChangeLog:
* ast/rust-ast.h: Add new Expr::Kinds.
* ast/rust-expr.h: Implement missing get_expr_kind(), Add
From: Pierre-Emmanuel Patry
We need to query all namespaces and error out at a later stage if the
retrieved item is wrong.
gcc/rust/ChangeLog:
* typecheck/rust-hir-trait-resolve.cc
(TraitResolver::resolve_path_to_trait):
Query all namespaces.
Signed-off-by: Pierre-Emmanuel Pat
From: Owen Avery
gcc/rust/ChangeLog:
* resolve/rust-late-name-resolver-2.0.cc
(Late::visit): Call DefaultResolver::visit earlier, in order to
ensure it is called even if Late::visit returns early.
gcc/testsuite/ChangeLog:
* rust/compile/nr2/exclude: Remove entri
From: Arthur Cohen
gcc/rust/ChangeLog:
* ast/rust-ast-builder.h: Declare it.
* ast/rust-ast-builder.cc (Builder::return_expr): Define it.
---
gcc/rust/ast/rust-ast-builder.cc | 7 +++
gcc/rust/ast/rust-ast-builder.h | 4
2 files changed, 11 insertions(+)
diff --git a
From: Arthur Cohen
gcc/rust/ChangeLog:
* rust-session-manager.cc (Session::compile_crate): Call the visitor.
---
gcc/rust/rust-session-manager.cc | 4
1 file changed, 4 insertions(+)
diff --git a/gcc/rust/rust-session-manager.cc b/gcc/rust/rust-session-manager.cc
index
From: Arthur Cohen
gcc/rust/ChangeLog:
* ast/rust-ast-builder.h: Mark all arguments as &&.
* ast/rust-ast-builder.cc (Builder::let): Likewise.
---
gcc/rust/ast/rust-ast-builder.cc | 4 ++--
gcc/rust/ast/rust-ast-builder.h | 6 +++---
2 files changed, 5 insertio
From: Philip Herron
Fixes Rust-GCC#3174
gcc/rust/ChangeLog:
* backend/rust-compile-pattern.cc (CompilePatternBindings::visit): make
recursive
* typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit):
handle ref flag
gcc/testsuite/ChangeLog:
* rust/compile
From: Owen Avery
gcc/rust/ChangeLog:
* resolve/rust-early-name-resolver-2.0.cc
(Early::resolve_glob_import): Use
NameResolutionContext::resolve_path instead of
ForeverStack::resolve_path.
(Early::visit): Likewise.
(Early::visit_attributes): Likewis
From: Philip Herron
We needed to check for the optional has a value here or not it leads to an
ICE.
gcc/rust/ChangeLog:
* typecheck/rust-tyty.cc (ClosureType::setup_fn_once_output): add
checks for lang items
Signed-off-by: Philip Herron
---
gcc/rust/typecheck/rust-tyty.cc | 22 +
From: Arthur Cohen
gcc/rust/ChangeLog:
* hir/tree/rust-hir-path.h: Adapt PathPattern to accept lang-item paths.
* hir/tree/rust-hir-path.cc: Assert we are dealing with a segmented
path, create lang-item
constructors.
* hir/tree/rust-hir.cc (PathPattern
From: Pierre-Emmanuel Patry
It might be necessary to compare both name resolution' internal states
during the transition. This new debug representation could help with
that.
gcc/rust/ChangeLog:
* resolve/rust-name-resolver.h: Add new degug dump for old name
resolver.
Signed-off
From: Pierre-Emmanuel Patry
Query mode was a hack to catch up some compile errors early, it was
deemed to be removed at some time. Recent changes to NR1 highlighted
an incompatibility with it hence it's removal.
gcc/rust/ChangeLog:
* backend/rust-compile-item.h: Remove query mode.
From: Philip Herron
This guards against a crash but i think this should actually be treated
as if its a generic type like below. But for now this addresses a crash which
can occur.
gcc/rust/ChangeLog:
* checks/errors/privacy/rust-privacy-reporter.cc
(PrivacyReporter::check_base_type_p
From: Philip Herron
When passing generics around we try to adjust them because there are cases
where the names are adjusted from other generics this can fail for traits
because of the implicit Self and we just need to continue on without
adjustment.
Fxies Rust-GCC#3382
gcc/rust/ChangeLog:
From: Arthur Cohen
gcc/rust/ChangeLog:
* ast/rust-ast-builder.cc (Builder::qualified_path_in_expression): New.
(Builder::function): Change the return type.
* ast/rust-ast-builder.h: Declare qualified_path_in_expression
functions.
* expand/rust-derive-debug.cc
From: Pierre-Emmanuel Patry
Labels were using the wrong namespace.
gcc/rust/ChangeLog:
* resolve/rust-ast-resolve-expr.cc (ResolveExpr::visit): Change label
push function from type rib to label rib.
* resolve/rust-ast-resolve-item.cc (ResolveTraitItems::visit):
L
From: Arthur Cohen
gcc/rust/ChangeLog:
* util/rust-lang-item.cc (LangItem::IsEnumVariant): New function.
* util/rust-lang-item.h: Declare it.
---
gcc/rust/util/rust-lang-item.cc | 9 +
gcc/rust/util/rust-lang-item.h | 5 -
2 files changed, 13 insertions(+), 1
From: Arthur Cohen
gcc/rust/ChangeLog:
* expand/rust-derive.cc (DeriveVisitor::derive): Call DeriveDefault.
* expand/rust-derive-default.cc: New file.
* expand/rust-derive-default.h: New file.
* Make-lang.in: Compile them.
gcc/testsuite/ChangeLog
From: Philip Herron
Addresses Rust-GCC#3352
gcc/rust/ChangeLog:
* backend/rust-compile-type.cc
(TyTyResolveCompile::get_implicit_enumeral_node_type):
use repr
(TyTyResolveCompile::visit): update prototype
* backend/rust-compile-type.h: likewise
Signed-off-by: P
From: Benjamin Thos
Check if an if-expr returns void type or a coercible type like an early return.
gcc/rust/ChangeLog:
* typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit):
Add check on if-expr.
gcc/testsuite/ChangeLog:
* rust/compile/implicit_returns_err3.r
From: Sri Ganesh Thota
gcc/rust/ChangeLog:
* ast/rust-item.h: I have changed helper constructor for typepath
to be a delegating constructor.
Signed-off-by: Sri Ganesh Thota
---
gcc/rust/ast/rust-item.h | 13 ++---
1 file changed, 6 insertions(+), 7 deletions(-)
diff -
From: Arthur Cohen
gcc/rust/ChangeLog:
* hir/rust-ast-lower-type.cc (ASTLowerTypePath::translate): Adapt to
handle lang item paths.
(ASTLowerTypePath::visit): Likewise.
(ASTLowerTypePath::translate_type_path): New.
(ASTLowerTypePath
From: Arthur Cohen
gcc/rust/ChangeLog:
* expand/rust-derive-clone.cc (DeriveClone::clone_enum_struct): New
function for deriving
enum struct variants.
(DeriveClone::visit_enum): Call into the new function.
gcc/testsuite/ChangeLog:
* rust/compile/nr2/exclude
From: Arthur Cohen
gcc/rust/ChangeLog:
* util/rust-hir-map.h: Move definitions from header...
* util/rust-hir-map.cc: ...to source file.
---
gcc/rust/util/rust-hir-map.cc | 19 +++
gcc/rust/util/rust-hir-map.h | 18 ++
2 files changed, 21
From: Pierre-Emmanuel Patry
Enum variants shouldn't be accessed directly even from within an enum.
This commit keeps the provenance for enum variants definition so we
can skip them when resolving a value within an enum definition.
gcc/rust/ChangeLog:
* resolve/rust-forever-stack.h: Add
From: Philip Herron
We resolve path segments and inserted their resolution into the name
resolution space which was an old hack to use this as information in
code-gen/check-passes in order to help things move forward but this is
not nessecary
gcc/rust/ChangeLog:
* typecheck/rust-hir-typ
From: Philip Herron
gcc/rust/ChangeLog:
* typecheck/rust-hir-type-check-item.cc (TypeCheckItem::visit): track
DefId of origin
* typecheck/rust-tyty.cc (BaseType::monomorphized_clone): likewise
(ADTType::ADTType): likewise
(ADTType::get_id): likewise
(ADTT
From: Owen Avery
gcc/rust/ChangeLog:
* resolve/rust-ast-resolve-type.cc
(ResolveRelativeTypePath::go): Adjust error message to match
the 2.0 name resolver.
gcc/testsuite/ChangeLog:
* rust/compile/additional-trait-bounds2.rs: Adjust expected
errors.
From: Philip Herron
With simple patterns we dont introduce any more inference varaibles as
they are already declared in a specific way. This would only lead to
more unconstrained inference varaibles than is required.
Fixes Rust-GCC#3022
gcc/rust/ChangeLog:
* hir/rust-ast-lower-base.cc
From: Arthur Cohen
gcc/rust/ChangeLog:
* expand/rust-macro-expand.cc: Use new SubstituteCtx API.
* expand/rust-macro-expand.h: Likewise.
* expand/rust-macro-substitute-ctx.cc: Implement proper expansion of
$crate.
* expand/rust-macro-substitute-ctx.h: Adapt APIs
From: Pierre-Emmanuel Patry
This visitor is not used anymore.
gcc/rust/ChangeLog:
* resolve/rust-finalize-imports-2.0.cc
(FinalizeImports::FinalizeImports):
Remove constructor.
(FinalizeImports::go): Remove function.
(FinalizeImports::visit): Likewise.
*
From: Arthur Cohen
gcc/rust/ChangeLog:
* checks/lints/rust-lint-marklive.cc (MarkLive::visit): Adapt to lang
items.
---
gcc/rust/checks/lints/rust-lint-marklive.cc | 16
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/gcc/rust/checks/lints/rust-lint
From: Arthur Cohen
gcc/rust/ChangeLog:
* util/rust-hir-map.cc (Mappings::get_lang_item_node): Better
formatting when a lang
item does not exist when it should.
---
gcc/rust/util/rust-hir-map.cc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gcc/rust
From: Arthur Cohen
gcc/rust/ChangeLog:
* hir/rust-ast-lower-item.cc (ASTLoweringItem::visit): Register auto
traits in mappings.
* util/rust-hir-map.cc (Mappings::insert_auto_trait): New.
(Mappings::get_auto_traits): New.
* util/rust-hir-map.h: Declare them
From: Pierre-Emmanuel Patry
gcc/rust/ChangeLog:
* backend/rust-compile-resolve-path.cc (ResolvePathRef::resolve): Do
not use query system for unit struct but compile it's constructor
instead.
Signed-off-by: Pierre-Emmanuel Patry
---
gcc/rust/backend/rust-compile-resolv
From: Pierre-Emmanuel Patry
We missed the name namespace for unit struct in the old resolver.
gcc/rust/ChangeLog:
* resolve/rust-ast-resolve-toplevel.h: Add struct to name namespace.
Signed-off-by: Pierre-Emmanuel Patry
---
gcc/rust/resolve/rust-ast-resolve-toplevel.h | 23 ++
From: Owen Avery
gcc/rust/ChangeLog:
* util/rust-edition.cc: New file.
* util/rust-edition.h: New file.
* Make-lang.in: Add rust-edition.o to the object list.
* ast/rust-pattern.cc: Remove inclusion of
rust-session-manager.h.
* expand/rust-macro-e
From: Owen Avery
gcc/rust/ChangeLog:
* resolve/rust-forever-stack.h
(ForeverStack::ForeverStack): Set the node id of the root node
to that of the current crate.
* resolve/rust-forever-stack.hxx
(ForeverStack::find_starting_point): Use the node id of the ro
From: Arthur Cohen
We are still missing some deriving for enums, as part of our codegen and
nameres for rebinding struct
field patterns is missing.
gcc/rust/ChangeLog:
* expand/rust-derive-partial-eq.cc: New file.
* expand/rust-derive-partial-eq.h: New file.
* expand
From: Pierre-Emmanuel Patry
gcc/rust/ChangeLog:
* resolve/rust-forever-stack.hxx: Insert a new segment with the crate's
name as canonical's path prefix.
Signed-off-by: Pierre-Emmanuel Patry
---
gcc/rust/resolve/rust-forever-stack.hxx | 7 ++-
1 file changed, 6 insertions(+
From: Pierre-Emmanuel Patry
Highlight the fact that a value inside an enum definition refers to
a struct outside of the enum and not to the enum variant's name
directly.
gcc/testsuite/ChangeLog:
* rust/compile/enum_variant_name.rs: New test.
Signed-off-by: Pierre-Emmanuel Patry
---
g
From: Owen Avery
gcc/testsuite/ChangeLog:
* rust/compile/nr2/compile.exp: Adjust to cover tests in the
torture subdirectory.
* rust/compile/nr2/exclude: Add entries.
Signed-off-by: Owen Avery
---
gcc/testsuite/rust/compile/nr2/compile.exp | 6 ++
gcc/testsuite/rus
From: Arthur Cohen
gcc/rust/ChangeLog:
* ast/rust-ast-builder.cc (Builder::literal_bool): New method.
(Builder::comparison_expr): Likewise.
(Builder::boolean_operation): Likewise.
* ast/rust-ast-builder.h: Declare them.
---
gcc/rust/ast/rust-ast-builder.cc | 46
From: Philip Herron
We need to be careful when doing bounds check as to not create a recusive
trait resolution. This patch checks for that case and fixes a bad type
is equal check on ADT Types which was caught with a regression here.
Fixes Rust-GCC#3126
gcc/rust/ChangeLog:
* typecheck/
From: Philip Herron
In order to handle the tuple pattern of: fn test ((x _) : (i32, i32)) -> i32 {
x }
we need to recognize that ABI wise this function still takes a tuple as the
parameter
to this function its just how we can address the "pattern" of the tuple changes.
So reall if this was C i
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
From: Liam Naddell
gcc/rust/ChangeLog:
* resolve/rust-forever-stack.h (ForeverStack): Add a dedicated prelude
node for
the Language prelude
* resolve/rust-forever-stack.hxx (ForeverStack): Add support code for
the
prelude node
* resolve/rust-late-name-re
From: Arthur Cohen
Adapt functions for lowering nodes that should never reach the lowering phase
to cause an
unreachable, and mark them as final so as it not possible to override them in
other visitors.
gcc/rust/ChangeLog:
* hir/rust-ast-lower-base.cc: Adapt functions for
From: Ryutaro Okada <1015ry...@gmail.com>
gcc/rust/ChangeLog:
* typecheck/rust-hir-type-check-implitem.cc
(TypeCheckTopLevelExternItem::visit):
emit an error for type or const parameters on foreign items
gcc/testsuite/ChangeLog:
* rust/compile/extern_generics.rs
From: Pierre-Emmanuel Patry
Rib kind had no string representation, and thus were not used in the
debug string representation.
gcc/rust/ChangeLog:
* resolve/rust-forever-stack.hxx: Output rib kind.
* resolve/rust-rib.h: Add function to get string representation from
a rib
From: Owen Avery
gcc/rust/ChangeLog:
* ast/rust-ast.h
(SingleASTNode::take_trait_item): Remove.
(SingleASTNode::take_impl_item): Remove.
(SingleASTNode::take_trait_impl_item): Remove.
* expand/rust-expand-visitor.cc
(ExpandVisitor::visit): Replace
From: Arthur Cohen
gcc/rust/ChangeLog:
* expand/rust-derive-partial-eq.cc: Adapt signatures to generate two
impls.
* expand/rust-derive-partial-eq.h: Likewise.
* expand/rust-derive.cc (DeriveVisitor::derive): Adapt to multiple item
generation.
gcc/testsuite/ChangeLog
From: Arthur Cohen
gcc/rust/ChangeLog:
* hir/rust-hir-dump.cc: Check unique_ptr members are present before
visiting them.
* hir/tree/rust-hir-path.h: Add `has_{type, trait}` methods to
QualifiedPathInType.
---
gcc/rust/hir/rust-hir-dump.cc | 19
From: Owen Avery
gcc/rust/ChangeLog:
* resolve/rust-early-name-resolver-2.0.cc
(Early::visit): Adjust error produced when macro resolution
fails.
* resolve/rust-early-name-resolver.cc
(EarlyNameResolver::visit): Likewise.
gcc/testsuite/ChangeLog:
From: Owen Avery
gcc/rust/ChangeLog:
* resolve/rust-ast-resolve-path.cc
(ResolvePath::resolve_path): Adjust the error message for a lower
self segment in the middle of a path.
* resolve/rust-ast-resolve-type.cc
(ResolveRelativeTypePath::go): Likewise.
gcc
From: Owen Avery
gcc/rust/ChangeLog:
* resolve/rust-late-name-resolver-2.0.cc
(Late::visit): Add visitor for StructExprFieldIdentifier.
* resolve/rust-late-name-resolver-2.0.h
(Late::visit): Likewise.
gcc/testsuite/ChangeLog:
* rust/compile/nr2/exclude:
From: Arthur Cohen
gcc/rust/ChangeLog:
* expand/rust-derive-clone.cc: Cleanup implementation, avoid
repetitions.
* expand/rust-derive-clone.h: Likewise.
---
gcc/rust/expand/rust-derive-clone.cc | 34 ++--
gcc/rust/expand/rust-derive-clone.h | 8
From: Arthur Cohen
gcc/rust/ChangeLog:
* ast/rust-ast-builder.cc (Builder::statementify): New.
(Builder::function): Add generic params optional argument.
(Builder::path_in_expression): Add opening_scope_resolution optional
argument.
(Builder::block): Add
From: Owen Avery
gcc/rust/ChangeLog:
* backend/rust-compile-intrinsic.cc
(assume_handler): Fix copy/paste error.
* typecheck/rust-hir-type-check-pattern.cc
(TypeCheckPattern::visit): Fix spelling mistake.
Signed-off-by: Owen Avery
---
gcc/rust/backend/rust-comp
From: Owen Avery
gcc/rust/ChangeLog:
* ast/rust-item.h
(Trait::self_param): Add.
(Trait::Trait): Initialize self_param.
(Trait::operator=): Copy self_param.
(Trait::insert_implicit_self): Remove.
(Trait::get_implicit_self): Add.
* hir/rust-
From: Owen Avery
gcc/rust/ChangeLog:
* resolve/rust-ast-resolve-expr.cc
(ResolveExpr::visit): Modify error message.
* resolve/rust-ast-resolve-implitem.h
(ResolveToplevelImplItem::visit): Likewise.
(ResolveTopLevelTraitItems::visit): Likewise.
(Res
From: Philip Herron
In order to handle generic super traits on any trait bound we need to ensure
we track the TypeBoundPredicate as part of the TraitReference instead of just
the raw TraitReferences because these will have any applied generics enplace.
Then for any TypeBoundPredicate it takes a
From: lishin
Add and implement a lang item (receiver) in source code.
gcc/rust/ChangeLog:
* util/rust-lang-item.cc: Add receiver to map.
* util/rust-lang-item.h: Define LangItem::Kind::RECEIVER.
gcc/testsuite/ChangeLog:
* rust/compile/issue-2954.rs: New test.
Signed-o
From: Arthur Cohen
gcc/rust/ChangeLog:
* expand/rust-derive-clone.cc (DeriveClone::visit_union): Use lang
items for Copy and
Sized bounds.
gcc/testsuite/ChangeLog:
* rust/compile/derive_macro6.rs: Add lang item attribute to Copy trait.
---
gcc/rust/expand/rust-derive
From: Arthur Cohen
gcc/rust/ChangeLog:
* expand/rust-derive-clone.cc: Add extra bound when deriving generic
Clone
---
gcc/rust/expand/rust-derive-clone.cc | 17 +++--
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/gcc/rust/expand/rust-derive-clone.cc
b/gcc
From: Pierre-Emmanuel Patry
The compiler was still relying on NR1 for closure captures when using nr2
even though the resolver was not used and thus it's state empty.
gcc/rust/ChangeLog:
* resolve/rust-late-name-resolver-2.0.cc (Late::visit): Add environment
collection.
From: Arthur Cohen
gcc/rust/ChangeLog:
* backend/rust-compile-expr.cc (check_match_scrutinee): Allow anything
to be used as a
match scrutinee, not just ADTs.
---
gcc/rust/backend/rust-compile-expr.cc | 6 +-
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/gcc
From: Arthur Cohen
gcc/rust/ChangeLog:
* ast/rust-path.h: New function.
---
gcc/rust/ast/rust-path.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/gcc/rust/ast/rust-path.h b/gcc/rust/ast/rust-path.h
index 2a76acc48c3..c2537034b61 100644
--- a/gcc/rust/ast/rust-path.h
+++ b/gcc
From: Arthur Cohen
gcc/rust/ChangeLog:
* ast/rust-ast-collector.cc (TokenCollector::visit): Adapt visitor to
lang item
PathInExpressions.
* ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Likewise.
* expand/rust-cfg-strip.cc (CfgStrip::visit): Likewise
From: Arthur Cohen
gcc/rust/ChangeLog:
* hir/rust-hir-dump.cc (Dump::do_typepathsegment): Add handling for
lang items.
---
gcc/rust/hir/rust-hir-dump.cc | 5 -
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/gcc/rust/hir/rust-hir-dump.cc b/gcc/rust/hir/rust-hir
From: Arthur Cohen
gcc/rust/ChangeLog:
* ast/rust-ast-builder.cc (Builder::new_type_param): Add optional extra
trait bounds.
* ast/rust-ast-builder.h: Likewise.
---
gcc/rust/ast/rust-ast-builder.cc | 6 +-
gcc/rust/ast/rust-ast-builder.h | 4 +++-
2 files changed, 8
From: Arthur Cohen
gcc/rust/ChangeLog:
* expand/rust-derive-copy.cc: Always add an extra Copy bound on generic
Copy impls.
---
gcc/rust/expand/rust-derive-copy.cc | 9 +++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/gcc/rust/expand/rust-derive-copy.cc
b/gcc
Hi everyone!
Here is the last batch of our split patchset which aimed at
synchronizing upstream with our development repo. Both repositories are
now the same, with the latest patch pushed today corresponding to the
latest pull-request merged this weekend on our side. Moving forward,
I will be upst
From: Pierre-Emmanuel Patry
Nr2 did not emit the correct error message for break identifier "rust".
gcc/rust/ChangeLog:
* resolve/rust-late-name-resolver-2.0.cc (Late::visit): Add "rust"
identifier detection akin to nr1.
(funny_ice_finalizer): Copy ICE finalizer from nr1
From: Arthur Cohen
gcc/rust/ChangeLog:
* util/rust-lang-item.h: Add handling for Result::Ok, Result::Err, Try,
Try::into_result,
Try::from_ok, Try::from_err.
* util/rust-lang-item.cc: Likewise.
gcc/testsuite/ChangeLog:
* rust/compile/try-trait.rs: New test
From: Arthur Cohen
This paves the way for adding trait bounds that aren't necessarily Sized.
gcc/rust/ChangeLog:
* typecheck/rust-tyty-bounds.cc (TypeBoundsProbe::add_trait_bound): New
function.
* typecheck/rust-hir-type-bounds.h: Declare it.
(TypeBounds
From: Arthur Cohen
gcc/rust/ChangeLog:
* backend/rust-compile-resolve-path.cc (ResolvePathRef::visit): Adapt
visitor to lang item
HIR::PathInExpressions.
* typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::visit):
Likewise.
---
gcc/rust/backend/rust-compile
From: Arthur Cohen
gcc/rust/ChangeLog:
* ast/rust-collect-lang-items.h: Declare visitor.
* ast/rust-collect-lang-items.cc (CollectLangItems::visit): New.
---
gcc/rust/ast/rust-collect-lang-items.cc | 9 +
gcc/rust/ast/rust-collect-lang-items.h | 1 +
2 files changed
From: Philip Herron
When we lookup here it returns an optional which can lead to a crash
because it needs a guard if it has a value.
gcc/rust/ChangeLog:
* backend/rust-compile-resolve-path.cc (HIRCompileBase::query_compile):
add guard
gcc/testsuite/ChangeLog:
* rust/compile/n
From: Pierre-Emmanuel Patry
Captures were only processed for regular ClosureExprInner.
gcc/rust/ChangeLog:
* resolve/rust-late-name-resolver-2.0.cc (Late::visit): Add
ClosureExprInnerTyped visit implementation.
(add_captures): Add a function to avoid code duplication.
From: Arthur Cohen
gcc/rust/ChangeLog:
* backend/rust-compile-resolve-path.cc (ResolvePathRef::visit): Call
into
resolve_path_like instead.
(ResolvePathRef::resolve_path_like): New.
(ResolvePathRef::resolve): Call into resolve_with_node_id.
* backend
From: Philip Herron
This is pretty nasty piece of rust in my opinion the return type of this
intrinsic results into a lang item associated type:
::Discriminant
This is a special case which needs to support mapping onto the repr type
of the associated ADT that is passed in, but defaults to isz
From: Owen Avery
gcc/rust/ChangeLog:
* resolve/rust-late-name-resolver-2.0.cc
(Late::visit): When visiting a PathInExpression instance, call
into DefaultResolver::visit, ensuring generic arguments are
visited.
gcc/testsuite/ChangeLog:
* rust/compile/nr2/
From: Pierre-Emmanuel Patry
We're reusing the value, it could therefore not be taken be should be
cloned.
gcc/rust/ChangeLog:
* typecheck/rust-hir-type-check-enumitem.cc (TypeCheckEnumItem::visit):
Clone expr instead of taking it.
Signed-off-by: Pierre-Emmanuel Patry
---
gcc/
From: Philip Herron
This completes the initial setup and boilerplate for the new type in the
typesystem. This is not functional yet but its a big patch already.
gcc/rust/ChangeLog:
* backend/rust-compile-type.cc (TyTyResolveCompile::visit): new
tyty::OpaqueType
* backend/rust-c
From: Pierre-Emmanuel Patry
gcc/testsuite/ChangeLog:
* rust/compile/nr2/exclude: Remove issue-1786 and issue-3033 from
exclusion list.
Signed-off-by: Pierre-Emmanuel Patry
---
gcc/testsuite/rust/compile/nr2/exclude | 2 --
1 file changed, 2 deletions(-)
diff --git a/gcc/tests
From: Philip Herron
It is valid for the query to fail here so its valid to not assert here.
gcc/rust/ChangeLog:
* typecheck/rust-hir-path-probe.cc (PathProbeType::visit): remove
assertion
Signed-off-by: Philip Herron
---
gcc/rust/typecheck/rust-hir-path-probe.cc | 12 ++--
1
From: Pierre-Emmanuel Patry
Those tests are now passing.
gcc/testsuite/ChangeLog:
* rust/compile/nr2/exclude: Remove some tests.
Signed-off-by: Pierre-Emmanuel Patry
---
gcc/testsuite/rust/compile/nr2/exclude | 7 ++-
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/
801 - 900 of 1384 matches
Mail list logo