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: 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: 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:
* 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: 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-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
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-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: 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: 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: Philip Herron
Addresses Rust-GCC#3382 and Rust-GCC#3381
gcc/rust/ChangeLog:
* typecheck/rust-type-util.cc (coercion_site): allow inference vars
gcc/testsuite/ChangeLog:
* rust/compile/reference1.rs: fix error message
Signed-off-by: Philip Herron
---
gcc/rust/typecheck
From: Owen Avery
gcc/rust/ChangeLog:
* backend/rust-compile-expr.cc
(CompileExpr::generate_closure_function): Take
NameResolutionContext by reference instead of by value.
* backend/rust-compile-item.cc
(CompileItem::visit): Likewise.
* backend/rust
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: Arthur Cohen
Some empty overrides were incorrectly being set-up instead of using the correct
behavior
from DefaultASTVisitor.
gcc/rust/ChangeLog:
* resolve/rust-early-name-resolver.cc: Remove definitions.
* resolve/rust-early-name-resolver.h: Remove declarations
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: Owen Avery
gcc/rust/ChangeLog:
* resolve/rust-early-name-resolver-2.0.cc:
Include rust-attribute-values.h.
(Early::visit): If a module has a macro_use attribute, avoid
pushing a new textual macro scope.
gcc/testsuite/ChangeLog:
* rust/compile/nr2/e
From: Arthur Cohen
gcc/rust/ChangeLog:
* expand/rust-expand-visitor.cc (ExpandVisitor::visit): Correctly visit
the generic args
of a generic type path segment.
gcc/testsuite/ChangeLog:
* rust/compile/issue-2015.rs: New test.
---
gcc/rust/expand/rust-expand-visitor.cc
From: Arthur Cohen
gcc/rust/ChangeLog:
* checks/lints/rust-lint-scan-deadcode.h: Check if the field name
starts with an
underscore before warning.
---
gcc/rust/checks/lints/rust-lint-scan-deadcode.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/gcc/rust
From: Arthur Cohen
gcc/rust/ChangeLog:
* ast/rust-ast-builder.cc: New methods.
* ast/rust-ast-builder.h: Declare them.
---
gcc/rust/ast/rust-ast-builder.cc | 62
gcc/rust/ast/rust-ast-builder.h | 36 +--
2 files changed, 96
From: Arthur Cohen
gcc/rust/ChangeLog:
* rust-session-manager.cc (Session::compile_crate): Call
DesugarQuestionMark::go().
---
gcc/rust/rust-session-manager.cc | 2 ++
1 file changed, 2 insertions(+)
diff --git a/gcc/rust/rust-session-manager.cc b/gcc/rust/rust-session-manager.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: Arthur Cohen
gcc/rust/ChangeLog:
* expand/rust-derive.cc (DeriveVisitor::setup_impl_generics): New
method.
* expand/rust-derive.h: Declare it, define DeriveVisitor::ImplGenerics
struct.
---
gcc/rust/expand/rust-derive.cc | 74 ++
gcc/rust
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: 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: 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
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: 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: Liam Naddell
gcc/rust/ChangeLog:
* expand/rust-macro-builtins-utility.cc: Add macro expansion for
option_env with eager expansion
* expand/rust-macro-builtins.cc: Add option_env to builtin list
* expand/rust-macro-builtins.h: Add option_env handler to header
From: Arthur Cohen
gcc/rust/ChangeLog:
* expand/rust-derive-eq.cc: Adapt functions to return two generated
impls.
* expand/rust-derive-eq.h: Likewise.
* expand/rust-derive.cc (DeriveVisitor::derive): Likewise.
---
gcc/rust/expand/rust-derive-eq.cc | 68
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: 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: 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: Pierre-Emmanuel Patry
gcc/rust/ChangeLog:
* util/rust-hir-map.cc (Mappings::lookup_crate_num): Add function to
retrieve crate number from it's node id.
(Mappings::node_is_crate): change function with call to
lookup_crate_num to avoid looping through all crat
From: Arthur Cohen
gcc/rust/ChangeLog:
* ast/rust-ast-builder.cc (Builder::type_path): New functions.
* ast/rust-ast-builder.h: Declare them.
---
gcc/rust/ast/rust-ast-builder.cc | 21 -
gcc/rust/ast/rust-ast-builder.h | 4
2 files changed, 24
From: Arthur Cohen
gcc/rust/ChangeLog:
* ast/rust-desugar-for-loops.cc: New file.
* ast/rust-desugar-for-loops.h: New file.
* hir/rust-ast-lower-expr.cc (ASTLoweringExpr::visit): Make lowering of
for-loops an
unreachable.
* Make-lang.in: Compile it.
gcc
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: 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: 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-eq.cc: Copy `Eq` typepath.
---
gcc/rust/expand/rust-derive-eq.cc | 6 +-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/gcc/rust/expand/rust-derive-eq.cc
b/gcc/rust/expand/rust-derive-eq.cc
index 47a8350d2ff
From: Arthur Cohen
gcc/rust/ChangeLog:
* expand/rust-derive.cc (DeriveVisitor::derive): Return a vector of
items.
* expand/rust-derive.h: Change return type.
* expand/rust-expand-visitor.cc: Insert all generated items into the
AST.
---
gcc/rust/expand/rust-derive.cc
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: 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: 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: Arthur Cohen
gcc/rust/ChangeLog:
* hir/rust-ast-lower-base.cc (ASTLoweringBase::visit): Add base
implementation
for visitor.
---
gcc/rust/hir/rust-ast-lower-base.cc | 11 ---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/gcc/rust/hir/rust-ast
From: Philip Herron
This was a bad diagnostic added when I was working on slices and iterators
also the name of the function is also bad. This is all about setting up
associated types based on the current context of the bounds assocated with
the associated trait bounds on this function.
The tell
From: Owen Avery
gcc/rust/ChangeLog:
* resolve/rust-forever-stack.hxx
(ForeverStack::dfs_rib): Fix const implementation.
Signed-off-by: Owen Avery
---
gcc/rust/resolve/rust-forever-stack.hxx | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/gcc/rust/reso
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
Our AST has ImplTraitType for multiple bounds and a singular
ImplTraitTypeOneBound, this patch desugars these into a simple
HIR::ImplTraitType. It also does the name resolution for this.
gcc/rust/ChangeLog:
* checks/errors/borrowck/rust-bir-builder-struct.h: remove
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: Owen Avery
gcc/rust/ChangeLog:
* resolve/rust-forever-stack.hxx
(ForeverStack::resolve_segments): Add comments explaining
the behaviour of a while loop.
Signed-off-by: Owen Avery
---
gcc/rust/resolve/rust-forever-stack.hxx | 11 +++
1 file changed, 11 ins
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: 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: 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: Philip Herron
It seems bounds in qualified paths are not allowed to specify associated
type bindings because its going to be associated with the impl block
anyway.
Fixes Rust-GCC#2369
gcc/rust/ChangeLog:
* typecheck/rust-hir-type-check-base.h: add flag
* typecheck/rust-hi
From: Philip Herron
We can have a case where the placeholder is not configred and the
can_resolve check is not detecting this case which can lead to ICE.
gcc/rust/ChangeLog:
* typecheck/rust-tyty.cc (PlaceholderType::can_resolve): check for
empty mappings
Signed-off-by: Philip Herron
From: Arthur Cohen
gcc/rust/ChangeLog:
* resolve/rust-late-name-resolver-2.0.cc (Late::visit): New.
* resolve/rust-late-name-resolver-2.0.h: New.
---
.../resolve/rust-late-name-resolver-2.0.cc| 20 +++
.../resolve/rust-late-name-resolver-2.0.h | 1 +
2
From: Pierre-Emmanuel Patry
We might have some duplicated name in some pattern and we should
therefore not assert the non duplication of identifiers.
gcc/rust/ChangeLog:
* resolve/rust-late-name-resolver-2.0.cc (Late::visit): Remove
assertion and explicitely tells why we ignore
Hi everyone,
This patchset is the first of four similarly-sized patchsets aimed at
updating upstream with our most recent changes to the Rust frontend.
We plan on upstreaming small patchsets every week up to the release
of 15.1.
This first set's main change is the addition of the polonius
borrow
From: Jakub Dupak
gcc/rust/ChangeLog:
* checks/errors/borrowck/polonius/rust-polonius.h (struct FullPoint):
Polonius facts dump.
(struct Facts): Polonius facts dump.
* checks/errors/borrowck/rust-bir-dump.cc (Dump::go):
Polonius facts dump.
(Dump::
From: Arthur Cohen
ChangeLog:
* .gitignore: Add libgrust target folders to the ignore list.
---
.gitignore | 3 +++
1 file changed, 3 insertions(+)
diff --git a/.gitignore b/.gitignore
index f044fe16b5f..7150fc3b29c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -71,3 +71,6 @@ stamp
From: Kushal Pal
gcc/rust/ChangeLog:
* ast/rust-expr.h (class OperatorExpr):
Location should be private.
* hir/tree/rust-hir-expr.h (class OperatorExpr): Likewise.
Signed-off-by: Kushal Pal
---
gcc/rust/ast/rust-expr.h | 2 +-
gcc/rust/hir/tree/rust-hir-expr.h
From: Pierre-Emmanuel Patry
Add a new test to prevent regressions on the box syntax as well as its
feature gate.
gcc/testsuite/ChangeLog:
* rust/compile/box_syntax.rs: New test.
* rust/compile/box_syntax_feature_gate.rs: New test.
Signed-off-by: Pierre-Emmanuel Patry
---
gcc/
From: Pierre-Emmanuel Patry
Wrap the function's return type within an optional in order to
differentiate between a null pointer and a missing value.
gcc/rust/ChangeLog:
* util/rust-hir-map.cc (Mappings::insert_hir_pattern): Change call site
in order to accomodate new return type
From: Pierre-Emmanuel Patry
Struct fields can have outer attributes on their field for various
purpose, this behavior should be reflected upon struct expr fields.
gcc/rust/ChangeLog:
* ast/rust-ast-collector.cc (TokenCollector::visit): Output field
attributes.
* ast/rust
From: Pierre-Emmanuel Patry
Add support for old box expression syntax.
gcc/rust/ChangeLog:
* ast/rust-ast-collector.cc (TokenCollector::visit): Add visit member
function for BoxExpr nodes.
* ast/rust-ast-collector.h: Add visit function prototype.
* ast/rust-ast-v
From: jjasmine
gcc/rust/ChangeLog:
* ast/rust-fmt.h: Remove useless cstddef header from rust-fmt
---
gcc/rust/ast/rust-fmt.h | 1 -
1 file changed, 1 deletion(-)
diff --git a/gcc/rust/ast/rust-fmt.h b/gcc/rust/ast/rust-fmt.h
index fe933eabdd3..31100ea8f84 100644
--- a/gcc/rust/ast/rus
From: jjasmine
gcc/rust/ChangeLog:
* checks/errors/rust-feature-gate.cc (FeatureGate::visit): make
gccrs recognize negative_impls
* checks/errors/rust-feature-gate.h: likewise.
* checks/errors/rust-feature.cc (Feature::create): likewise.
* checks/errors/ru
From: Pierre-Emmanuel Patry
We do not handle those kind of references yet, we shall not let them
pass as a regular reference.
gcc/rust/ChangeLog:
* ast/rust-expr.h: Add a getter for mutability.
* hir/rust-ast-lower-expr.cc (ASTLoweringExpr::visit): Panic when a
raw refer
From: Owen Avery
gcc/rust/ChangeLog:
* resolve/rust-default-resolver.cc
(DefaultResolver::visit):
New for AST::CallExpr and AST::MethodCallExpr.
* resolve/rust-default-resolver.h
(DefaultResolver::visit): Likewise.
Signed-off-by: Owen Avery
---
gcc/rust
From: Pierre-Emmanuel Patry
Wrap the return type within an optional.
gcc/rust/ChangeLog:
* checks/errors/privacy/rust-privacy-reporter.cc: Change call site
to accomodate new return type.
* checks/errors/privacy/rust-pub-restricted-visitor.cc: Likewise.
* util/rus
From: Pierre-Emmanuel Patry
Wrap the function's return type within an optional and remove the out
reference argument.
gcc/rust/ChangeLog:
* expand/rust-macro-expand.cc (MacroExpander::expand_invoc): Adapt
the function call to match its new prototype.
* resolve/rust-early
From: Pierre-Emmanuel Patry
Wrap the function's return type within an optional.
gcc/rust/ChangeLog:
* metadata/rust-export-metadata.cc (ExportContext::emit_trait):
Adapt call site to the new return type.
(ExportContext::emit_function): Likewise.
(ExportContext::e
From: Owen Avery
gcc/rust/ChangeLog:
* expand/rust-macro-builtins.cc
(MacroBuiltin::builtin_transcribers):
Add entries for "rustc_const_stable" and "rustc_const_unstable".
* util/rust-attributes.cc
(__definitions): Add entries for RUSTC_CONST_STABLE and
From: Pierre-Emmanuel Patry
The box syntax is experimental even though it is used in the standard
library. It should be feature gated to prevent anyone from using it in
stable rust.
gcc/rust/ChangeLog:
* checks/errors/rust-feature-gate.cc (FeatureGate::visit): Allow
visitor recu
From: Owen Avery
gcc/rust/ChangeLog:
* resolve/rust-default-resolver.cc
(DefaultResolver::visit):
Scope with Rib::Kind::ConstantItem instead
of Rib::Kind::Item.
* resolve/rust-toplevel-name-resolver-2.0.cc
(TopLevel::visit): Remove redundancy in ov
From: Pierre-Emmanuel Patry
Previously generic params only allowed one outer attribute in front of
them.
gcc/rust/ChangeLog:
* ast/rust-ast-collector.cc (TokenCollector::visit): Visit outer
attributes.
* ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Change outer
From: Pierre-Emmanuel Patry
Add a new feature gate for may_dangle generic param outer attributes.
gcc/rust/ChangeLog:
* checks/errors/rust-feature-gate.cc: Visit and gate may_dangle
attributes.
* checks/errors/rust-feature-gate.h: Update visit function prototype
From: Pierre-Emmanuel Patry
Generic parameter parsing failed when an outer attribute was used on it.
gcc/rust/ChangeLog:
* parse/rust-parse-impl.h (Parser::parse_generic_param): Change token
reference to be the last token after all outer attributes have been
parsed.
Sig
From: Pierre-Emmanuel Patry
First test checks the may_dangle outer atttribute on generic params can
be parsed. The second one tests whether may_dangle attributes are
correctly feature gated.
gcc/testsuite/ChangeLog:
* rust/compile/dropck_eyepatch_feature_gate.rs: New test.
* rus
From: Pierre-Emmanuel Patry
This syntax is experimental and shall be explicitely enabled in the crate
attributes as it cannot be used in stable rust.
gcc/rust/ChangeLog:
* checks/errors/rust-feature-gate.cc (FeatureGate::visit): Gate the
excluded pattern.
* checks/errors
From: jjasmine
gcc/rust/ChangeLog:
* expand/rust-macro-builtins-asm.cc (parse_clobber_abi): title.
(parseAsmArg): title.
* expand/rust-macro-builtins-asm.h (parse_clobber_abi): title.
---
gcc/rust/expand/rust-macro-builtins-asm.cc | 76 +-
gcc/rust/ex
From: jjasmine
gcc/rust/ChangeLog:
* expand/rust-macro-builtins-asm.cc (parse_options): title.
---
gcc/rust/expand/rust-macro-builtins-asm.cc | 14 +-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/gcc/rust/expand/rust-macro-builtins-asm.cc
b/gcc/rust/expand/
From: Pierre-Emmanuel Patry
Exclusive range pattern were not handled by the parser as this an
experimental feature.
gcc/rust/ChangeLog:
* ast/rust-pattern.cc (tokenid_to_rangekind): Add a new function to
get a range kind from the current token type.
(RangePattern::as_str
From: Arthur Cohen
gcc/rust/ChangeLog:
* ast/rust-ast-fragment.h (enum class): Add InvocKind and AsmKind enums.
* ast/rust-macro.h: Switch semicolon boolean to InvocKind enum.
* expand/rust-expand-visitor.cc (ExpandVisitor::visit): Likewise.
* expand/rust-macro
From: ansh
gcc/rust/ChangeLog:
* ast/rust-ast-collector.cc (TokenCollector::visit):
Handle case for RAW_STRING_LITERAL.
* ast/rust-ast.cc (AttributeParser::parse_meta_item_inner):
Likewise.
(AttributeParser::parse_literal): Likewise.
* ast/rust-ast
From: Marc Poulhiès
gcc/rust/Changelog:
PR rust/119333
* Make-lang.in: Force offline mode for cargo
Signed-off-by: Marc Poulhiès
---
gcc/rust/Make-lang.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/rust/Make-lang.in b/gcc/rust/Make-lang.in
index ef
From: Arthur Cohen
Resent to cut out the patch's content, as it did not pass the ML filters.
This fixes PR #119333 by allowing our borrow-checker interface to be built
offline. This was already done for our components in libgrust/, but had never
been
done for the borrow-checker.
From: Pierre-Emmanuel Patry
gcc/rust/ChangeLog:
* ast/rust-ast.h: Node id getter could be const.
Signed-off-by: Pierre-Emmanuel Patry
---
gcc/rust/ast/rust-ast.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/rust/ast/rust-ast.h b/gcc/rust/ast/rust-ast.h
index
From: Owen Avery
gcc/rust/ChangeLog:
* checks/lints/rust-lint-marklive.cc
(MarkLive::visit_path_segment): Use name resolver 2.0 when
enabled.
(MarkLive::visit): Likewise.
Signed-off-by: Owen Avery
---
gcc/rust/checks/lints/rust-lint-marklive.cc | 31 +++
From: Pierre-Emmanuel Patry
We want to begin experimenting with this new name resolution 2.0
algorithm as soon as possible. This test highlight a problem where the
compiler should emit an error and should be fixed soon.
gcc/testsuite/ChangeLog:
* rust/compile/name_resolution21.rs: Move
From: "benjamin.thos"
Throw an error when auto-traits used without feature attribute.
gcc/rust/ChangeLog:
* checks/errors/rust-feature-gate.cc (FeatureGate::visit): Emit error
on trait when auto field member true.
* checks/errors/rust-feature-gate.h: add prototype of tra
From: badumbatish
gcc/rust/ChangeLog:
* backend/rust-compile-asm.cc (CompileAsm::asm_construct_inputs):
Provide input operand for gccrs
* expand/rust-macro-builtins-asm.cc (parse_reg_operand_in):
Move expr to In
(expand_inline_asm_strings):
Add com
From: badumbatish
gcc/rust/ChangeLog:
* expand/rust-macro-builtins-asm.cc (parse_reg_operand_in): Fix
compiler error on ast wrong implicit construct push_back
---
gcc/rust/expand/rust-macro-builtins-asm.cc | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/gcc
From: Owen Avery
gcc/rust/ChangeLog:
* resolve/rust-forever-stack.h
(ForeverStack::to_canonical_path): Make const.
(ForeverStack::to_rib): Add const overload.
(ForeverStack::reverse_iter): Add const overloads.
(ForeverStack::ConstDfsResult): Add.
(
From: Owen Avery
gcc/rust/ChangeLog:
* resolve/rust-toplevel-name-resolver-2.0.cc
(TopLevel::visit): Handle ExternalStaticItem.
* resolve/rust-toplevel-name-resolver-2.0.h
(TopLevel::visit): Likewise.
Signed-off-by: Owen Avery
---
gcc/rust/resolve/rust-toplevel
From: Pierre-Emmanuel Patry
We did not check the optional was valid, this lead to rogue dereference
and undefined behaviors.
gcc/rust/ChangeLog:
* resolve/rust-late-name-resolver-2.0.cc (Late::visit): Add optional
check.
Signed-off-by: Pierre-Emmanuel Patry
---
gcc/rust/resol
From: Philip Herron
We need to resolve the never type which is its own special AST node so it
doesnt magically get handled like the regular builtin type paths such as
i32.
Fixes #3035
gcc/rust/ChangeLog:
* resolve/rust-ast-resolve-type.cc (ResolveType::visit):
handle never type
From: Owen Avery
gcc/rust/ChangeLog:
* resolve/rust-late-name-resolver-2.0.cc
(Late::visit): Visit GenericArgs and GenericArg, the former
because the latter involves a non-virtual member function call.
* resolve/rust-late-name-resolver-2.0.h
(Late::visit):
From: Marc Poulhiès
Add tail_reachable and label fields to the dump.
gcc/rust/ChangeLog:
* hir/rust-hir-dump.cc (Dump::visit): Add missing fields.
Signed-off-by: Marc Poulhiès
---
gcc/rust/hir/rust-hir-dump.cc | 2 ++
1 file changed, 2 insertions(+)
diff --git a/gcc/rust/hir/rust-hi
901 - 1000 of 1405 matches
Mail list logo