Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix broken links in compiler docs #73749

Closed
jyn514 opened this issue Jun 26, 2020 · 7 comments
Closed

Fix broken links in compiler docs #73749

jyn514 opened this issue Jun 26, 2020 · 7 comments
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools A-doctests Area: Documentation tests, run by rustdoc C-bug Category: This is a bug.

Comments

@jyn514
Copy link
Member

jyn514 commented Jun 26, 2020

I noticed a bunch of warnings while documenting the compiler:

Warnings
warning: `[exhaustiveness]` cannot be resolved, ignoring it.
 --> src/librustc_mir_build/hair/pattern/_match.rs:7:69
  |
7 | //! (a) the patterns cover every possible constructor for the type [exhaustiveness]
  |                                                                     ^^^^^^^^^^^^^^ cannot be resolved, ignoring
  |
  = note: `#[warn(intra_doc_link_resolution_failure)]` on by default
  = help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`

warning: `[usefulness]` cannot be resolved, ignoring it.
 --> src/librustc_mir_build/hair/pattern/_match.rs:8:36
  |
8 | //! (b) each pattern is necessary [usefulness]
  |                                    ^^^^^^^^^^ cannot be resolved, ignoring
  |
  = help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`

warning: could not parse code block as Rust code
   --> src/librustc_mir_build/hair/pattern/_match.rs:113:9
    |
113 |   //!        For example, the first pattern above initially gives a stack `[(Some(true), _)]`. If we
    |  _________^
114 | | //!        pop the tuple constructor, we are left with `[Some(true), _]`, and if we then pop the
115 | | //!        `Some` constructor we get `[true, _]`. If we had popped `None` instead, we would get
116 | | //!        nothing back.
...   |
149 | | //!     Note that the OR-patterns are not always used directly in Rust, but are used to derive the
150 | | //!     exhaustive integer matching rules, so they're written here for posterity.
    | |_________________________________________________________________________________^
    |
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: character literal may only contain one codepoint
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: \u{2260}
    = note: error from rustc: unterminated character literal

warning: could not parse code block as Rust code
   --> src/librustc_mir_build/hair/pattern/_match.rs:179:9
    |
179 |   //!           For example, if `P` is:
    |  _________^
180 | | //!           [
181 | | //!               [Some(true), _],
182 | | //!               [None, 0],
...   |
229 | | //!           `U(P, p) := U(P, (r_1, p_2, .., p_n))
230 | | //!                    || U(P, (r_2, p_2, .., p_n))`
    | |____________________________________________________^
    |
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: \u{2203}
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `
    = note: error from rustc: unknown start of token: `

warning: 4 warnings emitted

A lot of these look like broken links. It would be great to fix them.

Originally posted by @jyn514 in #73748 (comment)

@jyn514
Copy link
Member Author

jyn514 commented Jun 26, 2020

@rustbot modify labels: T-doc C-bug

@rustbot rustbot added C-bug Category: This is a bug. A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools labels Jun 26, 2020
@tesuji
Copy link
Contributor

tesuji commented Jun 26, 2020

So can we make those warnings into errors ?

@jyn514
Copy link
Member Author

jyn514 commented Jun 26, 2020

We can certainly deny(intra_doc_resolution_failure). The second I'm not sure about, rustc already uses deny(warnings) but rustdoc has a global allow(warnings) that might be interfering.

@jyn514
Copy link
Member Author

jyn514 commented Jun 26, 2020

@GuillaumeGomez said:

They're not tracked for the moment until we have the intra-doc links stabilized. I definitely plan to deny this warning as soon as it's stable. :)

So it's definitely good to fix the failures but we should wait on deny(intra_doc_resolution_failure) for now.

@JohnTitor JohnTitor added the A-doctests Area: Documentation tests, run by rustdoc label Jun 26, 2020
@AlphaHot
Copy link

AlphaHot commented Jul 7, 2020

@jyn514 where can I view the source code for intra_doc_resolution_failure?

@jyn514
Copy link
Member Author

jyn514 commented Jul 7, 2020

The docs for the lint are in the rustdoc book. The source code is in

/// Reports a resolution failure diagnostic.

@jyn514
Copy link
Member Author

jyn514 commented Dec 26, 2020

Closing in favor of #80369, I think the intra-doc links have all been fixed.

@jyn514 jyn514 closed this as completed Dec 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools A-doctests Area: Documentation tests, run by rustdoc C-bug Category: This is a bug.
Projects
None yet
Development

No branches or pull requests

5 participants