diff options
author | Mark Wielaard <mark@klomp.org> | 2021-07-18 22:12:20 +0200 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2021-07-23 15:03:34 +0100 |
commit | 4d841a49ddb49d7201f0af98ddd3baf3a745c65c (patch) | |
tree | 7c6398be4a4b25c7b3248700bb41b9eafacef8fe /gcc | |
parent | 44472c580cedd836081c82e621482e479a69729c (diff) | |
download | gcc-4d841a49ddb49d7201f0af98ddd3baf3a745c65c.zip gcc-4d841a49ddb49d7201f0af98ddd3baf3a745c65c.tar.gz gcc-4d841a49ddb49d7201f0af98ddd3baf3a745c65c.tar.bz2 |
Remove error handling in parse_type_no_bounds for PLUS token
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.
Diffstat (limited to 'gcc')
-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 bdf1e09..75ee1eb 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> ( |