@@ -117,29 +117,33 @@ pub(crate) fn visit_item(cx: &DocContext<'_>, item: &Item, hir_id: HirId, dox: &
117
117
. map ( |span| ( span, true ) )
118
118
. unwrap_or_else ( || ( item. attr_span ( tcx) , false ) ) ;
119
119
120
- tcx . node_span_lint ( crate :: lint :: UNPORTABLE_MARKDOWN , hir_id , ref_span , |lint| {
121
- lint . primary_message ( "unportable markdown" ) ;
122
- if precise {
120
+ if precise {
121
+ tcx . node_span_lint ( crate :: lint :: BROKEN_FOOTNOTE , hir_id , ref_span , |lint| {
122
+ lint . primary_message ( "no footnote definition matching this footnote" ) ;
123
123
lint. span_suggestion (
124
124
ref_span. shrink_to_lo ( ) ,
125
125
"if it should not be a footnote, escape it" ,
126
126
"\\ " ,
127
127
Applicability :: MaybeIncorrect ,
128
128
) ;
129
- }
130
- if dox. as_bytes ( ) . get ( span. end ) == Some ( & b'[' ) {
131
- lint. help ( "confusing footnote reference and link" ) ;
132
- if precise {
133
- lint. span_suggestion (
134
- ref_span. shrink_to_hi ( ) ,
135
- "if the footnote is intended, add a space" ,
136
- " " ,
137
- Applicability :: MaybeIncorrect ,
138
- ) ;
139
- } else {
140
- lint. help ( "there should be a space between the link and the footnote" ) ;
129
+ } ) ;
130
+ } else {
131
+ tcx. node_span_lint ( crate :: lint:: UNPORTABLE_MARKDOWN , hir_id, ref_span, |lint| {
132
+ lint. primary_message ( "unportable markdown" ) ;
133
+ if dox. as_bytes ( ) . get ( span. end ) == Some ( & b'[' ) {
134
+ lint. help ( "confusing footnote reference and link" ) ;
135
+ if precise {
136
+ lint. span_suggestion (
137
+ ref_span. shrink_to_hi ( ) ,
138
+ "if the footnote is intended, add a space" ,
139
+ " " ,
140
+ Applicability :: MaybeIncorrect ,
141
+ ) ;
142
+ } else {
143
+ lint. help ( "there should be a space between the link and the footnote" ) ;
144
+ }
141
145
}
142
- }
143
- } ) ;
146
+ } ) ;
147
+ }
144
148
}
145
149
}
0 commit comments