From: Jakub Dupak
gcc/testsuite/ChangeLog:
* rust/compile/for_lifetimes.rs: New test.
Signed-off-by: Jakub Dupak
---
gcc/testsuite/rust/compile/for_lifetimes.rs | 19 +++
1 file changed, 19 insertions(+)
create mode 100644 gcc/testsuite/rust/compile/for_lifetimes.rs
From: Jakub Dupak
This test did not compile with rustc.
gcc/testsuite/ChangeLog:
* rust/compile/torture/utf8_identifiers.rs: add mising lifetime
Signed-off-by: Jakub Dupak
---
gcc/testsuite/rust/compile/torture/utf8_identifiers.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From: Kushal Pal
gcc/rust/ChangeLog:
* checks/errors/rust-ast-validation.cc (ASTValidation::visit):
Enclose const in single quotes.
gcc/testsuite/ChangeLog:
* rust/compile/const_trait_fn.rs:
Enclose const in single quotes.
Signed-off-by: Kushal Pal
---
gcc/ru
From: Nirmal Patel
If newline strings are encountered while lexing, the lexer now handles
newline characters by incrementing current line number. This provides
correct line number when displaying errors. If the lexer encounters end
of file before string end, then it will use the start of the stri
From: Kushal Pal
Fixes #2778
gcc/rust/ChangeLog:
* parse/rust-parse-impl.h (Parser::parse_trait_impl_item):
Handled `async` items
Signed-off-by: Kushal Pal
---
gcc/rust/parse/rust-parse-impl.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/gcc/rust/parse/rust-parse-imp
From: Jakub Dupak
Allows skipping parent check when casting.
gcc/rust/ChangeLog:
* typecheck/rust-tyty.h (BaseType::is): Cast API.
(SubstitutionRef>): Cast API.
(BaseType::as): Cast API.
(BaseType::try_as): Cast API.
Signed-off-by: Jakub Dupak
---
gcc/rust/typ
From: Pierre-Emmanuel Patry
Cfg visitor used it's own visit patterns, this made the code longer than
required.
gcc/rust/ChangeLog:
* expand/rust-cfg-strip.cc (CfgStrip::visit): Change calls from visitor
to default visitor.
(CfgStrip::go): Add call to visit crate.
From: Owen Avery
gcc/rust/ChangeLog:
* checks/errors/rust-feature.cc
(Feature::name_hash_map):
Add entries for Name::LANG_ITEMS and Name::NO_CORE.
* checks/errors/rust-feature.h
(Feature::Name::LANG_ITEMS): New.
(Feature::Name::NO_CORE): New.
gcc/
From: Kushal Pal
Fixes issue #2768
gcc/rust/ChangeLog:
* backend/rust-compile-base.cc (HIRCompileBase::setup_abi_options):
Renamed `WIN64` to `WIN_64`
* util/rust-abi.cc (get_abi_from_string): Likewise
(get_string_from_abi): Likewise
* util/rust-abi.h (en
From: Nobel Singh
Fixes issue #2040
Add check to assure that a function cant be declared const inside trait impl
blocks.
gcc/rust/ChangeLog:
* checks/errors/rust-ast-validation.cc (ASTValidation::visit): Add
check for const funtion.
gcc/testsuite/ChangeLog:
* rust/com
From: Pierre-Emmanuel Patry
Function body check emit an error message when a required function body
is missing.
gcc/testsuite/ChangeLog:
* rust/compile/functions_without_body.rs: New test.
Signed-off-by: Pierre-Emmanuel Patry
---
.../rust/compile/functions_without_body.rs| 21 +++
From: Robert Goss
If a struct type with a variant that has fields is initialized with some fields
the expression HIR StructExprStructFields is checked that all the fields are
assigned. However, if no fields are initialized the HIR StructExprStruct is
generated. This doesn't check if the struc
From: Owen Avery
gcc/rust/ChangeLog:
* ast/rust-ast-full-decls.h
(class TraitImplItem): Remove forward declaration.
(class AssociatedItem): Add forward declaration.
* ast/rust-ast.h
(class TraitImplItem): Remove.
(class TraitItem): Inherit from Ass
From: Jakub Dupak
gcc/rust/ChangeLog:
* parse/rust-parse-impl.h (Parser::parse_where_clause): fix parsing
(Parser::parse_where_clause_item): fix parsing
(Parser::parse_type_bound_where_clause_item): fix parsing
(Parser::parse_trait_bound): fix parsing
* pa
From: Robert Goss
Fixes #2381
If a struct type is initialized with one of it's fields repeated it will
currently issue an error at the use site. However we would like to give the
rust error code and (like rustc) show both the specifications for the field to
help the user diagnose the issue.
From: Jakub Dupak
gcc/rust/ChangeLog:
* backend/rust-compile-expr.cc (CompileExpr::visit): Use new API.
* typecheck/rust-tyty-call.cc (TypeCheckCallExpr::visit): Use new API.
* typecheck/rust-tyty-cmp.h: Remove old API.
* typecheck/rust-tyty.cc (FnPtr::is_equal):
From: Jakub Dupak
gcc/rust/ChangeLog:
* parse/rust-parse-impl.h (Parser::parse_generic_param): Lifetime
elision control.
(Parser::parse_lifetime_where_clause_item): Lifetime elision control.
(Parser::parse_type_param_bound): Lifetime elision control.
(Parser::par
From: Pierre-Emmanuel Patry
The default resolver put some scope in place but mostly has traversal
functions similar to the default ast visitor, making it inherit from the
default visitor allows us to avoid code duplication.
gcc/rust/ChangeLog:
* resolve/rust-default-resolver.cc (Default
From: Pierre-Emmanuel Patry
Missing body on a function should be rejected at a later stage in the
compiler, not during parsing.
gcc/rust/ChangeLog:
* ast/rust-ast-collector.cc (TokenCollector::visit): Adapt defintion
getter.
* ast/rust-ast-visitor.cc (DefaultASTVisitor::
From: Pierre-Emmanuel Patry
The feature gating behavior may be shortened and kept cleaner using the
default visitor. This means less maintenance on visit functions as the
traversal is shared by multiple visitors.
gcc/rust/ChangeLog:
* checks/errors/rust-feature-gate.cc (FeatureGate::vis
From: Pierre-Emmanuel Patry
Add checks in the ast validation pass to error out with functions
(either free or associated) without a definition.
gcc/rust/ChangeLog:
* checks/errors/rust-ast-validation.cc (ASTValidation::visit): Add
a validation check and emit an error depending o
From: Pierre-Emmanuel Patry
Local variables and functions or global variables have different
resolution when binded to a variable. This was not covered before, even
though it was handled by the new name resolution. This commit highlight
this behavior from the new name resolution mechanism.
gcc/t
From: Pierre-Emmanuel Patry
Make the attribute checker visitor inherit from the default visitor
in order to keep visit behavior shared.
gcc/rust/ChangeLog:
* util/rust-attributes.cc (AttributeChecker::visit): Add visit function
for crates.
* util/rust-attributes.h (class
From: Kushal Pal
Fixes #2788
gcc/rust/ChangeLog:
* parse/rust-parse-impl.h (Parser::parse_inherent_impl_item):
Added switch-case for ASYNC token.
gcc/testsuite/ChangeLog:
* rust/compile/issue-2788.rs: New test.
Signed-off-by: Kushal Pal
---
gcc/rust/parse/rust-parse
From: Owen Avery
gcc/rust/ChangeLog:
* ast/rust-ast-fragment.cc
(Fragment::assert_single_fragment): Update.
* ast/rust-ast.h
(class TraitImplItem): Move definition before that of TraitItem.
(class TraitItem):
Inherit from TraitImplItem instead of
From: Jakub Dupak
gcc/rust/ChangeLog:
* ast/rust-ast.h: Elided lifetime static constructor
* ast/rust-type.h: Default lifetime to elided.
* parse/rust-parse-impl.h (Parser::parse_lifetime_param): Use elided
lifetime.
(Parser::parse_lifetime): Use elided lifetime/
From: Raiki Tamura
gcc/rust/ChangeLog:
* Make-lang.in: Add .o files
* backend/rust-mangle.cc (struct V0Path): moved to splitted files
(v0_path): Likewise.
(legacy_mangle_name): Likewise.
(legacy_mangle_canonical_path): Likewise.
(legacy_hash): Like
From: Pierre-Emmanuel Patry
Functions that are both async and const shall be rejected during the
AST validation pass. This new test highlight this behavior.
gcc/testsuite/ChangeLog:
* rust/compile/const_async_function.rs: New test.
Signed-off-by: Pierre-Emmanuel Patry
---
gcc/testsui
From: Pierre-Emmanuel Patry
Add a new check in AST validation pass that checks that no function
declaration in traits are declared const.
gcc/rust/ChangeLog:
* checks/errors/rust-ast-validation.cc (ASTValidation::visit): Add
const check.
* checks/errors/rust-ast-validati
From: Owen Avery
gcc/rust/ChangeLog:
* ast/rust-ast-full-decls.h
(class InherentImplItem): Remove.
* ast/rust-ast.h
(class InherentImplItem): Remove.
(class SingleASTNode):
Store pointer to AssociatedItem instead of InherentImplItem.
* ast
From: Philip Herron
When making more desugaring for the HIR we can need to add new Let bindings
which will require namesolution information but also rib information for
which block the let binding is associated which was very unnessecary. This
patch simply updates the BLOCK_CONTEXT of the current
From: Pierre-Emmanuel Patry
Add a check during AST validation pass to ensure functions are either
const or async but not both.
gcc/rust/ChangeLog:
* checks/errors/rust-ast-validation.cc (ASTValidation::visit): Add
async const check.
Signed-off-by: Pierre-Emmanuel Patry
---
gc
From: Arthur Cohen
gcc/rust/ChangeLog:
* resolve/rust-toplevel-name-resolver-2.0.cc
(TopLevel::insert_or_error_out): Add documentation comment.
(TopLevel::go): Likewise.
---
gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc | 8
1 file changed, 8 insertions(+)
From: Pierre-Emmanuel Patry
A function cannot be both async and const, however this should not be
handled in the parser but rather at a later stage in the compiler. This
commit change the AsyncConstStatus in the AST and the HIR to allows a
function to be both async and const.
gcc/rust/ChangeLog:
From: Arthur Cohen
gcc/rust/ChangeLog:
* resolve/rust-early-name-resolver-2.0.cc
(Early::insert_once): New function.
(Early::visit): Likewise.
* resolve/rust-early-name-resolver-2.0.h: Likewise.
---
.../resolve/rust-early-name-resolver-2.0.cc | 30 +
From: Arthur Cohen
gcc/rust/ChangeLog:
* resolve/rust-toplevel-name-resolver-2.0.cc
(TopLevel::insert_or_error_out): New functions.
(TopLevel::handle_use_dec): New function.
(flatten_rebind): Likewise.
(flatten_list): Likewise.
(flatten_glob): Like
From: Arthur Cohen
gcc/rust/ChangeLog:
* resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit): Use
the DefaultResolver in the toplevel visitor.
---
gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc | 5 +
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a
From: Pierre-Emmanuel Patry
Add a new regression test to highlight the error behavior with a super
trait on an auto trait.
gcc/testsuite/ChangeLog:
* rust/compile/auto_trait_super_trait.rs: New test.
Signed-off-by: Pierre-Emmanuel Patry
---
gcc/testsuite/rust/compile/auto_trait_super
From: Arthur Cohen
gcc/rust/ChangeLog:
* resolve/rust-forever-stack.hxx: Do not copy segment when
dereferencing iterator in `find_starting_point`.
---
gcc/rust/resolve/rust-forever-stack.hxx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/rust/resolve/rus
From: Jakub Dupak
gcc/rust/ChangeLog:
* hir/rust-ast-lower-type.cc (ASTLoweringTypeBounds::visit): fix for
lifetimes
(ASTLowerWhereClauseItem::visit): fix for lifetimes
Signed-off-by: Jakub Dupak
---
gcc/rust/hir/rust-ast-lower-type.cc | 21 +
1 file chang
From: Arthur Cohen
gcc/testsuite/ChangeLog:
* rust/execute/torture/builtin_macros1.rs: Fix output pattern.
* rust/execute/torture/coercion3.rs: Likewise.
* rust/execute/torture/issue-2080.rs: Likewise.
* rust/execute/torture/issue-2179.rs: Likewise.
* rust
From: Jakub Dupak
gcc/rust/ChangeLog:
* hir/rust-ast-lower-type.cc (ASTLoweringType::visit): For lifetimes.
Signed-off-by: Jakub Dupak
---
gcc/rust/hir/rust-ast-lower-type.cc | 7 +++
1 file changed, 7 insertions(+)
diff --git a/gcc/rust/hir/rust-ast-lower-type.cc
b/gcc/rust/hir
From: Kushal Pal
Fixes #2783
gcc/rust/ChangeLog:
* lex/rust-lex.cc (Lexer::dump_and_skip):
Changed " " to '\n'
Signed-off-by: Kushal Pal
---
gcc/rust/lex/rust-lex.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/rust/lex/rust-lex.cc b/gcc/rust/lex/ru
From: Jakub Dupak
There was a mismatch whether lifetime 'static is parsed as "static"
or "'static".
gcc/rust/ChangeLog:
* parse/rust-parse-impl.h (Parser::lifetime_from_token): Fix matched
pattern.
Signed-off-by: Jakub Dupak
---
gcc/rust/parse/rust-parse-impl.h | 4 ++--
1 file chan
From: Jakub Dupak
gcc/rust/ChangeLog:
* typecheck/rust-tyty.h (class ClosureType): Inherit interface.
(class FnPtr): Inherit interface.
(class FnType): Inherit interface.
(class CallableTypeInterface): New interface.
(BaseType::is): Detect interface member
From: Kushal Pal
Fixes #2785
gcc/rust/ChangeLog:
* checks/errors/rust-ast-validation.cc (ASTValidation::visit):
Added check for `async` functions inside trait.
* parse/rust-parse-impl.h (Parser::parse_trait_item):
Added switch-case for ASYNC token.
gcc/testsuite
From: Jakub Dupak
gcc/rust/ChangeLog:
* typecheck/rust-hir-type-check-type.cc
(TypeCheckType::resolve_root_path): Refactor.
Signed-off-by: Jakub Dupak
---
gcc/rust/typecheck/rust-hir-type-check-type.cc | 11 +++
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/gc
From: Jakub Dupak
gcc/rust/ChangeLog:
* typecheck/rust-tyty.h: Fix nodiscard to warn unused.
Signed-off-by: Jakub Dupak
---
gcc/rust/typecheck/rust-tyty.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/rust/typecheck/rust-tyty.h b/gcc/rust/typecheck/rust-tyty.
From: Arthur Cohen
This commit performs builtin initialization in a more "GCC-y" way,
similarly to what the D frontend is doing. This way, we no longer have
to worry about invalid attributes or types when initializing them by
hand.
Also add attributes support through LANG_HOOKS_COMMON_ATTRIBUTE_
From: Pierre-Emmanuel Patry
Const fn declaration in trait declarations shall emit an error. This new
test highlight this behavior.
gcc/testsuite/ChangeLog:
* rust/compile/const_trait_fn.rs: New test.
Signed-off-by: Pierre-Emmanuel Patry
---
gcc/testsuite/rust/compile/const_trait_fn.r
From: Pierre-Emmanuel Patry
The rust syntax allows unsafe module even if those are rejected at a
later stage.
gcc/rust/ChangeLog:
* ast/rust-item.h: Add safety status to Modules in the AST.
* parse/rust-parse-impl.h (Parser::parse_module): Adapt constructors.
Signed-off-by: Pie
From: Arthur Cohen
gcc/rust/ChangeLog:
* resolve/rust-late-name-resolver-2.0.cc (Late::visit): Store mappings
after having resolved them.
* resolve/rust-late-name-resolver-2.0.h: Add `TypePath` visitor.
---
.../resolve/rust-late-name-resolver-2.0.cc| 33 +
From: Owen Avery
gcc/rust/ChangeLog:
* hir/tree/rust-hir-pattern.h
(class TupleItems): New.
(class TupleStructItems): Inherit from TupleItems.
(class TuplePatternItems): Likewise.
Signed-off-by: Owen Avery
---
gcc/rust/hir/tree/rust-hir-pattern.h | 47 +
From: Pierre-Emmanuel Patry
Raw values cannot be understood easily by most tools. This commit replace
some raw values with their variable counterpart.
gcc/rust/ChangeLog:
* ast/rust-ast-collector.cc (TokenCollector::visit): Replace raw value
with keyword call.
* ast/rust
From: Pierre-Emmanuel Patry
Retrieving a weak keyword value is done using raw values. Introducing a
list of weak keywords means this could change.
gcc/rust/ChangeLog:
* util/rust-keyword-values.h (class WeakKeywords): Add new class with
weak keyword constexpr.
Signed-off-by: Pi
From: Pierre-Emmanuel Patry
Make the underscore token a 2015 keyword.
gcc/rust/ChangeLog:
* lex/rust-token.h (enum PrimitiveCoreType): Change macro for
underscore in token list.
Signed-off-by: Pierre-Emmanuel Patry
---
gcc/rust/lex/rust-token.h | 3 +--
1 file changed, 1 inse
From: Pierre-Emmanuel Patry
It might be required in the future to get only the keywords from a
specific edition. To do so we need a mean to differentiate keywords based
on their edition. This commit changes the existing keyword macro to
allow such behavior.
gcc/rust/ChangeLog:
* lex/rus
From: Pierre-Emmanuel Patry
Add a new regression test for the error message in regular function
variadic errors during ast validation pass.
gcc/testsuite/ChangeLog:
* rust/compile/non_foreign_variadic_function.rs: New test.
Signed-off-by: Pierre-Emmanuel Patry
---
gcc/testsuite/rust/
From: Pierre-Emmanuel Patry
Variadic regular functions were recently added in the parser as they
should be rejected in the ast validation pass. This commit add the ast
validation pass rejecting this kind of variadic arguments.
gcc/rust/ChangeLog:
* checks/errors/rust-ast-validation.cc (
From: Jakub Dupak
(probably incomplete propagation)
gcc/rust/ChangeLog:
* hir/rust-ast-lower-base.cc (ASTLoweringBase::lower_lifetime):
Propagate static
requirement.
* hir/rust-ast-lower-base.h: Propagate static requirement.
* hir/rust-ast-lower-implitem.h: Prop
From: Pierre-Emmanuel Patry
Reject auto traits containing a super trait bound during AST validation
pass.
gcc/rust/ChangeLog:
* checks/errors/rust-ast-validation.cc (ASTValidation::visit): Reject
auto traits with super traits.
Signed-off-by: Pierre-Emmanuel Patry
---
gcc/rust
From: Arthur Cohen
gcc/rust/ChangeLog:
* resolve/rust-ast-resolve-path.cc (ResolvePath::resolve_path): Format.
---
gcc/rust/resolve/rust-ast-resolve-path.cc | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/gcc/rust/resolve/rust-ast-resolve-path.cc
b/gcc/rust/resol
From: Jakub Dupak
gcc/rust/ChangeLog:
* hir/tree/rust-hir-item.h: Ad lifetime getter.
* hir/tree/rust-hir-path.h: Make getter const ref.
* hir/tree/rust-hir.h: Const ref and new getter.
Signed-off-by: Jakub Dupak
---
gcc/rust/hir/tree/rust-hir-item.h | 2 ++
gcc/rust/h
From: Pierre-Emmanuel Patry
Many visit functions in the expand visitor simply visit their components
like the default visitor. Making the expand visitor inherit from the
default visitor allows us to keep all visitor in sync without having to
change every visitor.
gcc/rust/ChangeLog:
* e
From: Arthur Cohen
gcc/rust/ChangeLog:
* resolve/rust-forever-stack.hxx: Add specific behavior for
`ForeverStack::get` when dealing with labels.
---
gcc/rust/resolve/rust-forever-stack.hxx | 29 -
1 file changed, 28 insertions(+), 1 deletion(-)
diff --gi
From: Arthur Cohen
gcc/rust/ChangeLog:
* Make-lang.in: Compile late name resolver.
* resolve/rust-late-name-resolver-2.0.cc: New file.
* resolve/rust-late-name-resolver-2.0.h: New file.
---
gcc/rust/Make-lang.in | 1 +
.../resolve/rust-late-name
From: Kushal Pal
Fixes #2767
gcc/rust/ChangeLog:
* checks/errors/rust-ast-validation.cc (ASTValidation::visit):
Added check for `async` function inside trait.
gcc/testsuite/ChangeLog:
* rust/compile/issue-2767.rs: New test.
Signed-off-by: Kushal Pal
---
gcc/rust/che
From: Arthur Cohen
gcc/rust/ChangeLog:
* ast/rust-ast.h: Change Path API to be more consistent.
* ast/rust-path.h: Likewise.
* ast/rust-ast-collector.cc (TokenCollector::visit): Use new API.
* resolve/rust-ast-resolve-item.cc (ResolveItem::visit): Likewise.
From: Pierre-Emmanuel Patry
We already have some compile tests but it lacked an execution test to
ensure everything compiles correctly to the correct value.
gcc/testsuite/ChangeLog:
* rust/execute/torture/name_resolution.rs: New test.
Signed-off-by: Pierre-Emmanuel Patry
---
.../rust
From: Jakub Dupak
gcc/rust/ChangeLog:
* checks/errors/borrowck/rust-bir-place.h: Cleanup.
* checks/errors/borrowck/rust-borrow-checker.h: Cleanup.
Signed-off-by: Jakub Dupak
---
gcc/rust/checks/errors/borrowck/rust-bir-place.h | 2 +-
gcc/rust/checks/errors/borrowck/rust-
From: Arthur Cohen
gcc/rust/ChangeLog:
* resolve/rust-forever-stack.h: New method.
* resolve/rust-forever-stack.hxx: Likewise.
---
gcc/rust/resolve/rust-forever-stack.h | 2 ++
gcc/rust/resolve/rust-forever-stack.hxx | 20 +++-
2 files changed, 21 insertions(+
From: Jakub Dupak
gcc/rust/ChangeLog:
* checks/errors/borrowck/rust-bir-builder-internal.h: Replace nodiscard.
* checks/errors/borrowck/rust-bir-place.h: Replace nodiscard.
Signed-off-by: Jakub Dupak
---
gcc/rust/checks/errors/borrowck/rust-bir-builder-internal.h | 4 ++--
gcc
From: Arthur Cohen
gcc/rust/ChangeLog:
* resolve/rust-rib.h: Add Namespace enum.
---
gcc/rust/resolve/rust-rib.h | 25 +
1 file changed, 25 insertions(+)
diff --git a/gcc/rust/resolve/rust-rib.h b/gcc/rust/resolve/rust-rib.h
index 37bd90f1f75..4ffd00a5d6c 100644
From: Pierre-Emmanuel Patry
An error should be emitted on unsafe modules during the AST validation
pass as the syntax allows those even though they're not alowed later down
the line.
gcc/rust/ChangeLog:
* ast/rust-item.h: Add safety getter to modules.
* checks/errors/rust-ast-va
From: Pierre-Emmanuel Patry
Many visit functions in the early name resolver are just plain old
traversal visit functions like the ones from the default visitor.
gcc/rust/ChangeLog:
* resolve/rust-early-name-resolver.cc
(EarlyNameResolver::resolve_generic_args):
Move function.
From: Arthur Cohen
gcc/rust/ChangeLog:
* ast/rust-item.h (class UseTree): Add `node_id` member.
---
gcc/rust/ast/rust-item.h | 8 ++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/gcc/rust/ast/rust-item.h b/gcc/rust/ast/rust-item.h
index 2c0e45962ce..3480d126bc0 100
From: Pierre-Emmanuel Patry
Unsafe module are rejected at a later stage but could not be parsed
properly. This commit changes the parser in order to allow unsafe module
in the AST.
gcc/rust/ChangeLog:
* parse/rust-parse-impl.h (Parser::parse_vis_item): Dispatch to parse
module w
From: Pierre-Emmanuel Patry
Raw values may have typos or contain error, replacing those will
improve the codebase.
gcc/rust/ChangeLog:
* ast/rust-ast-collector.cc (TokenCollector::visit): Replace raw value.
* parse/rust-parse-impl.h (Parser::is_macro_rules_def): Likewise.
From: Pierre-Emmanuel Patry
Self parameter parsing errors may come from different situations, which
should not be handled in the same way. It is now possible to
differentiate a missing self parameter from a self pointer or a parsing
error.
gcc/rust/ChangeLog:
* parse/rust-parse-impl.h (
From: Arthur Cohen
Not sure if dealing with "labels" is the proper way of doing so, so we
might eventually change this to use `resolver.values` later on.
gcc/rust/ChangeLog:
* resolve/rust-name-resolution-context.h: Add a Labels stack.
---
gcc/rust/resolve/rust-name-resolution-context.
From: Pierre-Emmanuel Patry
We need to account for const specifiers in async parsing as const
can be used in the syntax before the async keyword.
gcc/rust/ChangeLog:
* parse/rust-parse-impl.h (Parser::parse_vis_item): Allow parsing async
items in const.
(Parser::parse_as
From: M V V S Manoj Kumar
Fixes issue #2650
The parser now parses ASYNC functions. Added ASYNC case to parse_item
Added a new function parse_async_item which is called in
parse_vis_item to handle the ASYNC case. Parse_async_item
also checks the current Rust edition and generates an error if the
e
From: Pierre-Emmanuel Patry
Add a new test to check for unsafe modules during AST validation pass.
gcc/testsuite/ChangeLog:
* rust/compile/unsafe_module.rs: New test.
Signed-off-by: Pierre-Emmanuel Patry
---
gcc/testsuite/rust/compile/unsafe_module.rs | 2 ++
1 file changed, 2 insert
From: Pierre-Emmanuel Patry
The old "keyword" list was used for the lexer, and could therefore not
be used with keyword spanning over multiple tokens as those tokens should
remain lexed as is. Hence the introduction of a new list macro for
keyword exclusive tasks. This also means we can no longer
From: Arthur Cohen
gcc/rust/ChangeLog:
* resolve/rust-early-name-resolver-2.0.cc
(Early::visit): Remove visitors.
* resolve/rust-early-name-resolver-2.0.h: Likewise.
---
gcc/rust/resolve/rust-early-name-resolver-2.0.cc | 16
gcc/rust/resolve/rust-early-n
From: Pierre-Emmanuel Patry
The 2018 edition await keyword was missing from the keyword list.
gcc/rust/ChangeLog:
* lex/rust-token.h (enum PrimitiveCoreType): Add await keyword
definition.
Signed-off-by: Pierre-Emmanuel Patry
---
gcc/rust/lex/rust-token.h | 1 +
1 file change
From: Arthur Cohen
gcc/rust/ChangeLog:
* resolve/rust-late-name-resolver-2.0.cc
(Late::setup_builtin_types): New function.
(Late::go): Setup builtin types.
* resolve/rust-late-name-resolver-2.0.h:
* resolve/rust-name-resolution-context.cc
(NameReso
From: Pierre-Emmanuel Patry
Unions with zero fields are forbidden. Add regression test for empty
unions.
gcc/rust/ChangeLog:
* checks/errors/rust-ast-validation.cc (ASTValidation::visit): Add
zero field check during ast validation pass.
* checks/errors/rust-ast-validatio
From: Arthur Cohen
gcc/rust/ChangeLog:
* resolve/rust-name-resolution-context.h: Store a reference to the
mappings.
* resolve/rust-name-resolution-context.cc
(NameResolutionContext::NameResolutionContext): Likewise.
---
gcc/rust/resolve/rust-name-resolution-conte
From: Pierre-Emmanuel Patry
Reject rust code with associated items on auto traits.
gcc/rust/ChangeLog:
* checks/errors/rust-ast-validation.cc (ASTValidation::visit): Add auto
trait associated item check in AST validation pass.
* parse/rust-parse-impl.h: Remove old error
From: Pierre-Emmanuel Patry
TOK suffix was chosen to disambiguate some identifiers with c++ reserved
keyword. Even though this list lies within the rust-token header, this
macro is used in many context sometimes unrelated with the lexer and
tokens. This TOK suffix may appear surprising in such co
From: Arthur Cohen
gcc/rust/ChangeLog:
* resolve/rust-forever-stack.hxx: Remove debug log.
---
gcc/rust/resolve/rust-forever-stack.hxx | 2 --
1 file changed, 2 deletions(-)
diff --git a/gcc/rust/resolve/rust-forever-stack.hxx
b/gcc/rust/resolve/rust-forever-stack.hxx
index 65796172b0
From: Pierre-Emmanuel Patry
Generics are forbidden on auto traits and an error should be emitted.
This commit highlight this behavior.
gcc/testsuite/ChangeLog:
* rust/compile/generic_auto_trait.rs: New test.
Signed-off-by: Pierre-Emmanuel Patry
---
gcc/testsuite/rust/compile/generic_
From: Arthur Cohen
gcc/rust/ChangeLog:
* resolve/rust-forever-stack.h: New method.
* resolve/rust-forever-stack.hxx: Likewise.
---
gcc/rust/resolve/rust-forever-stack.h | 25 ++-
gcc/rust/resolve/rust-forever-stack.hxx | 90 -
2 files changed, 110 i
From: Pierre-Emmanuel Patry
Generic parameters are not allowed on auto traits, the compiler should
emit an error.
gcc/rust/ChangeLog:
* checks/errors/rust-ast-validation.cc (ASTValidation::visit): Add
check for generics on auto traits.
* checks/errors/rust-ast-validation
From: Arthur Cohen
gcc/rust/ChangeLog:
* resolve/rust-forever-stack.h: Fix `ForeverStack::resolve_path`
signature.
* resolve/rust-forever-stack.hxx: Likewise.
* resolve/rust-early-name-resolver-2.0.cc (Early::visit): Use new API.
(Early::visit_attributes):
From: Arthur Cohen
gcc/rust/ChangeLog:
* resolve/rust-forever-stack.h: Improve resolve_path API.
* resolve/rust-forever-stack.hxx: Likewise and fix implementation.
---
gcc/rust/resolve/rust-forever-stack.h | 19 +++--
gcc/rust/resolve/rust-forever-stack.hxx | 38 ++
From: Pierre-Emmanuel Patry
Add new tests to highlight the behavior of errors thrown when meeting a
self pointer.
gcc/testsuite/ChangeLog:
* rust/compile/self_const_ptr.rs: New test.
* rust/compile/self_mut_ptr.rs: New test.
* rust/compile/self_ptr.rs: New test.
Signed-
From: Pierre-Emmanuel Patry
Self pointer checking loop condition was inverted, the latter was
therefore never executed.
gcc/rust/ChangeLog:
* parse/rust-parse-impl.h (Parser::parse_self_param): Fix the loop
exit condition.
Signed-off-by: Pierre-Emmanuel Patry
---
gcc/rust/par
From: Pierre-Emmanuel Patry
The compiler shall parse visibility modifiers on trait items and reject
those at a later stage (ast validation).
gcc/rust/ChangeLog:
* ast/rust-item.h (struct Visibility): Move Visibility from here...
* ast/rust-ast.h (struct Visibility): ...to here.
1 - 100 of 102 matches
Mail list logo