@@ -435,6 +435,28 @@ pub trait LintContext: Sized {
435
435
self . lookup_and_emit ( lint, Some ( span) , msg) ;
436
436
}
437
437
438
+ /// Emit a lint and note at the appropriate level, for a particular span.
439
+ fn span_lint_note ( & self , lint : & ' static Lint , span : Span , msg : & str ,
440
+ note_span : Span , note : & str ) {
441
+ self . span_lint ( lint, span, msg) ;
442
+ if self . current_level ( lint) != Level :: Allow {
443
+ if note_span == span {
444
+ self . sess ( ) . fileline_note ( note_span, note)
445
+ } else {
446
+ self . sess ( ) . span_note ( note_span, note)
447
+ }
448
+ }
449
+ }
450
+
451
+ /// Emit a lint and help at the appropriate level, for a particular span.
452
+ fn span_lint_help ( & self , lint : & ' static Lint , span : Span ,
453
+ msg : & str , help : & str ) {
454
+ self . span_lint ( lint, span, msg) ;
455
+ if self . current_level ( lint) != Level :: Allow {
456
+ self . sess ( ) . span_help ( span, help)
457
+ }
458
+ }
459
+
438
460
/// Emit a lint at the appropriate level, with no associated span.
439
461
fn lint ( & self , lint : & ' static Lint , msg : & str ) {
440
462
self . lookup_and_emit ( lint, None , msg) ;
0 commit comments