From: Philip Herron
gcc/rust/ChangeLog:
* ast/rust-ast-collector.cc (TokenCollector::visit): check for value
Signed-off-by: Philip Herron
---
gcc/rust/ast/rust-ast-collector.cc | 8 +++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/gcc/rust/ast/rust-ast-collector.c
From: Pierre-Emmanuel Patry
gcc/rust/ChangeLog:
* hir/rust-ast-lower-implitem.cc (ASTLowerTraitItem::visit): Remove
use after move.
Signed-off-by: Pierre-Emmanuel Patry
---
gcc/rust/hir/rust-ast-lower-implitem.cc | 17 +
1 file changed, 9 insertions(+), 8 delet
From: Philip Herron
This old can_eq interface was an old method to try and check if types can match
up
by taking into account generics but its not maintained properly and we already
have
a new wrapper Resolver::types_compatable (type, type, locus, emit_errors) which
just calls unify_site_and in
From: Owen Avery
TopLevel would ignore just-loaded modules but Early and ExpandVisitor
wouldn't. The latter would produce errors when it hit attributes which
should have been indirectly CfgStrip'd away.
gcc/rust/ChangeLog:
* expand/rust-cfg-strip.cc (CfgStrip::visit): Load unloaded
From: Owen Avery
gcc/rust/ChangeLog:
* expand/rust-macro-builtins-helpers.cc
(try_extract_string_literal_from_fragment): Perform static_cast
to AST::LiteralExpr only after it's verified that an AST::Expr
is a literal.
Signed-off-by: Owen Avery
---
gcc/rust/expa
From: Owen Avery
gcc/rust/ChangeLog:
* ast/rust-ast.cc (AttributeParser::parse_path_meta_item): Catch
parse_expr returning nullptr and remove defunct comment.
Signed-off-by: Owen Avery
---
gcc/rust/ast/rust-ast.cc | 9 ++---
1 file changed, 6 insertions(+), 3 deletions(-)
From: Pierre-Emmanuel Patry
gcc/testsuite/ChangeLog:
* rust/execute/inline_asm_inout_ident.rs: New test.
* rust/execute/inline_asm_inout_var.rs: New test.
Signed-off-by: Pierre-Emmanuel Patry
---
.../rust/execute/inline_asm_inout_ident.rs| 23 ++
.../rust/e
From: Ryutaro Okada <1015ry...@gmail.com>
gcc/rust/ChangeLog:
* checks/lints/rust-lint-unused-var.cc (check_decl):
Do not warn about unused `self` parameter.
Signed-off-by: Ryutaro Okada <1015ry...@gmail.com>
---
gcc/rust/checks/lints/rust-lint-unused-var.cc | 4 +++-
1 file cha
From: Pierre-Emmanuel Patry
gcc/rust/ChangeLog:
* hir/rust-hir-dump.cc (Dump::visit): Dump inline assembly fields
* hir/tree/rust-hir-expr.h: Add non const getter and avoid operand copy
from getters.
* hir/tree/rust-hir-visitor.cc (DefaultHIRVisitor::walk): Use no
From: Owen Avery
gcc/rust/ChangeLog:
* typecheck/rust-hir-type-check-base.cc
(TypeCheckBase::TypeCheckBase): Remove initialization of
resolver field.
* typecheck/rust-hir-type-check-base.h
(TypeCheckBase::resolver): Remove field.
* typecheck/rust-h
From: Ryutaro Okada <1015ry...@gmail.com>
gcc/rust/ChangeLog:
* Make-lang.in (rust-readonly-check2.cc):
Add read-only check on HIR
* checks/errors/rust-readonly-check2.cc (ReadonlyChecker):
Add read-only check on HIR
* checks/errors/rust-readonly-check2.h (
From: Philip Herron
In order to support const generics we map the declarations to a ConstType this
means we reuse all our existing type coercion, unification code and generic
substitutions code to support this with minimal impact.
This patch adds support for:
1. Default const generics
2. Infer
From: Ryutaro Okada <1015ry...@gmail.com>
gcc/rust/ChangeLog:
* hir/tree/rust-hir-visitor.cc (DefaultHIRVisitor::walk):
Add check before calling `get_trait_ref()`
Signed-off-by: Ryutaro Okada <1015ry...@gmail.com>
---
gcc/rust/hir/tree/rust-hir-visitor.cc | 3 ++-
1 file change
From: Philip Herron
gcc/rust/ChangeLog:
* typecheck/rust-tyty-subst.cc (SubstitutionRef::infer_substitions):
remove debug
Signed-off-by: Philip Herron
---
gcc/rust/typecheck/rust-tyty-subst.cc | 7 ---
1 file changed, 7 deletions(-)
diff --git a/gcc/rust/typecheck/rust-tyty-subs
From: Philip Herron
We already support const infer so this just creates a fresh tyty::infer_var
for the const element type and then a ConstKind::Infer type for the const
type wrapper and the existing plumbing handles this.
Fixes Rust-GCC#3885
gcc/rust/ChangeLog:
* typecheck/rust-hir-ty
From: Pierre-Emmanuel Patry
gcc/rust/ChangeLog:
* hir/rust-ast-lower-pattern.cc
(ASTLoweringPattern::ASTLoweringPattern):
flag was not initialized in the constructor.
Signed-off-by: Pierre-Emmanuel Patry
---
gcc/rust/hir/rust-ast-lower-pattern.cc | 4 +++-
1 file changed, 3 i
From: Arthur Cohen
gcc/rust/ChangeLog:
* hir/rust-ast-lower-base.cc: Add rust_unreachable() when lowering
desugared exprs.
* hir/rust-ast-lower-base.h: Mention this.
* hir/rust-ast-lower-block.h: Remove existing definitions.
* hir/rust-ast-lower-expr.cc
From: Ryutaro Okada <1015ry...@gmail.com>
gcc/rust/ChangeLog:
* hir/rust-ast-lower-implitem.cc (ASTLowerTraitItem::visit):
Fix object copying issue causing pointer inconsistency
Signed-off-by: Ryutaro Okada <1015ry...@gmail.com>
---
gcc/rust/hir/rust-ast-lower-implitem.cc | 2 +-
From: Owen Avery
gcc/rust/ChangeLog:
* ast/rust-ast.cc (AttributeParser::parse_meta_item_inner):
Handle removal of AttributeParser-specific functions.
(AttributeParser::parse_path_meta_item): Likewise.
(AttributeParser::parse_meta_item_seq): Likewise.
(Att
From: Philip Herron
gcc/testsuite/ChangeLog:
* rust/execute/torture/const-generics-1.rs: New test.
Signed-off-by: Philip Herron
---
.../rust/execute/torture/const-generics-1.rs | 24 +++
1 file changed, 24 insertions(+)
create mode 100644 gcc/testsuite/rust/execute/t
From: Yap Zhi Heng
006t.original output from compiling
testsuite/rust/compile/match-slicepattern-slice.rs:
...
RUSTTMP.3 = slice;
if (RUSTTMP.3.len == 1 && *(RUSTTMP.3.data + 0 * 4) == 1)
{
{
struct () RUSTTMP.4;
{
}
goto ;
}
}
From: Yap Zhi Heng
The main change can be found in ast/rust-pattern.h, which introduces 2 item
types for
AST::SlicePattern - one without rest pattern (SlicePatternItemsNoRest) & the
other with
it (SlicePatternItemsHasRest). This led to a number of cascading changes as
seen in the
changelog.
g
From: Arthur Cohen
gcc/rust/ChangeLog:
* backend/rust-compile-expr.cc (CompileExpr::visit): Add proper handling
of the node.
* rust-backend.h (lookup_field): Declare it.
* rust-gcc.cc (lookup_field): Add forked implementation from gcc/c/.
gcc/testsuite/ChangeLog
From: Philip Herron
This patch is all about just putting in the boiler plate for the new
BaseGeneric TyTy::ConstType. Nothing is really change but just the
nessecary cogs added to the machine.
gcc/rust/ChangeLog:
* backend/rust-compile-type.cc (TyTyResolveCompile::visit):
error_mark_no
From: Philip Herron
The substitution code was not taking into account the const generic
arguments for checking the max bounds of total available parameters.
Fixes Rust-GCC#3546
gcc/rust/ChangeLog:
* typecheck/rust-tyty-subst.cc: fix check for total arguments
gcc/testsuite/ChangeLog:
From: Philip Herron
In order to support const generics we need to abstract away some of the specific
ParamType to a BaseGeneric type so we can easily reuse our existing substitution
bits for const generics which will mean creating a TyTy::ConstType to wrap up
the gcc tree but also represent a con
From: Pierre-Emmanuel Patry
gcc/rust/ChangeLog:
* expand/rust-macro-builtins-helpers.cc: Remove use after move.
Signed-off-by: Pierre-Emmanuel Patry
---
gcc/rust/expand/rust-macro-builtins-helpers.cc | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/gcc/rust/expand
From: Philip Herron
We dont need to do this resolve we can just let the ParamType's sort this
out.
gcc/rust/ChangeLog:
* typecheck/rust-tyty.cc (ADTType::is_equal): let param::is_eq do this
(FnType::is_equal): remove whitespace
Signed-off-by: Philip Herron
---
gcc/rust/typech
From: Pierre-Emmanuel Patry
gcc/rust/ChangeLog:
* ast/rust-ast.cc (AttrInputMacro::operator=): Add return type.
* ast/rust-expr.h: Likewise.
Signed-off-by: Pierre-Emmanuel Patry
---
gcc/rust/ast/rust-ast.cc | 3 ++-
gcc/rust/ast/rust-expr.h | 8 ++--
2 files changed, 8 ins
From: Pierre-Emmanuel Patry
A missing comma between inline assembly templates did not throw an error
and looped indefinitely.
gcc/rust/ChangeLog:
* expand/rust-macro-builtins-asm.cc (parse_format_strings): Emit an
error when expecting a comma.
gcc/testsuite/ChangeLog:
From: Pierre-Emmanuel Patry
Remove namespace comment after classes and structs.
gcc/rust/ChangeLog:
* checks/errors/borrowck/rust-bir-fact-collector.h: Remove spurious
comment.
* checks/errors/rust-feature.cc: Likewise.
* util/optional.h: Likewise.
* expa
From: Philip Herron
gcc/rust/ChangeLog:
* hir/rust-hir-dump.cc (Dump::visit): check for expression
* hir/tree/rust-hir.cc (AnonConst::as_string): likewise
Signed-off-by: Philip Herron
---
gcc/rust/hir/rust-hir-dump.cc | 5 -
gcc/rust/hir/tree/rust-hir.cc | 5 -
2 files
From: Philip Herron
gcc/rust/ChangeLog:
* typecheck/rust-type-util.cc (unify_site_and): improve debug
Signed-off-by: Philip Herron
---
gcc/rust/typecheck/rust-type-util.cc | 20
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/gcc/rust/typecheck/rust
From: Philip Herron
We assert that struct expressions during code-gen must be of TyTy::ADTType
but we can simply just check for this and return error_mark_node to make
this safe.
Fixes Rust-GCC#3960
gcc/rust/ChangeLog:
* backend/rust-compile-expr.cc (CompileExpr::visit): check for ADTT
From: Pierre-Emmanuel Patry
Previously inline assembly expected identifiers instead of expression.
gcc/rust/ChangeLog:
* expand/rust-macro-builtins-asm.cc (parse_reg_operand_inout): Parse
expressions and build split in out.
Signed-off-by: Pierre-Emmanuel Patry
---
gcc/rust/ex
From: Philip Herron
This is an initial patch required to refactor our generics code to be
simpler and more abstract so we return the HIR::GenericParam in ParamMappings
instead of assuming its a TypeParam so we can slowly introduce ConstGenericParam
into this same flow.
gcc/rust/ChangeLog:
From: Philip Herron
gcc/rust/ChangeLog:
* typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit):
formatting
* typecheck/rust-tyty-variance-analysis-private.h: likewise
* typecheck/rust-tyty.cc (VariantDef::clone): likewise
(VariantDef::monomorphized_clone)
From: Arthur Cohen
gcc/rust/ChangeLog:
* ast/rust-desugar-for-loops.cc: Remove functions implemented in
AST::Builder.
* ast/rust-desugar-for-loops.h: Likewise.
---
gcc/rust/ast/rust-desugar-for-loops.cc | 23 ---
gcc/rust/ast/rust-desugar-for-loops.h | 2
From: Pierre-Emmanuel Patry
Inline assembly was incomplete and input/output from inout or split in
out were not handled.
gcc/rust/ChangeLog:
* backend/rust-compile-asm.cc (get_out_expr): Return valid output from
an operand.
(CompileAsm::asm_construct_outputs): Handle eve
From: Pierre-Emmanuel Patry
gcc/rust/ChangeLog:
* expand/rust-macro-builtins-asm.cc (expand_inline_asm_strings): Handle
transformation for indexed positional arguments.
Signed-off-by: Pierre-Emmanuel Patry
---
gcc/rust/expand/rust-macro-builtins-asm.cc | 5 +
1 file change
From: Owen Avery
This should reduce incremental compile times when modifying
rust-parse-impl.h and not rust-parse.h.
gcc/rust/ChangeLog:
* Make-lang.in (GRS_OBJS): Add entries.
* parse/rust-parse-impl.h: Adjust header comment.
(Parser::parse_lifetime_params_objs): Fix bu
From: Arthur Cohen
gcc/rust/ChangeLog:
* ast/rust-desugar-for-loops.h: Adapt API and remove visitor.
* ast/rust-desugar-for-loops.cc: Likewise.
* ast/rust-expression-yeast.cc: Call DesugarForLoop.
* ast/rust-expression-yeast.h: Declare dispatch_loops function
From: Owen Avery
This should make it easier for us to handle attribute meta items of the
form '=' where the expression isn't a literal.
Some low hanging fruit remains here, but I think I should keep this
patch small as I had some trouble debugging it as-is (see:
Rust::Token::as_string vs Rust::
From: Arthur Cohen
gcc/rust/ChangeLog:
* ast/rust-ast.h: Add OffsetOf expression kind.
* ast/rust-builtin-ast-nodes.h (class OffsetOf): Add node.
* ast/rust-ast.cc: Define it.
* ast/rust-ast-collector.cc: Add visitor for OffsetOf.
* ast/rust-ast
From: Pierre-Emmanuel Patry
gcc/rust/ChangeLog:
* ast/rust-ast.cc (AttributeParser::parse_path_meta_item): Parse
expression instead of literal. Update variant name.
(MetaItemPathLit::to_attribute): Remove function.
(AttributeParser::parse_path_meta_item): Update n
From: Arthur Cohen
gcc/rust/ChangeLog:
* ast/rust-desugar-question-mark.cc (DesugarQuestionMark::go): Add
assertion for the
expr's type.
* ast/rust-desugar-try-block.cc (DesugarTryBlock::go): Likewise.
---
gcc/rust/ast/rust-desugar-question-mark.cc | 3 ++-
gcc
From: Yap Zhi Heng
Example GIMPLE output from compiling
testsuite/rust/compile/match-pattern-array.rs:
...
a[0] = 0;
a[1] = 1;
RUSTTMP.3 = a;
_1 = RUSTTMP.3[0];
_2 = _1 == 0;
_3 = RUSTTMP.3[1];
_4 = _3 == 1;
_5 = _2 & _4;
if (_5 != 0) goto ; else goto ;
:
{
{
From: Philip Herron
gcc/rust/ChangeLog:
* typecheck/rust-tyty-subst.cc: track the const generic
* typecheck/rust-tyty.cc (ConstType::is_equal): finish the is_equal
Signed-off-by: Philip Herron
---
gcc/rust/typecheck/rust-tyty-subst.cc | 7 +--
gcc/rust/typecheck/rust-tyty
From: Arthur Cohen
gcc/rust/ChangeLog:
* ast/rust-expr.h: Add handling for deferred consts.
* ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Likewise.
* ast/rust-ast.cc (AnonConst::as_string): Likewise.
(ArrayType::as_string): Likewise.
* ast/rust
From: Arthur Cohen
gcc/rust/ChangeLog:
* hir/tree/rust-hir-expr.h (class OffsetOf): New.
* hir/tree/rust-hir-expr.cc: Define its methods.
* hir/tree/rust-hir-expr-abstract.h: Add ExprType::OffsetOf.
* hir/tree/rust-hir-full-decls.h (class OffsetOf): Declare it
From: Arthur Cohen
gcc/rust/ChangeLog:
* Make-lang.in:
* ast/rust-expression-yeast.cc (ExpressionYeast::dispatch_loops): Call
DesugarWhileLet.
* ast/rust-desugar-while-let.cc: New file.
* ast/rust-desugar-while-let.h: New file.
gcc/testsuite/ChangeLog
From: Pierre-Emmanuel Patry
gcc/rust/ChangeLog:
* rust-diagnostics.h (struct Error): Add disambiguation.
Signed-off-by: Pierre-Emmanuel Patry
---
gcc/rust/rust-diagnostics.h | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/gcc/rust/rust-diagnostics.h b/gcc/r
From: Marc Poulhiès
Fix narrowing:
-../../gcc/rust/checks/errors/borrowck/rust-borrow-checker-diagnostics.cc:145:46:
warning: narrowing conversion of ‘loan’ from ‘Rust::Polonius::Loan’ {aka
‘long unsigned int’} to ‘uint32_t’ {aka ‘unsigned int’} [-Wnarrowing]
gcc/rust/ChangeLog:
From: Arthur Cohen
gcc/rust/ChangeLog:
* resolve/rust-early-name-resolver-2.0.cc (Early::resolve_glob_import):
Adapt for enums.
(Early::finalize_glob_import): Likewise.
* resolve/rust-early-name-resolver-2.0.h: Likewise.
* resolve/rust-finalize-imports-2.0.cc
From: Yap Zhi Heng
This change is made to ensure that LiteralPatterns in SlicePattern are
type-checked
against the scrutinee array/slice's element type properly.
gcc/rust/ChangeLog:
*
typecheck/rust-hir-type-check-pattern.cc(TypeCheckPattern::visit(LiteralPattern)):
Ch
From: Philip Herron
Not adding the test case here we emit more errors than rustc for the error
type node so its just noisy and dejagnu is being a pain.
Fixes Rust-GCC#3933
gcc/rust/ChangeLog:
* backend/rust-compile-resolve-path.cc (ResolvePathRef::resolve):
return error_mark_node
Sig
From: Philip Herron
In the test case:
fn test (len: usize) -> u64 {
let mut i = 0;
let mut out = 0;
if i + 3 < len {
out = 123;
}
out
}
The issue is to determine the correct type of 'i', out is simple because it
hits a
coercion site in the resturn position
From: Pierre-Emmanuel Patry
Flag was left uninitialized within default constructor.
gcc/rust/ChangeLog:
* hir/rust-hir-dump.cc (Dump::Dump): Initialize flag.
Signed-off-by: Pierre-Emmanuel Patry
---
gcc/rust/hir/rust-hir-dump.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From: Arthur Cohen
gcc/rust/ChangeLog:
* ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Visit a block's
loop label if it
exists.
---
gcc/rust/ast/rust-ast-visitor.cc | 5 +
1 file changed, 5 insertions(+)
diff --git a/gcc/rust/ast/rust-ast-visitor.cc b/gcc/rus
From: Philip Herron
Rust seems to allow duplicate HIR::Item 'main' functions but it needs
to be a root item to be the true main entry point. This means we can
use the canonical path to determine if this is a root one where
its CrateName::main or CrateName::Module::main.
Fixes Rust-GCC#3978
gcc/
From: Owen Avery
gcc/rust/ChangeLog:
* parse/rust-parse-impl.h (Parser::parse_simple_path): Be more
careful about skipping SCOPE_RESOLUTION tokens.
(Parser::parse_simple_path_segment): Allow parsing from a
starting offset.
(Parser::parse_use_tree): Handle
From: Arthur Cohen
gcc/rust/ChangeLog:
* ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Check that the
WhileLet has a label
before visiting it.
gcc/testsuite/ChangeLog:
* rust/compile/while_let_without_label.rs: New test.
---
gcc/rust/ast/rust-ast-visitor.cc
From: Pierre-Emmanuel Patry
gcc/rust/ChangeLog:
* parse/rust-parse-impl.h: Add enum prefix.
* parse/rust-parse.h (enum ParseSelfError): Change from enum...
(enum class): To enum class.
Signed-off-by: Pierre-Emmanuel Patry
---
gcc/rust/parse/rust-parse-impl.h | 6 --
From: Owen Avery
This relies on the DefaultASTVisitor visitor for IfLetExprConseqElse
performing a virtual call of the visitor for IfLetExpr, which doesn't
hold when DefaultASTVisitor is generated by the X-macro-DSL-system I
have in another patch.
gcc/rust/ChangeLog:
* resolve/rust-defa
From: Arthur Cohen
gcc/rust/ChangeLog:
* ast/rust-expr.h: Fix formatting.
---
gcc/rust/ast/rust-expr.h | 89 +++-
1 file changed, 43 insertions(+), 46 deletions(-)
diff --git a/gcc/rust/ast/rust-expr.h b/gcc/rust/ast/rust-expr.h
index c875d6914b3
From: Owen Avery
gcc/testsuite/ChangeLog:
* rust/compile/additional-trait-bounds2nr2.rs: Remove
-frust-name-resolution-2.0 usage.
* rust/compile/const_generics_3.rs: Likewise.
* rust/compile/enum_variant_name.rs: Likewise.
* rust/compile/generics9.rs: Like
From: Yap Zhi Heng
gcc/rust/ChangeLog:
*
typecheck/rust-hir-type-check-pattern.cc(TypeCheckPattern::visit(SlicePattern)):
Implement size checking for SlicePattern when type checking
against array parent
Signed-off-by: Yap Zhi Heng
---
.../typecheck/rust-hir-type-chec
From: Zhi Heng
Example GIMPLE output of the match statement for match-restpattern-tuple-1.rs:
...
RUSTTMP.2 = x;
_1 = RUSTTMP.2.__0;
_2 = _1 == 1;
_3 = RUSTTMP.2.__3;
_4 = _3 == 4;
_5 = _2 & _4;
if (_5 != 0) goto ; else goto ;
:
{
{
}
goto ;
}
:
if (1 != 0) goto ; else goto ;
:
{
From: Arthur Cohen
Since we are doing more and more "external" desugars, as in desugars
that take a pointer and replace it with another one, rather than
modifying it from within, having an external visitor dispatch to the
proper desugar helps with code clarity.
gcc/rust
From: Owen Avery
gcc/rust/ChangeLog:
* resolve/rust-late-name-resolver-2.0.cc
(visit_identifier_as_pattern): Handle is_ref and is_mut.
(Late::visit): Likewise.
* resolve/rust-name-resolution-context.cc
(BindingLayer::insert_ident): Likewise.
(Bindi
From: Owen Avery
This prioritizes resolution in the language prelude over resolution as a
module.
gcc/rust/ChangeLog:
* resolve/rust-forever-stack.hxx (ForeverStack::resolve_path):
Resolve final segments which point to modules.
* resolve/rust-toplevel-name-resolver-2.0.c
From: Pierre-Emmanuel Patry
gcc/rust/ChangeLog:
* ast/rust-expr.h: Add getter to locus field.
* ast/rust-pattern.h (tokenid_to_rangekind): Likewise.
* hir/tree/rust-hir-item.h: Likewise.
* hir/tree/rust-hir-visibility.h: Likewise.
Signed-off-by: Pierre-Emmanuel P
From: Philip Herron
Fixes Rust-GCC#1048
gcc/testsuite/ChangeLog:
* rust/compile/issue-1048.rs: New test.
Signed-off-by: Philip Herron
---
gcc/testsuite/rust/compile/issue-1048.rs | 8
1 file changed, 8 insertions(+)
create mode 100644 gcc/testsuite/rust/compile/issue-1048.r
From: Philip Herron
When we have generic paths like T::foobar during codegen sometimes we need
to enforce an extra lookup for this generic parameter type to the mono
morphized underlying type.
Fixes Rust-GCC#3915
Fixes Rust-GCC#1247
gcc/rust/ChangeLog:
* backend/rust-compile-resolve-pa
From: Zhi Heng
This patch implements the previously unimplemented type checking for RANGED item
type for TuplePattern, which serves as the start for implementing compilation of
RestPattern.
gcc/rust/ChangeLog:
* typecheck/rust-hir-type-check-pattern.cc
(TypeCheckPattern::visit(TuplePat
From: Arthur Cohen
This is important for importing enum variants as items.
gcc/rust/ChangeLog:
* util/rust-hir-map.cc (Mappings::insert_ast_module): Rename to...
(Mappings::insert_glob_container): ...this.
(Mappings::lookup_ast_module): Rename to...
(Mappings
From: Arthur Cohen
gcc/rust/ChangeLog:
* hir/rust-ast-lower-expr.cc (ASTLoweringExpr::visit): Handle defered
consts.
* hir/tree/rust-hir-expr.cc (AnonConst::AnonConst): Likewise.
(AnonConst::operator=): Likewise.
* hir/tree/rust-hir-expr.h: Likewise
From: Philip Herron
Fixes Rust-GCC#3599
gcc/testsuite/ChangeLog:
* rust/compile/issue-3599.rs: New test.
Signed-off-by: Philip Herron
---
gcc/testsuite/rust/compile/issue-3599.rs | 8
1 file changed, 8 insertions(+)
create mode 100644 gcc/testsuite/rust/compile/issue-3599.r
From: Owen Avery
gcc/rust/ChangeLog:
* expand/rust-expand-visitor.cc
(ExpandVisitor::expand_inner_items): Adjust call to
expand_macro_children.
(ExpandVisitor::expand_inner_stmts): Likewise.
(ExpandVisitor::visit): Likewise.
* expand/rust-expand-vi
From: Owen Avery
gcc/rust/ChangeLog:
* rust-lang.cc: Move version check from C++11 to C++14.
Signed-off-by: Owen Avery
---
gcc/rust/rust-lang.cc | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/gcc/rust/rust-lang.cc b/gcc/rust/rust-lang.cc
index 35003ab327b..9
From: Arthur Cohen
gcc/rust/ChangeLog:
* util/rust-attribute-values.h: Add declarations for them.
* util/rust-attributes.cc: Add definitions.
---
gcc/rust/util/rust-attribute-values.h | 4
gcc/rust/util/rust-attributes.cc | 5 -
2 files changed, 8 insertions(+), 1
From: Owen Avery
This doesn't do anything beyond creating TryExpr and parsing them, so
try expressions shouldn't be able to make it past AST lowering yet.
gcc/rust/ChangeLog:
* ast/rust-ast-collector.cc (TokenCollector::visit): Add visitor
for TryExpr.
* ast/rust-ast-col
From: lishin
gcc/rust/ChangeLog:
* backend/rust-compile-expr.cc (CompileExpr::visit): Add a catch for
const/static.
gcc/testsuite/ChangeLog:
* rust/compile/loop_constant_context.rs: New test.
* rust/compile/issue-3618.rs:
Signed-off-by: lishin
---
gcc/rust/backend/r
From: Philip Herron
There was a sily bug where if you reorder this test case to declare A before B
this test would work but its meant to work in any order. So this fixes the bug
during code gen to fall back to our query compile system if this is needed.
Fixes Rust-GCC#3525
gcc/rust/ChangeLog:
From: Philip Herron
Fixes Rust-GCC#3144
gcc/testsuite/ChangeLog:
* rust/compile/issue-3144.rs: New test.
Signed-off-by: Philip Herron
---
gcc/testsuite/rust/compile/issue-3144.rs | 29
1 file changed, 29 insertions(+)
create mode 100644 gcc/testsuite/rust/co
From: Owen Avery
gcc/rust/ChangeLog:
* expand/rust-macro-builtins-format-args.cc
(format_args_parse_arguments): Accept a RAW_STRING_LITERAL token
as the first argument.
Signed-off-by: Owen Avery
---
gcc/rust/expand/rust-macro-builtins-format-args.cc | 11 +--
1
From: Philip Herron
Ensure proper ordering when resolving trait references to prevent
incorrect type resolution in certain contexts.
gcc/rust/ChangeLog:
* typecheck/rust-hir-trait-reference.cc (TraitReference::on_resolved):
ensure associated
types are done first
* typec
From: Philip Herron
We just had a typo returning ok true when it should have been false.
Fixes Rust-GCC#3876
gcc/rust/ChangeLog:
* typecheck/rust-hir-type-check-struct.cc (TypeCheckStructExpr::visit):
fix typo
gcc/testsuite/ChangeLog:
* rust/compile/issue-3876.rs: New test.
From: Arthur Cohen
gcc/rust/ChangeLog:
* resolve/rust-late-name-resolver-2.0.cc (Late::visit): Check for a
label
before visiting it.
---
gcc/rust/resolve/rust-late-name-resolver-2.0.cc | 5 -
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/gcc/rust/resolve
From: Arthur Cohen
gcc/rust/ChangeLog:
* Make-lang.in: Remove object file for ASTTypeBuilder.
* ast/rust-ast-builder.h: Remove function.
* ast/rust-ast-builder.cc (Builder::new_type): Likewise.
(Builder::new_const_param): Use reconstruct_type() instead
From: Philip Herron
When resolving type bounds, we need to examine super traits to properly
determine if type bindings are valid in the current context.
gcc/rust/ChangeLog:
* typecheck/rust-tyty-bounds.cc: Check super traits for type bindings.
* typecheck/rust-tyty.h: Add helper
From: Arthur Cohen
gcc/rust/ChangeLog:
* resolve/rust-late-name-resolver-2.0.cc (Late::visit): New visitor.
* resolve/rust-late-name-resolver-2.0.h: Declare it.
* resolve/rust-name-resolution-context.h (enum class): New binding
context.
---
.../resolve/rust-late-name
From: Philip Herron
This patch adds proper folding to the const expression for array capacity we
already have the const folding mechanics and the query system needed to handle
cases
where the capacity is a function call in a const context. This leverages and
pulls the
gcc tree capacity into the
From: Ryutaro Okada <1015ry...@gmail.com>
gcc/rust/ChangeLog:
* Make-lang.in: Scaffolding new rust-hir-visitor files
* hir/tree/rust-hir-visitor.h (DefaultHIRVisitor): Declare default HIR
visitor
* hir/tree/rust-hir-visitor.cc (DefaultHIRVisitor): Define default HIR
vis
From: Owen Avery
gcc/rust/ChangeLog:
* ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Replace
usages of reinterpret_cast with static_cast.
Signed-off-by: Owen Avery
---
gcc/rust/ast/rust-ast-visitor.cc | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --gi
From: Owen Avery
This doesn't handle rustc_args_required_const, but it does allow us to
recognize it as a valid attribute.
gcc/rust/ChangeLog:
* util/rust-attribute-values.h
(Attributes::RUSTC_ARGS_REQUIRED_CONST): New constexpr variable.
* util/rust-attributes.cc (__def
From: Ryutaro Okada <1015ry...@gmail.com>
gcc/rust/ChangeLog:
* hir/tree/rust-hir-expr.h (MatchArm::get_outer_attrs): Add getter for
outer attributions
Signed-off-by: Ryutaro Okada <1015ry...@gmail.com>
---
gcc/rust/hir/tree/rust-hir-expr.h | 2 ++
1 file changed, 2 insertions(+)
diff
From: Arthur Cohen
gcc/rust/ChangeLog:
* expand/rust-derive.cc: Fix formatting after fork update.
---
gcc/rust/expand/rust-derive.cc | 9 ++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/gcc/rust/expand/rust-derive.cc b/gcc/rust/expand/rust-derive.cc
index
From: Owen Avery
This is the first patch in a set intended to fully remove name
resolution 1.0. As such, it should leave name resolution 1.0 technically
available but broken.
gcc/rust/ChangeLog:
* backend/rust-compile-context.cc (Context::Context): Remove
initialization of resol
From: Ryutaro Okada <1015ry...@gmail.com>
gcc/rust/ChangeLog:
* hir/tree/rust-hir-visitor.cc (DefaultHIRVisitor::walk):
Call base class's accept_vis method
Signed-off-by: Ryutaro Okada <1015ry...@gmail.com>
---
gcc/rust/hir/tree/rust-hir-visitor.cc | 8
1 file changed,
1 - 100 of 1423 matches
Mail list logo