This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
compiler/rustc_macros/src/diagnostics Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -110,10 +110,6 @@ impl<'a> SessionDiagnosticDerive<'a> {
110110 )
111111 } ) ;
112112
113- // When generating `set_arg` or `add_subdiagnostic` calls, move data rather than
114- // borrow it to avoid requiring clones - this must therefore be the last use of
115- // each field (for example, any formatting machinery that might refer to a field
116- // should be generated already).
117113 structure. bind_with ( |_| synstructure:: BindStyle :: Move ) ;
118114 // When a field has attributes like `#[label]` or `#[note]` then it doesn't
119115 // need to be passed as an argument to the diagnostic. But when a field has no
@@ -373,6 +369,10 @@ impl SessionDiagnosticDeriveBuilder {
373369
374370 let inner_ty = FieldInnerTy :: from_type ( & info. ty ) ;
375371
372+ // When generating `set_arg` or `add_subdiagnostic` calls, move data rather than
373+ // borrow it to avoid requiring clones - this must therefore be the last use of
374+ // each field (for example, any formatting machinery that might refer to a field
375+ // should be generated already).
376376 if attrs. is_empty ( ) {
377377 let diag = & self . diag ;
378378 let ident = info. binding . ast ( ) . ident . as_ref ( ) . unwrap ( ) ;
You can’t perform that action at this time.
0 commit comments