From: 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:
* ru
From: Owen Avery
gcc/rust/ChangeLog:
* checks/errors/rust-const-checker.cc
(ConstChecker::visit): Visit the enum items of enums.
* resolve/rust-ast-resolve-item.cc
(ResolveItem::visit): Resolve enum discriminants during nr1.0.
gcc/testsuite/ChangeLog:
*
From: Arthur Cohen
gcc/rust/ChangeLog:
* expand/rust-macro-builtins-format-args.cc
(format_args_parse_arguments): Improve safety,
allow extra commas after end of argument list.
gcc/testsuite/ChangeLog:
* rust/compile/format_args_extra_comma.rs: New test
From: beamandala
gcc/rust/ChangeLog:
* expand/rust-macro-builtins.cc (MacroBuiltin::builtin_transcribers):
Add entry for track_caller.
* util/rust-attribute-values.h: add `TRACK_CALLER` attribute.
* util/rust-attributes.cc: add `track_caller` attribute definition.
From: Arthur Cohen
gcc/rust/ChangeLog:
* util/rust-attribute-values.h: Add RUSTFMT value.
* util/rust-attributes.cc: Define the attribute.
* util/rust-attributes.h (enum CompilerPass): Add EXTERNAL variant.
* expand/rust-macro-builtins.cc: Fix formatting
From: Arthur Cohen
gcc/rust/ChangeLog:
* util/rust-lang-item.h: Add new manually_drop lang item.
* util/rust-lang-item.cc: Likewise.
---
gcc/rust/util/rust-lang-item.cc | 1 +
gcc/rust/util/rust-lang-item.h | 2 ++
2 files changed, 3 insertions(+)
diff --git a/gcc/rust/util
From: Arthur Cohen
This causes an assertion failure when compiling core with nr2.0, but should
probably be improved. I'm not sure how this code enables built-in derive
macros to be resolved so this is a temporary fix.
gcc/rust/ChangeLog:
* resolve/rust-early-name-resolver-2.0.cc (
From: Arthur Cohen
gcc/rust/ChangeLog:
* expand/rust-macro-expand.cc (MacroExpander::expand_decl_macro): Call
into
TokenTreeDesugar.
* expand/rust-token-tree-desugar.cc: New file.
* expand/rust-token-tree-desugar.h: New file.
* Make-lang.in: Compile them
From: Arthur Cohen
gcc/rust/ChangeLog:
* ast/rust-expr.h (class RangeExpr): Add empty outer attributes and
allow getting them
and setting them.
---
gcc/rust/ast/rust-expr.h | 12 ++--
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/gcc/rust/ast/rust
From: Arthur Cohen
gcc/rust/ChangeLog:
* util/rust-attribute-values.h: Add missing attributes.
* util/rust-attributes.cc: Likewise.
* util/rust-attributes.h (enum CompilerPass): Mention adding something
for const
functions.
---
gcc/rust/util/rust-attribute
From: Arthur Cohen
Addresses PR#117869
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117869
gcc/ChangeLog:
* doc/install.texi: Add requirements for building gccrs.
---
gcc/doc/install.texi | 6 ++
1 file changed, 6 insertions(+)
diff --git a/gcc/doc/install.texi b/gcc/doc
From: Arthur Cohen
gcc/rust/ChangeLog:
* typecheck/rust-hir-type-check-expr.cc (is_default_fn): New.
(emit_ambiguous_resolution_error): New.
(handle_multiple_candidates): Properly handle multiple candidates in
the case of specialization.
(TypeCheckExpr
From: Arthur Cohen
gcc/rust/ChangeLog:
* rust-session-manager.cc (Session::compile_crate): Call the visitor
later in the pipeline.
---
gcc/rust/rust-session-manager.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/rust/rust-session-manager.cc b/gcc/rust/rust
From: Arthur Cohen
gcc/rust/ChangeLog:
* expand/rust-macro-expand.cc (MacroExpander::match_n_matches): Do not
insert fragments and substack fragments if the matcher failed.
gcc/testsuite/ChangeLog:
* rust/compile/macros/mbe/macro-issue3708.rs: New test.
---
gcc/rust
From: Arthur Cohen
gcc/rust/ChangeLog:
* ast/rust-ast.h (DelimTokenTree::get_locus): New function.
---
gcc/rust/ast/rust-ast.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/gcc/rust/ast/rust-ast.h b/gcc/rust/ast/rust-ast.h
index 09e0fce4f19..91611ec6a62 100644
--- a/gcc/rust/ast
From: 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/1
From: Arthur Cohen
Instead, mark the visitor as dirty and wait for the next round of the fixed
point to take care of
them. This avoids issues with module items being loaded while not being
stripped yet.
gcc/rust/ChangeLog:
* resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit
From: 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 x
From: 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 ran
From: Ryutaro Okada <1015ry...@gmail.com>
gcc/rust/ChangeLog:
* backend/rust-compile-resolve-path.cc: Evaluate the enum's
discriminant in a const context
gcc/testsuite/ChangeLog:
* rust/compile/enum_discriminant1.rs: New test.
Signed-off-by: Ryutaro Okada <1015ry...@gmail.com>
From: Pierre-Emmanuel Patry
gcc/rust/ChangeLog:
* ast/rust-ast-collector.cc (TokenCollector::visit): Update label
getter call.
* ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Likewise.
* ast/rust-ast.cc (BreakExpr::as_string): Likewise.
* hir/rust-as
From: Matty Kuhn
This patch fixes an issue where an empty feature gate would segfault,
instead of reporting a syntax error to the user.
gcc/rust/ChangeLog:
* ast/rust-ast.h: (AST::Attribute): add empty_input function
* checks/errors/rust-feature-gate.cc: (FeatureGate::visit): ch
From: Sri Ganesh Thota
gcc/rust/ChangeLog:
* resolve/rust-ast-resolve-base.h (redefined_error): created a function
for
rust_error_at for redefined at multiple times.
* resolve/rust-ast-resolve-implitem.h: changed rust_error_at to
redefined_error.
* resolve/rust-
From: Pierre-Emmanuel Patry
gcc/rust/ChangeLog:
* resolve/rust-late-name-resolver-2.0.cc (Late::visit): Add call
to label resolution if there is one label.
(Late::resolve_label): Look for labels and emit an error message on
failure.
* resolve/rust-late-nam
From: Pierre-Emmanuel Patry
A loop label error state was in use to represent missing loop label but
this may be easily forgotten and the optional nature of the label was
misrepresented.
gcc/rust/ChangeLog:
* ast/rust-ast-builder.cc (Builder::block): Call with a nullopt instead
o
From: Owen Avery
gcc/rust/ChangeLog:
* ast/rust-ast-visitor.cc
(DefaultASTVisitor::visit): Remove explicit visitation of a
function's self parameter, as if it exists it'll be visited as
one of the function parameters.
gcc/testsuite/ChangeLog:
* rust/comp
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
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
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
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.
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
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
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
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
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
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
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
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-
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
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
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
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
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
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 (ASTLowerImplI
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
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 |
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
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
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
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
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
From: Philip Herron
Generics can be constrained within other generic types so this check needs
to be recursive.
Fixes Rust-GCC#3031
gcc/rust/ChangeLog:
* typecheck/rust-hir-type-check-base.cc (walk_types_to_constrain):
recursive walker
* typecheck/rust-tyty.cc (BaseType::get_s
From: Pierre-Emmanuel Patry
Clang on macos as well as GCC 4.8 complains when those templates are
missing.
gcc/rust/ChangeLog:
* hir/rust-ast-lower-expr.cc (ASTLoweringExpr::visit): Add template
to tl::optional.
* hir/rust-ast-lower-type.cc (ASTLowerGenericParam::visit):
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: Owen Avery
gcc/rust/ChangeLog:
* ast/rust-ast-visitor.cc
(DefaultASTVisitor::visit): Visit fields of InlineAsm.
gcc/testsuite/ChangeLog:
* rust/compile/nr2/exclude: Remove
inline_asm_parse_output_operand.rs.
Signed-off-by: Owen Avery
---
gcc/rust/ast/ru
From: Philip Herron
gcc/rust/ChangeLog:
* hir/rust-hir-dump.cc (Dump::visit): add guards
Signed-off-by: Philip Herron
---
gcc/rust/hir/rust-hir-dump.cc | 12
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/gcc/rust/hir/rust-hir-dump.cc b/gcc/rust/hir/rust-hi
From: Owen Avery
gcc/rust/ChangeLog:
* util/optional.h
(optional): Add assertions to dereference operator overloads
when C++14 is available.
Signed-off-by: Owen Avery
---
gcc/rust/util/optional.h | 86
1 file changed, 79 inserti
From: Owen Avery
gcc/rust/ChangeLog:
* checks/errors/rust-ast-validation.cc
(ASTValidation::visit): Allow constant items lacking expressions
if and only if they're associated with a trait definition, not a
trait implementation.
gcc/testsuite/ChangeLog:
*
From: Pierre-Emmanuel Patry
gcc/testsuite/ChangeLog:
* rust/compile/macro-delim.rs: Move to...
* rust/compile/macros/mbe/macro-delim.rs: ...here.
* rust/compile/macro-issue1053-2.rs: Move to...
* rust/compile/macros/mbe/macro-issue1053-2.rs: ...here.
* rus
From: Arthur Cohen
This method errors out if the lang item has not been declared yet.
gcc/rust/ChangeLog:
* util/rust-hir-map.cc (Mappings::get_lang_item_node): New.
* util/rust-hir-map.h: New function.
---
gcc/rust/util/rust-hir-map.cc | 10 ++
gcc/rust/util/rust-hir
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:
* typecheck/rust-hir-type-check.cc: Add includes.
(TraitItemReference::get_type_from_fn): Use
ForeverStack::to_canonical_path when name resolution 2.0 is
enabled.
Signed-off-by: Owen Avery
---
gcc/rust/typecheck/rust-hir-typ
From: badumbatish
gcc/rust/ChangeLog:
* backend/rust-compile-asm.cc (CompileAsm::add_stmt):
Scaffolding code.
(CompileAsm::asm_build_asm_stmt): Likewise.
(CompileAsm::asm_build_expr): Likewise.
(CompileAsm::asm_construct_string_tree): Likewise.
* b
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: 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: Arthur Cohen
If additional trait bounds aren't auto traits, then the typechecker
must error out (Rust-GCC#3008)
gcc/rust/ChangeLog:
* typecheck/rust-hir-type-check-type.cc: Add TODO note.
---
gcc/rust/typecheck/rust-hir-type-check-type.cc | 5 +
1 file changed, 5 inser
From: CohenArthur
This reverts commit 600fd806b8821ea24103ea0f31d666077245c6b7.
---
gcc/rust/ast/rust-collect-lang-items.cc | 7 ++-
gcc/rust/util/rust-attributes.cc| 8
gcc/rust/util/rust-attributes.h | 2 --
3 files changed, 6 insertions(+), 11 deletions(-)
diff -
From: Philip Herron
gcc/rust/ChangeLog:
* hir/rust-hir-dump.cc (Dump::visit): add missing null checks
Signed-off-by: Philip Herron
---
gcc/rust/hir/rust-hir-dump.cc | 12
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/gcc/rust/hir/rust-hir-dump.cc b/gcc/rus
From: Pierre-Emmanuel Patry
gcc/rust/ChangeLog:
* backend/rust-compile-base.cc: Prepend crate name to function's ir
name.
gcc/testsuite/ChangeLog:
* rust/compile/nr2/exclude: Remove passing tests from exclude list.
Signed-off-by: Pierre-Emmanuel Patry
---
gcc/rust/ba
From: Owen Avery
gcc/testsuite/ChangeLog:
* rust/compile/nr2/exclude: Add trailing newline along with
comment.
Signed-off-by: Owen Avery
---
gcc/testsuite/rust/compile/nr2/exclude | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/gcc/testsuite/rust/compile/
From: Arthur Cohen
gcc/rust/ChangeLog:
* Make-lang.in: Add new object file.
* rust-session-manager.cc (Session::compile_crate): Call
CollectLangItems.
* ast/rust-collect-lang-items.cc: New file.
* ast/rust-collect-lang-items.h: New file.
---
gcc/rust/Make
From: Pierre-Emmanuel Patry
gcc/rust/ChangeLog:
* backend/rust-compile-expr.cc (CompileExpr::visit): Change call.
(CompileExpr::resolve_operator_overload): Update function arguments.
* backend/rust-compile-expr.h: Change the function's prototype to use
a reference
From: jjasmine
Safegaurd InlineAsm's clone_expr_... with unreachable since
we would never use them.
gcc/rust/ChangeLog:
* ast/rust-expr.h:
Safegaurd InlineAsm's clone_expr_... with unreachable.
---
gcc/rust/ast/rust-expr.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/gcc
From: Owen Avery
gcc/testsuite/ChangeLog:
* rust/compile/nr2/compile.exp: Handle paths using "file join"
and "file split".
* rust/compile/nr2/exclude: Remove debug-diagnostics-on.rs.
Signed-off-by: Owen Avery
---
gcc/testsuite/rust/compile/nr2/compile.exp | 18
From: Owen Avery
gcc/rust/ChangeLog:
* backend/rust-compile-implitem.cc
(CompileTraitItem::visit): Use name resolver 2.0 (when enabled)
to obtain canonical paths for instances of TraitItemConst and
TraitItemFunc.
Signed-off-by: Owen Avery
---
gcc/rust/backend/r
From: Owen Avery
gcc/rust/ChangeLog:
* hir/rust-ast-lower-base.cc
(ASTLoweringBase::lower_literal): Lower raw string literals into
normal string literals.
gcc/testsuite/ChangeLog:
* rust/compile/issue-3549.rs: New test.
Signed-off-by: Owen Avery
---
gcc/rust/
From: Owen Avery
gcc/testsuite/ChangeLog:
* rust/compile/macros/mbe/macro43.rs: Adjust test to pass with
name resolution 2.0.
* rust/compile/nr2/exclude: Remove macros/mbe/macro43.rs.
Signed-off-by: Owen Avery
---
gcc/testsuite/rust/compile/macros/mbe/macro43.rs | 15 +
From: Owen Avery
gcc/rust/ChangeLog:
* typecheck/rust-hir-trait-resolve.cc: Add includes.
(TraitResolver::resolve_path_to_trait):
Use name resolution 2.0 resolver when enabled.
gcc/testsuite/ChangeLog:
* rust/compile/nr2/exclude: Remove entries.
Signed-off-by:
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: Arthur Cohen
gcc/rust/ChangeLog:
* typecheck/rust-hir-type-check-type.cc
(TypeCheckType::resolve_root_path): Adapt
code to handle lang item type paths.
---
.../typecheck/rust-hir-type-check-type.cc | 26 ---
1 file changed, 17 insertions(+), 9
From: Arthur Cohen
gcc/rust/ChangeLog:
* ast/rust-path.h: Adapt children of Path to fix some NodeId issues.
---
gcc/rust/ast/rust-path.h | 76 +++-
1 file changed, 37 insertions(+), 39 deletions(-)
diff --git a/gcc/rust/ast/rust-path.h b/gcc/rust
From: Philip Herron
This catch to inject inference variables into generic paths was a
catch all 'hack' that we needed before we handled generics correctly
as we do now.
Fixes #3009
gcc/rust/ChangeLog:
* typecheck/rust-hir-type-check-path.cc
(TypeCheckExpr::resolve_segments): remove ha
From: badumbatish
gcc/rust/ChangeLog:
* ast/rust-expr.h (struct AnonConst):
Safe-guard InlineAsm structs
(struct InlineAsmOperand): Likewise.
* expand/rust-macro-builtins-asm.cc (parse_reg_operand_in):
Likewise.
(parse_reg_operand_out): Likewise.
From: Owen Avery
gcc/testsuite/ChangeLog:
* rust/compile/const_generics_3.rs: Modify test to run with name
resolution 2.0 only and to handle the absence of a bogus
resolution error.
* rust/compile/nr2/exclude: Remove const_generics_3.rs.
Signed-off-by: Owen Avery
From: Owen Avery
gcc/rust/ChangeLog:
* backend/rust-compile-expr.cc
(CompileExpr::visit): Use name resolver 2.0 to lookup label
definitions for break and continue statements when name
resolution 2.0 is enabled.
Signed-off-by: Owen Avery
---
gcc/rust/backend/rus
From: Owen Avery
Since our bootstrap requirement has been bumped to C++14, we don't need
a custom implementation of std::make_unique anymore.
gcc/rust/ChangeLog:
* ast/rust-ast-builder-type.cc: Remove inclusion of
rust-make-unique.h.
* ast/rust-ast-builder.cc: Likewise.
From: Arthur Cohen
gcc/rust/ChangeLog:
* typecheck/rust-hir-type-check-type.cc
(TypeCheckType::resolve_root_path):
Remove unused capture in lambda.
---
gcc/rust/typecheck/rust-hir-type-check-type.cc | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/gcc
From: Arthur Cohen
Some failures occur in the testsuite because we
did not account for the little-endian case.
gcc/testsuite/ChangeLog:
* rust/compile/issue-1446.rs: Add swap_bytes function.
* rust/compile/iterators1.rs: Remove unused {to, from}_le functions.
---
gcc/testsuite
From: Philip Herron
Fixes Rust-GCC#3568
gcc/rust/ChangeLog:
* resolve/rust-ast-resolve-path.cc (ResolvePath::resolve_path): check
for super mid path
gcc/testsuite/ChangeLog:
* rust/compile/nr2/exclude: nr2 puts out a different error multiple
times
* rust/compile/issu
From: Pierre-Emmanuel Patry
FnParam type where monomorphized during cloning.
gcc/rust/ChangeLog:
* typecheck/rust-tyty.h: Reverse monomorphization during cloning and
make a new function to explicitly monomorphize.
* typecheck/rust-tyty.cc: Use monomorphization when requi
From: Owen Avery
This removes a usage of Resolver::get_unit_type_node_id in
rust-hir-type-check-expr.cc (the HIR::TupleExpr overload of
TypeCheckExpr::visit).
gcc/rust/ChangeLog:
* typecheck/rust-tyty.cc
(TupleType::get_unit_type): Remove parameter, cache return
value.
From: Pierre-Emmanuel Patry
Resolve TypeParam unless it is Self.
gcc/rust/ChangeLog:
* resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit): Resolve
TypeParam.
* resolve/rust-toplevel-name-resolver-2.0.h: Add visit function
prototype.
Signed-off-by: Pier
From: Arthur Cohen
gcc/testsuite/ChangeLog:
* rust/compile/cfg-core1.rs: New test.
* rust/compile/cfg-core2.rs: New test.
---
gcc/testsuite/rust/compile/cfg-core1.rs | 12
gcc/testsuite/rust/compile/cfg-core2.rs | 12
2 files changed, 24 insertions
From: Arthur Cohen
gcc/rust/ChangeLog:
* hir/tree/rust-hir-stmt.h (class LetStmt): Add optional diverging else
expression.
* hir/tree/rust-hir-stmt.cc: Likewise.
* hir/rust-ast-lower-stmt.cc (ASTLoweringStmt::visit): Add handling for
lowering
diverging else
From: Philip Herron
When we have paths such as Try::from_error the Try references the Trait
and then from_error references the from_error trait item. So this resolves
directly to a trait implementation which has the type:
fn (v: placeholder) -> Self
Remember that a path such as: Try::from_er
From: JoanVC
Fixes gccrs#3141.
gcc/rust/ChangeLog:
* backend/rust-compile-expr.cc
Signed-off-by: Joan Vilardaga
---
gcc/rust/backend/rust-compile-expr.cc | 11 +--
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/gcc/rust/backend/rust-compile-expr.cc
b/gcc/rust/
From: Pierre-Emmanuel Patry
Refactor some optional initializer in the lowering stage to make them
more readable.
gcc/rust/ChangeLog:
* hir/rust-ast-lower-stmt.cc (ASTLoweringStmt::visit): Change the
ternary expression with a more readable if.
Signed-off-by: Pierre-Emmanuel Patr
From: Philip Herron
This is a special case in Rust and the ! type can unify with pretty much
anything its almost a inference variable and a unit-type for special cases.
Fixes Rust-GCC/gccrs#3231
Fixes Rust-GCC/gccrs#2567
gcc/rust/ChangeLog:
* backend/rust-compile-expr.cc (check_match_s
From: Arthur Cohen
gcc/rust/ChangeLog:
* expand/rust-derive-copy.cc: Use new LangItemPath for derive(Copy).
---
gcc/rust/expand/rust-derive-copy.cc | 6 --
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/gcc/rust/expand/rust-derive-copy.cc
b/gcc/rust/expand/rust
From: liushuyu
gcc/rust/ChangeLog:
* backend/rust-compile-intrinsic.cc: add `try` intrinsic handler.
* lang.opt: add `-frust-panic` option.
* rust-lang.cc: enable exception handler code generation.
* rust-session-manager.cc: add getter and setter for panic
1 - 100 of 1169 matches
Mail list logo