]>
git.ipfire.org Git - thirdparty/gcc.git/commit
gccrs: Remove redundant error types
Some error types in the parser had the exact same meaning and could be
grouped under one same type.
gcc/rust/ChangeLog:
* ast/rust-ast.cc (AttributeParser::parse_meta_item_lit): Use
tl::expected
* expand/rust-macro-builtins-helpers.cc (parse_single_string_literal):
Likewise.
* expand/rust-macro-expand.cc (MacroExpander::match_fragment):
Likewise.
* parse/rust-cfg-parser.cc (parse_cfg_option): Likewise.
* parse/rust-parse-error.h (struct SimplePath): Remove error type.
(struct DelimTokenTree): Likewise.
(struct Token): Likewise.
(struct TokenTree): Likewise.
(class LifetimeParam): Move from here ...
(struct LifetimeParam): ... to here. Add ctor.
(class Lifetime): Add error type.
(enum class): Remove AnonConst.
(struct BlockExpr): Change BlockExpr to generic node error.
* parse/rust-parse-impl-expr.hxx: Use tl::expected for errors.
* parse/rust-parse-impl-path.hxx: Likewise.
* parse/rust-parse-impl-ttree.hxx: Likewise.
* parse/rust-parse-impl.hxx: Likewise.
* parse/rust-parse.h: Update function return types with tl::expected
to propagate errors.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>