@@ -55,30 +55,6 @@ const LINKCHECK_EXCEPTIONS: &[(&str, &[&str])] = &[
5555
5656#[ rustfmt:: skip]
5757const INTRA_DOC_LINK_EXCEPTIONS : & [ ( & str , & [ & str ] ) ] = & [
58- // This will never have links that are not in other pages.
59- // To avoid repeating the exceptions twice, an empty list means all broken links are allowed.
60- ( "reference/print.html" , & [ ] ) ,
61- // All the reference 'links' are actually ENBF highlighted as code
62- ( "reference/comments.html" , & [
63- "/</code> <code>!" ,
64- "*</code> <code>!" ,
65- ] ) ,
66- ( "reference/identifiers.html" , & [
67- "a</code>-<code>z</code> <code>A</code>-<code>Z" ,
68- "a</code>-<code>z</code> <code>A</code>-<code>Z</code> <code>0</code>-<code>9</code> <code>_" ,
69- "a</code>-<code>z</code> <code>A</code>-<code>Z</code>] [<code>a</code>-<code>z</code> <code>A</code>-<code>Z</code> <code>0</code>-<code>9</code> <code>_" ,
70- ] ) ,
71- ( "reference/tokens.html" , & [
72- "0</code>-<code>1" ,
73- "0</code>-<code>7" ,
74- "0</code>-<code>9" ,
75- "0</code>-<code>9" ,
76- "0</code>-<code>9</code> <code>a</code>-<code>f</code> <code>A</code>-<code>F" ,
77- ] ) ,
78- ( "reference/notation.html" , & [
79- "b</code> <code>B" ,
80- "a</code>-<code>z" ,
81- ] ) ,
8258 // This is being used in the sense of 'inclusive range', not a markdown link
8359 ( "core/ops/struct.RangeInclusive.html" , & [ "begin</code>, <code>end" ] ) ,
8460 ( "std/ops/struct.RangeInclusive.html" , & [ "begin</code>, <code>end" ] ) ,
@@ -382,6 +358,16 @@ impl Checker {
382358 source : & str ,
383359 report : & mut Report ,
384360 ) {
361+ let relative = file. strip_prefix ( & self . root ) . expect ( "should always be relative to root" ) ;
362+ // Don't check the reference. It has several legitimate things that
363+ // look like [<code>…</code>]. The reference has its own broken link
364+ // checker in its CI which handles this using pulldown_cmark.
365+ //
366+ // This checks both the end of the root (when checking just the
367+ // reference directory) or the beginning (when checking all docs).
368+ if self . root . ends_with ( "reference" ) || relative. starts_with ( "reference" ) {
369+ return ;
370+ }
385371 // Search for intra-doc links that rustdoc didn't warn about
386372 // FIXME(#77199, 77200) Rustdoc should just warn about these directly.
387373 // NOTE: only looks at one line at a time; in practice this should find most links
0 commit comments