From: Yap Zhi Heng
gcc/rust/ChangeLog:
* typecheck/rust-hir-type-check-pattern.cc
(TypeCheckPattern::visit(SlicePattern)):
Add new type check case for SliceType wrapped in ReferenceType.
* backend/rust-compile-pattern.cc: Adjusted the asserts accordingly for
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: 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: 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: 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: 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: Arthur Cohen
gcc/rust/ChangeLog:
* Make-lang.in: Compile the offset_of handler.
* lang.opt: Add -frust-assume-builtin-offset-of option.
* ast/rust-ast.h: Add has_str() for const_TokenPtr.
* expand/rust-macro-builtins.cc: Map offset_of as builtin
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: 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: 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: 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: 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
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: 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: 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: 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: 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,
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: 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: 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: 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: 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: 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: 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: 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: 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: 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: Arthur Cohen
gcc/rust/ChangeLog:
* ast/rust-ast.h: Add the new variant.
* ast/rust-expr.h: Use it for TryExpr class.
---
gcc/rust/ast/rust-ast.h | 1 +
gcc/rust/ast/rust-expr.h | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/gcc/rust/ast/rust-ast.h
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: 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: 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: 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
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: 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: 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
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: 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: 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: 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: 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: 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: 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: 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: 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: 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: Owen Avery
gcc/rust/ChangeLog:
* lang.opt (frust-name-resolution-2.0): Enable by default.
gcc/testsuite/ChangeLog:
* rust/compile/nr2/compile.exp: Removed.
* rust/compile/nr2/exclude: Removed.
Signed-off-by: Owen Avery
---
gcc/rust/lang.opt
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
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: 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: 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: Philip Herron
We have more complex test cases already but this will close out this issue.
Fixes Rust-GCC#2005
gcc/testsuite/ChangeLog:
* rust/execute/torture/issue-2005.rs: New test.
Signed-off-by: Philip Herron
---
.../rust/execute/torture/issue-2005.rs| 465 +
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: 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: 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-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: 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: 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: 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: 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: 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
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: 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: 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: 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: 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: 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
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
Its valid to unify a closure to an fnptr as we are working on the
fn traits. There are still other issues but this is part of the patch set.
gcc/rust/ChangeLog:
* typecheck/rust-unify.cc (UnifyRules::expect_fnptr): add unify rules
Signed-off-by: Philip Herron
---
From: Philip Herron
Refactor the dot operator implementation to improve code organization
and maintainability while preserving existing functionality.
gcc/rust/ChangeLog:
* typecheck/rust-hir-dot-operator.cc: Major refactoring and cleanup.
* typecheck/rust-hir-dot-operator.h: Ad
From: Philip Herron
Rename assemble_sized_builtin to assemble_marker_builtins and reorganize
the type matching to properly handle function pointers and closures with
their associated traits (Fn, FnMut, FnOnce).
gcc/rust/ChangeLog:
* typecheck/rust-hir-type-bounds.h: Rename method.
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
Prevent infinite loops when projecting associated types by properly
handling cyclical references with placeholder types.
gcc/rust/ChangeLog:
* typecheck/rust-hir-trait-resolve.cc: Add cyclical projection
protection.
---
gcc/rust/typecheck/rust-hir-trait-reso
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: Owen Avery
This fixes some issues with name resolution 2.0.
gcc/rust/ChangeLog:
* rust-session-manager.cc (Session::compile_crate): Move
AST desugaring to...
(Session::expansion): ...here and add a final TopLevel pass
afterwards.
gcc/testsuite/ChangeLog:
From: Philip Herron
Fixes Rust-GCC#3524
gcc/testsuite/ChangeLog:
* rust/compile/issue-3524.rs: New test.
Signed-off-by: Philip Herron
---
gcc/testsuite/rust/compile/issue-3524.rs | 9 +
1 file changed, 9 insertions(+)
create mode 100644 gcc/testsuite/rust/compile/issue-3524.
From: Philip Herron
This is an invalid test case and doesnt work with rustc, we dont fully pick
up the errors. Nr2 does handle this and puts out an extra good diagnostic
but the old NR doesnt so for now i added this to the exclude list and then
when we remove old name resolver this issue goes awa
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
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: 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: Zhi Heng
gcc/rust/ChangeLog:
* resolve/rust-late-name-resolver-2.0.cc
(Late::visit(IdentifierPattern)):
Remove redundant subpattern check.
Signed-off-by: Yap Zhi Heng
---
gcc/rust/resolve/rust-late-name-resolver-2.0.cc | 5 +
1 file changed, 1 insertion(+), 4 deleti
From: Arthur Cohen
gcc/rust/ChangeLog:
* ast/rust-ast.h: Add reconstruct() and reconstruct_impl() for Type
nodes.
* ast/rust-type.h: Implement them.
* ast/rust-macro.h: Likewise.
* ast/rust-path.h: Likewise.
---
gcc/rust/ast/rust-ast.h | 45
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:
* ast/rust-ast.h (reconstruct): New function for calling the
`reconstruct_*_impl` method
and asserting that the new NodeId is different, and then wrap it in a
unique_ptr.
(reconstruct_vec): Likewise, but for vectors of unique_ptr
From: Ryutaro Okada <1015ry...@gmail.com>
gcc/testsuite/ChangeLog:
* rust/compile/auto_traits2.rs:
emove warning for unused `self` parameter
* rust/compile/derive-debug1.rs:
emove warning for unused `self` parameter
* rust/compile/derive_macro1.rs:
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: 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: 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: Yap Zhi Heng
This commit implements basic type checking support for SlicePattern, based on
rustc's
check_pat_slice function.
gcc/rust/ChangeLog:
* typecheck/rust-hir-type-check-pattern.cc
(TypeCheckPattern::visit(SlicePattern)):
Implement initial type checking fo
From: Ryutaro Okada <1015ry...@gmail.com>
gcc/rust/ChangeLog:
* hir/tree/rust-hir-item.h (SelfParam::get_lifetime): Add getter
for non const lifetime object
Signed-off-by: Ryutaro Okada <1015ry...@gmail.com>
---
gcc/rust/hir/tree/rust-hir-item.h | 2 ++
1 file changed, 2 inserti
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: 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: 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: 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
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:
* 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: 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: 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: Owen Avery
DefaultResolver already handles StructStruct in a more correct fashion.
gcc/rust/ChangeLog:
* resolve/rust-late-name-resolver-2.0.cc (Late::visit): Remove
override for StructStruct visitor.
* resolve/rust-late-name-resolver-2.0.h (Late::visit): Likewise.
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: Arthur Cohen
gcc/rust/ChangeLog:
* expand/rust-derive-cmp-common.h (class EnumMatchBuilder): New helper
class.
* expand/rust-derive-cmp-common.cc (EnumMatchBuilder::tuple): New
function.
(EnumMatchBuilder::strukt): New function.
---
gcc/rust/expand/rust-derive
1 - 100 of 1416 matches
Mail list logo