Skip to content

Commit

Permalink
Clean up monadic operations on expected<>
Browse files Browse the repository at this point in the history
gcc/rust/ChangeLog:

	* expand/rust-macro-builtins-asm.cc (parse_asm):
	Clean up monadic operations on expected<>

Signed-off-by: badumbatish <[email protected]>
  • Loading branch information
badumbatish authored and CohenArthur committed Jun 28, 2024
1 parent 69e06b2 commit 7fd14aa
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions gcc/rust/expand/rust-macro-builtins-asm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -740,11 +740,9 @@ parse_asm (location_t invoc_locus, AST::MacroInvocData &invoc,
is_global_asm == AST::AsmKind::Global);
auto inline_asm_ctx = InlineAsmContext (inline_asm, parser, last_token_id);

tl::expected<InlineAsmContext, InlineAsmParseError> resulting_context
= tl::expected<InlineAsmContext, InlineAsmParseError> (inline_asm_ctx);
resulting_context.and_then (parse_format_strings)
.and_then (parse_asm_arg)
.and_then (validate);
auto resulting_context = parse_format_strings (inline_asm_ctx)
.and_then (parse_asm_arg)
.and_then (validate);

// TODO: I'm putting the validation here because the rust reference put it
// here Per Arthur's advice we would actually do the validation in a different
Expand Down

0 comments on commit 7fd14aa

Please sign in to comment.