@@ -55,30 +55,6 @@ const LINKCHECK_EXCEPTIONS: &[(&str, &[&str])] = &[
55
55
56
56
#[ rustfmt:: skip]
57
57
const 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
- ] ) ,
82
58
// This is being used in the sense of 'inclusive range', not a markdown link
83
59
( "core/ops/struct.RangeInclusive.html" , & [ "begin</code>, <code>end" ] ) ,
84
60
( "std/ops/struct.RangeInclusive.html" , & [ "begin</code>, <code>end" ] ) ,
@@ -382,6 +358,16 @@ impl Checker {
382
358
source : & str ,
383
359
report : & mut Report ,
384
360
) {
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
+ }
385
371
// Search for intra-doc links that rustdoc didn't warn about
386
372
// FIXME(#77199, 77200) Rustdoc should just warn about these directly.
387
373
// NOTE: only looks at one line at a time; in practice this should find most links
0 commit comments