Skip to content

Commit 9a7b6fc

Browse files
committed
Add diagnostics for closure signature
1 parent 13e63f7 commit 9a7b6fc

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

compiler/rustc_errors/src/diagnostic.rs

+10
Original file line numberDiff line numberDiff line change
@@ -721,6 +721,16 @@ impl<'a, G: EmissionGuarantee> Diag<'a, G> {
721721
self
722722
}
723723

724+
#[rustc_lint_diagnostics]
725+
pub fn note_closure_signature(&mut self, closure_signature: String) -> &mut Self {
726+
self.highlighted_note(vec![
727+
StringPart::normal("closure has signature: `"),
728+
StringPart::highlighted(closure_signature),
729+
StringPart::normal("`"),
730+
]);
731+
self
732+
}
733+
724734
with_fn! { with_note,
725735
/// Add a note attached to this diagnostic.
726736
#[rustc_lint_diagnostics]

0 commit comments

Comments
 (0)