diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-07-23 14:21:43 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-23 14:21:43 +0000 |
commit | 314b62ec787abdf320fcca8ceb09b8c9bcf72512 (patch) | |
tree | 84466ab994fe528038b51bc19e75757f4247eaf4 /gcc/rust/parse/rust-parse-impl.h | |
parent | afd9db6f6b28d273434b0c61ec0b1aa0dcc4c89f (diff) | |
parent | 4d841a49ddb49d7201f0af98ddd3baf3a745c65c (diff) | |
download | gcc-314b62ec787abdf320fcca8ceb09b8c9bcf72512.zip gcc-314b62ec787abdf320fcca8ceb09b8c9bcf72512.tar.gz gcc-314b62ec787abdf320fcca8ceb09b8c9bcf72512.tar.bz2 |
Merge #591
591: Remove error handling in parse_type_no_bounds for PLUS token r=philberty a=philberty
parse_type_no_bounds tries to be helpful and greedily looks for a PLUS
token after having parsed a typepath so it can produce an error. But
that error breaks parsing expressions that contain "as" Cast
Expressions like "a as usize + b as usize". Drop the explicit error on
seeing a PLUS token and just return the type path parsed.
Co-authored-by: Mark Wielaard <mark@klomp.org>
Diffstat (limited to 'gcc/rust/parse/rust-parse-impl.h')
-rw-r--r-- | gcc/rust/parse/rust-parse-impl.h | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust/parse/rust-parse-impl.h index 3996ef2..be26171 100644 --- a/gcc/rust/parse/rust-parse-impl.h +++ b/gcc/rust/parse/rust-parse-impl.h @@ -10003,13 +10003,6 @@ Parser<ManagedTokenSource>::parse_type_no_bounds () std::move (tok_tree)), {}, locus)); } - case PLUS: - // type param bounds - not allowed, here for error message - add_error (Error (t->get_locus (), - "type param bounds (in TraitObjectType) are not " - "allowed as TypeNoBounds")); - - return nullptr; default: // assume that this is a type path and not an error return std::unique_ptr<AST::TypePath> ( |