about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2023-07-31 11:09:12 +1000
committerNicholas Nethercote <n.nethercote@gmail.com>2023-07-31 11:14:39 +1000
commitd16b1f4a8c2668a6d9d5170dd6d78aa79ac5c80a (patch)
treef17345443384db4147264e5dd243efd7843d410d
parentf8650114bd73e20416493d7ffc88615f917cd8d7 (diff)
downloadrust-d16b1f4a8c2668a6d9d5170dd6d78aa79ac5c80a.tar.gz
rust-d16b1f4a8c2668a6d9d5170dd6d78aa79ac5c80a.zip
Remove more unnecessary `return` keywords.
-rw-r--r--compiler/rustc_expand/src/mbe/macro_rules.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/compiler/rustc_expand/src/mbe/macro_rules.rs b/compiler/rustc_expand/src/mbe/macro_rules.rs
index 7398a124fdb..69250b0f23e 100644
--- a/compiler/rustc_expand/src/mbe/macro_rules.rs
+++ b/compiler/rustc_expand/src/mbe/macro_rules.rs
@@ -257,7 +257,7 @@ fn expand_macro<'cx>(
 
             // Let the context choose how to interpret the result.
             // Weird, but useful for X-macros.
-            return Box::new(ParserAnyMacro {
+            Box::new(ParserAnyMacro {
                 parser: p,
 
                 // Pass along the original expansion site and the name of the macro
@@ -269,18 +269,17 @@ fn expand_macro<'cx>(
                 is_trailing_mac: cx.current_expansion.is_trailing_mac,
                 arm_span,
                 is_local,
-            });
+            })
         }
         Err(CanRetry::No(_)) => {
             debug!("Will not retry matching as an error was emitted already");
-            return DummyResult::any(sp);
+            DummyResult::any(sp)
         }
         Err(CanRetry::Yes) => {
-            // Retry and emit a better error below.
+            // Retry and emit a better error.
+            diagnostics::failed_to_match_macro(cx, sp, def_span, name, arg, lhses)
         }
     }
-
-    diagnostics::failed_to_match_macro(cx, sp, def_span, name, arg, lhses)
 }
 
 pub(super) enum CanRetry {