@@ -574,6 +574,11 @@ pub trait LintContext: Sized {
574
574
fn sess ( & self ) -> & Session ;
575
575
fn lints ( & self ) -> & LintStore ;
576
576
577
+ /// Emit a lint at the appropriate level, with an optional associated span and an existing diagnostic.
578
+ ///
579
+ /// Return value of the `decorate` closure is ignored, see [`struct_lint_level`] for a detailed explanation.
580
+ ///
581
+ /// [`struct_lint_level`]: rustc_middle::lint::struct_lint_level#decorate-signature
577
582
fn lookup_with_diagnostics (
578
583
& self ,
579
584
lint : & ' static Lint ,
@@ -872,6 +877,11 @@ pub trait LintContext: Sized {
872
877
873
878
// FIXME: These methods should not take an Into<MultiSpan> -- instead, callers should need to
874
879
// set the span in their `decorate` function (preferably using set_span).
880
+ /// Emit a lint at the appropriate level, with an optional associated span.
881
+ ///
882
+ /// Return value of the `decorate` closure is ignored, see [`struct_lint_level`] for a detailed explanation.
883
+ ///
884
+ /// [`struct_lint_level`]: rustc_middle::lint::struct_lint_level#decorate-signature
875
885
fn lookup < S : Into < MultiSpan > > (
876
886
& self ,
877
887
lint : & ' static Lint ,
@@ -893,6 +903,11 @@ pub trait LintContext: Sized {
893
903
self . lookup ( lint, Some ( span) , decorator. msg ( ) , |diag| decorator. decorate_lint ( diag) ) ;
894
904
}
895
905
906
+ /// Emit a lint at the appropriate level, with an associated span.
907
+ ///
908
+ /// Return value of the `decorate` closure is ignored, see [`struct_lint_level`] for a detailed explanation.
909
+ ///
910
+ /// [`struct_lint_level`]: rustc_middle::lint::struct_lint_level#decorate-signature
896
911
fn struct_span_lint < S : Into < MultiSpan > > (
897
912
& self ,
898
913
lint : & ' static Lint ,
@@ -914,6 +929,10 @@ pub trait LintContext: Sized {
914
929
}
915
930
916
931
/// Emit a lint at the appropriate level, with no associated span.
932
+ ///
933
+ /// Return value of the `decorate` closure is ignored, see [`struct_lint_level`] for a detailed explanation.
934
+ ///
935
+ /// [`struct_lint_level`]: rustc_middle::lint::struct_lint_level#decorate-signature
917
936
fn lint (
918
937
& self ,
919
938
lint : & ' static Lint ,
0 commit comments