@@ -9,8 +9,6 @@ pub fn check(cx: &LateContext<'_>, attrs: &[Attribute]) {
99 for broken_link in BrokenLinkLoader :: collect_spans_broken_link ( attrs) {
1010 let reason_msg = match broken_link. reason {
1111 BrokenLinkReason :: MultipleLines => "broken across multiple lines" ,
12- BrokenLinkReason :: MissingCloseParenthesis => "missing close parenthesis" ,
13- BrokenLinkReason :: WhiteSpace => "whitespace within url" ,
1412 } ;
1513
1614 span_lint (
@@ -23,10 +21,13 @@ pub fn check(cx: &LateContext<'_>, attrs: &[Attribute]) {
2321}
2422
2523/// The reason why a link is considered broken.
24+ // NOTE: We don't check these other cases because
25+ // rustdoc itself will check and warn about it:
26+ // - When a link url is broken across multiple lines in the URL path part
27+ // - When a link tag is missing the close parenthesis character at the end.
28+ // - When a link has whitespace within the url link.
2629enum BrokenLinkReason {
2730 MultipleLines ,
28- MissingCloseParenthesis ,
29- WhiteSpace ,
3031}
3132
3233/// Broken link data.
@@ -98,21 +99,8 @@ impl BrokenLinkLoader {
9899 && let AttrStyle :: Outer = attr. style
99100 {
100101 self . scan_line ( sym. as_str ( ) , attr. span ) ;
101- } else {
102- if idx > 0 && self . active && self . processing_link_url {
103- let prev_attr = & attrs[ idx - 1 ] ;
104- let prev_end_line = prev_attr. span . hi ( ) . 0 ;
105- self . record_broken_link ( prev_end_line, BrokenLinkReason :: MissingCloseParenthesis ) ;
106- }
107- self . reset_lookup ( ) ;
108102 }
109103 }
110-
111- if self . active && self . processing_link_url {
112- let last_end_line = attrs. last ( ) . unwrap ( ) . span . hi ( ) . 0 ;
113- self . record_broken_link ( last_end_line, BrokenLinkReason :: MissingCloseParenthesis ) ;
114- self . reset_lookup ( ) ;
115- }
116104 }
117105
118106 fn scan_line ( & mut self , line : & str , attr_span : Span ) {
@@ -169,13 +157,6 @@ impl BrokenLinkLoader {
169157 continue ;
170158 }
171159
172- if self . reading_link_url && c. is_whitespace ( ) {
173- let pos_end = u32:: try_from ( pos) . unwrap ( ) ;
174- self . record_broken_link ( pos_end, BrokenLinkReason :: WhiteSpace ) ;
175- self . reset_lookup ( ) ;
176- continue ;
177- }
178-
179160 if !c. is_whitespace ( ) {
180161 self . reading_link_url = true ;
181162 }
0 commit comments