@@ -530,9 +530,7 @@ pub trait LintContext {
530
530
lint : & ' static Lint ,
531
531
span : Option < impl Into < MultiSpan > > ,
532
532
msg : impl Into < DiagnosticMessage > ,
533
- decorate : impl for <' a , ' b > FnOnce (
534
- & ' b mut DiagnosticBuilder < ' a , ( ) > ,
535
- ) -> & ' b mut DiagnosticBuilder < ' a , ( ) > ,
533
+ decorate : impl for <' a , ' b > FnOnce ( & ' b mut DiagnosticBuilder < ' a , ( ) > ) ,
536
534
diagnostic : BuiltinLintDiagnostics ,
537
535
) {
538
536
// We first generate a blank diagnostic.
@@ -995,9 +993,7 @@ pub trait LintContext {
995
993
lint : & ' static Lint ,
996
994
span : Option < S > ,
997
995
msg : impl Into < DiagnosticMessage > ,
998
- decorate : impl for <' a , ' b > FnOnce (
999
- & ' b mut DiagnosticBuilder < ' a , ( ) > ,
1000
- ) -> & ' b mut DiagnosticBuilder < ' a , ( ) > ,
996
+ decorate : impl for <' a , ' b > FnOnce ( & ' b mut DiagnosticBuilder < ' a , ( ) > ) ,
1001
997
) ;
1002
998
1003
999
/// Emit a lint at `span` from a lint struct (some type that implements `DecorateLint`,
@@ -1008,7 +1004,9 @@ pub trait LintContext {
1008
1004
span : S ,
1009
1005
decorator : impl for < ' a > DecorateLint < ' a , ( ) > ,
1010
1006
) {
1011
- self . lookup ( lint, Some ( span) , decorator. msg ( ) , |diag| decorator. decorate_lint ( diag) ) ;
1007
+ self . lookup ( lint, Some ( span) , decorator. msg ( ) , |diag| {
1008
+ decorator. decorate_lint ( diag) ;
1009
+ } ) ;
1012
1010
}
1013
1011
1014
1012
/// Emit a lint at the appropriate level, with an associated span.
@@ -1022,9 +1020,7 @@ pub trait LintContext {
1022
1020
lint : & ' static Lint ,
1023
1021
span : S ,
1024
1022
msg : impl Into < DiagnosticMessage > ,
1025
- decorate : impl for <' a , ' b > FnOnce (
1026
- & ' b mut DiagnosticBuilder < ' a , ( ) > ,
1027
- ) -> & ' b mut DiagnosticBuilder < ' a , ( ) > ,
1023
+ decorate : impl for <' a , ' b > FnOnce ( & ' b mut DiagnosticBuilder < ' a , ( ) > ) ,
1028
1024
) {
1029
1025
self . lookup ( lint, Some ( span) , msg, decorate) ;
1030
1026
}
@@ -1033,7 +1029,7 @@ pub trait LintContext {
1033
1029
/// generated by `#[derive(LintDiagnostic)]`).
1034
1030
fn emit_lint ( & self , lint : & ' static Lint , decorator : impl for < ' a > DecorateLint < ' a , ( ) > ) {
1035
1031
self . lookup ( lint, None as Option < Span > , decorator. msg ( ) , |diag| {
1036
- decorator. decorate_lint ( diag)
1032
+ decorator. decorate_lint ( diag) ;
1037
1033
} ) ;
1038
1034
}
1039
1035
@@ -1047,9 +1043,7 @@ pub trait LintContext {
1047
1043
& self ,
1048
1044
lint : & ' static Lint ,
1049
1045
msg : impl Into < DiagnosticMessage > ,
1050
- decorate : impl for <' a , ' b > FnOnce (
1051
- & ' b mut DiagnosticBuilder < ' a , ( ) > ,
1052
- ) -> & ' b mut DiagnosticBuilder < ' a , ( ) > ,
1046
+ decorate : impl for <' a , ' b > FnOnce ( & ' b mut DiagnosticBuilder < ' a , ( ) > ) ,
1053
1047
) {
1054
1048
self . lookup ( lint, None as Option < Span > , msg, decorate) ;
1055
1049
}
@@ -1113,9 +1107,7 @@ impl<'tcx> LintContext for LateContext<'tcx> {
1113
1107
lint : & ' static Lint ,
1114
1108
span : Option < S > ,
1115
1109
msg : impl Into < DiagnosticMessage > ,
1116
- decorate : impl for <' a , ' b > FnOnce (
1117
- & ' b mut DiagnosticBuilder < ' a , ( ) > ,
1118
- ) -> & ' b mut DiagnosticBuilder < ' a , ( ) > ,
1110
+ decorate : impl for <' a , ' b > FnOnce ( & ' b mut DiagnosticBuilder < ' a , ( ) > ) ,
1119
1111
) {
1120
1112
let hir_id = self . last_node_with_lint_attrs ;
1121
1113
@@ -1142,9 +1134,7 @@ impl LintContext for EarlyContext<'_> {
1142
1134
lint : & ' static Lint ,
1143
1135
span : Option < S > ,
1144
1136
msg : impl Into < DiagnosticMessage > ,
1145
- decorate : impl for <' a , ' b > FnOnce (
1146
- & ' b mut DiagnosticBuilder < ' a , ( ) > ,
1147
- ) -> & ' b mut DiagnosticBuilder < ' a , ( ) > ,
1137
+ decorate : impl for <' a , ' b > FnOnce ( & ' b mut DiagnosticBuilder < ' a , ( ) > ) ,
1148
1138
) {
1149
1139
self . builder . struct_lint ( lint, span. map ( |s| s. into ( ) ) , msg, decorate)
1150
1140
}
0 commit comments