]>
git.ipfire.org Git - thirdparty/gcc.git/commit
gccrs: Use error wrapper when required instead of nullptr
gcc/rust/ChangeLog:
* ast/rust-ast-collector.cc (TokenCollector::visit): Update function
name.
* ast/rust-ast-pointer-visitor.cc (PointerVisitor::visit): Likewise.
* ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Likewise.
* ast/rust-ast.cc (BreakExpr::as_string): Use getter function.
(AttributeParser::parse_path_meta_item): Convert to expected type.
(ReturnExpr::as_string): Change access to returned expr.
* ast/rust-desugar-for-loops.cc (DesugarForLoops::DesugarCtx::make_break_arm):
Likewise.
* ast/rust-expr.h (class BreakExpr): Make expr in break optional.
(class ReturnExpr): Make returned expr explicitely optional. Change the
getters and introduce a const getter.
* expand/rust-cfg-strip.cc (CfgStrip::visit): Convert to expected type.
* expand/rust-macro-builtins-asm.cc (parse_reg_operand_in): Update
constructor call to new expected types.
(parse_reg_operand_out): Likewise.
(parse_reg_operand_inout): Likewise.
(parse_llvm_operands): Likewise.
* expand/rust-macro-builtins-format-args.cc (format_args_parse_expr):
Likewise.
(format_args_parse_arguments): Likewise.
* expand/rust-macro-builtins-helpers.cc (try_expand_many_expr): Update
value for tl::expected.
* expand/rust-macro-builtins-include.cc (MacroBuiltin::include_handler):
Likewise.
* expand/rust-macro-expand.cc (transcribe_expression): Update
constructor call with expected value.
* hir/rust-ast-lower-expr.cc (ASTLoweringExpr::visit): Likewise.
* parse/rust-parse-error.h (enum class): Add new error types for Expr
and StructExprField.
* parse/rust-parse-impl-expr.hxx: Explicitely handle return expr
parsing failure. Update to fit new expected types.
* parse/rust-parse-impl.hxx: Likewise.
* resolve/rust-late-name-resolver-2.0.cc (Late::visit): Adapt to
tl::expected.
* ast/rust-desugar-while-let.cc (DesugarWhileLet::DesugarCtx::make_break_arm):
Use optional for break expressions when missing instead of nullptr.
* parse/rust-parse.h: Change function return type with expected. Remove
error state from ExprOrStmt.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
19 files changed: