From 15754f5ea155600c62b8f4893fae78c5af1b08b2 Mon Sep 17 00:00:00 2001 From: Mara Bos Date: Tue, 30 Aug 2022 17:18:09 +0200 Subject: [PATCH] Move enum definition closer to its usage. --- compiler/rustc_builtin_macros/src/format.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/compiler/rustc_builtin_macros/src/format.rs b/compiler/rustc_builtin_macros/src/format.rs index fe963a0ea3a..f7c7e00ab22 100644 --- a/compiler/rustc_builtin_macros/src/format.rs +++ b/compiler/rustc_builtin_macros/src/format.rs @@ -267,17 +267,17 @@ pub fn make_format_args( }) }; + let num_explicit_args = args.len(); + let mut used = vec![false; num_explicit_args]; + let mut invalid_refs = Vec::new(); + let mut numeric_refences_to_named_arg = Vec::new(); + enum ArgRef<'a> { Index(usize), Name(&'a str, Option), } use ArgRef::*; - let num_explicit_args = args.len(); - let mut used = vec![false; num_explicit_args]; - let mut invalid_refs = Vec::new(); - let mut numeric_refences_to_named_arg = Vec::new(); - let mut lookup_arg = |arg: ArgRef<'_>, span: Option, used_as: PositionUsedAs,