Skip to content

Commit 7ea28e7

Browse files
committed
review comment: use Default
1 parent 93bb780 commit 7ea28e7

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/librustc_resolve/late.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,7 @@ impl<'a> PathSource<'a> {
316316
}
317317
}
318318

319+
#[derive(Default)]
319320
struct DiagnosticMetadata {
320321
/// The current trait's associated types' ident, used for diagnostic suggestions.
321322
current_trait_assoc_types: Vec<Ident>,
@@ -547,15 +548,7 @@ impl<'a, 'b> LateResolutionVisitor<'a, '_> {
547548
},
548549
label_ribs: Vec::new(),
549550
current_trait_ref: None,
550-
diagnostic_metadata: DiagnosticMetadata {
551-
current_trait_assoc_types: Vec::new(),
552-
current_self_type: None,
553-
current_self_item: None,
554-
current_function: None,
555-
unused_labels: Default::default(),
556-
current_type_ascription: Vec::new(),
557-
current_let_binding: None,
558-
}
551+
diagnostic_metadata: DiagnosticMetadata::default(),
559552
}
560553
}
561554

0 commit comments

Comments
 (0)