aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/expand/rust-macro-builtins-asm.cc
diff options
context:
space:
mode:
authorjjasmine <tanghocle456@gmail.com>2024-06-26 07:39:00 -0700
committerCohenArthur <arthur.cohen@embecosm.com>2024-06-28 09:59:34 +0000
commit7fd14aafa34796068ebdd7ff35284f3b7a8e9c4c (patch)
treed7577e9424d99f34af332ed53792ce0b0e2297b8 /gcc/rust/expand/rust-macro-builtins-asm.cc
parent69e06b2b6e44d6b66e29549014e37c812542bcab (diff)
downloadgcc-7fd14aafa34796068ebdd7ff35284f3b7a8e9c4c.zip
gcc-7fd14aafa34796068ebdd7ff35284f3b7a8e9c4c.tar.gz
gcc-7fd14aafa34796068ebdd7ff35284f3b7a8e9c4c.tar.bz2
Clean up monadic operations on expected<>
gcc/rust/ChangeLog: * expand/rust-macro-builtins-asm.cc (parse_asm): Clean up monadic operations on expected<> Signed-off-by: badumbatish <tanghocle456@gmail.com>
Diffstat (limited to 'gcc/rust/expand/rust-macro-builtins-asm.cc')
-rw-r--r--gcc/rust/expand/rust-macro-builtins-asm.cc8
1 files changed, 3 insertions, 5 deletions
diff --git a/gcc/rust/expand/rust-macro-builtins-asm.cc b/gcc/rust/expand/rust-macro-builtins-asm.cc
index 9c2e8bb..d6cc317 100644
--- a/gcc/rust/expand/rust-macro-builtins-asm.cc
+++ b/gcc/rust/expand/rust-macro-builtins-asm.cc
@@ -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