From 952121933e817cd10409a52620dab11c013b3e84 Mon Sep 17 00:00:00 2001 From: Christian Poveda Date: Wed, 18 May 2022 10:53:48 -0500 Subject: [PATCH] move misplaced comment --- compiler/rustc_macros/src/diagnostics/diagnostic.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/compiler/rustc_macros/src/diagnostics/diagnostic.rs b/compiler/rustc_macros/src/diagnostics/diagnostic.rs index 25cba2df7f1..8ba2fcf6ec2 100644 --- a/compiler/rustc_macros/src/diagnostics/diagnostic.rs +++ b/compiler/rustc_macros/src/diagnostics/diagnostic.rs @@ -110,10 +110,6 @@ impl<'a> SessionDiagnosticDerive<'a> { ) }); - // When generating `set_arg` or `add_subdiagnostic` calls, move data rather than - // borrow it to avoid requiring clones - this must therefore be the last use of - // each field (for example, any formatting machinery that might refer to a field - // should be generated already). structure.bind_with(|_| synstructure::BindStyle::Move); // When a field has attributes like `#[label]` or `#[note]` then it doesn't // need to be passed as an argument to the diagnostic. But when a field has no @@ -373,6 +369,10 @@ impl SessionDiagnosticDeriveBuilder { let inner_ty = FieldInnerTy::from_type(&info.ty); + // When generating `set_arg` or `add_subdiagnostic` calls, move data rather than + // borrow it to avoid requiring clones - this must therefore be the last use of + // each field (for example, any formatting machinery that might refer to a field + // should be generated already). if attrs.is_empty() { let diag = &self.diag; let ident = info.binding.ast().ident.as_ref().unwrap();