diff options
author | 0xn4utilus <gyanendrabanjare8@gmail.com> | 2024-02-26 04:39:43 +0530 |
---|---|---|
committer | P-E-P <32375388+P-E-P@users.noreply.github.com> | 2024-03-05 15:08:36 +0000 |
commit | 87f797f0e827e50eb75945593d9107431f9be2ce (patch) | |
tree | 5ac287a4a12e3d8661b3ddd03244a2d391329fad /gcc/rust/parse/rust-parse-impl.h | |
parent | 0177e3cb1382d4eeefce0038b4791e7fb25bc2b9 (diff) | |
download | gcc-87f797f0e827e50eb75945593d9107431f9be2ce.zip gcc-87f797f0e827e50eb75945593d9107431f9be2ce.tar.gz gcc-87f797f0e827e50eb75945593d9107431f9be2ce.tar.bz2 |
Update resolver to use `AST::Function` instead of `AST::ExternalFunctionItem`
gcc/rust/ChangeLog:
* checks/errors/rust-feature-gate.cc (FeatureGate::visit):
Check if function is_external or not.
* hir/rust-ast-lower-extern.h: Use AST::Function
instead of AST::ExternalFunctionItem.
* parse/rust-parse-impl.h (Parser::parse_external_item):
Likewise.
(Parser::parse_pattern): Fix clang format.
* resolve/rust-ast-resolve-implitem.h: Likewise.
* resolve/rust-ast-resolve-item.cc (ResolveExternItem::visit):
Likewise.
* resolve/rust-ast-resolve-item.h: Likewise.
* resolve/rust-default-resolver.cc (DefaultResolver::visit):
Check if param has_pattern before using get_pattern.
Signed-off-by: 0xn4utilus <gyanendrabanjare8@gmail.com>
Diffstat (limited to 'gcc/rust/parse/rust-parse-impl.h')
-rw-r--r-- | gcc/rust/parse/rust-parse-impl.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust/parse/rust-parse-impl.h index c8a87a1..26b2415 100644 --- a/gcc/rust/parse/rust-parse-impl.h +++ b/gcc/rust/parse/rust-parse-impl.h @@ -6165,8 +6165,7 @@ Parser<ManagedTokenSource>::parse_external_item () std::move (outer_attrs), locus)); } case FN_KW: - return parse_external_function_item (std::move (vis), - std::move (outer_attrs)); + return parse_function (std::move (vis), std::move (outer_attrs), true); case TYPE: return parse_external_type_item (std::move (vis), @@ -10476,7 +10475,9 @@ Parser<ManagedTokenSource>::parse_pattern () { lexer.skip_token (); alts.push_back (parse_pattern_no_alt ()); - } while (lexer.peek_token ()->get_id () == PIPE); + } + + while (lexer.peek_token ()->get_id () == PIPE); /* alternates */ return std::unique_ptr<AST::Pattern> ( |