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

Make rustdoc lints a tool lint instead of built-in #80527

Merged
merged 7 commits into from
Mar 4, 2021

Commits on Mar 2, 2021

  1. Rename rustdoc lints to be a tool lint instead of built-in.

    - Rename `broken_intra_doc_links` to `rustdoc::broken_intra_doc_links`
    - Ensure that the old lint names still work and give deprecation errors
    - Register lints even when running doctests
    
      Otherwise, all `rustdoc::` lints would be ignored.
    
    - Register all existing lints as removed
    
      This unfortunately doesn't work with `register_renamed` because tool
      lints have not yet been registered when rustc is running. For similar
      reasons, `check_backwards_compat` doesn't work either. Call
      `register_removed` directly instead.
    
    - Fix fallout
    
      + Rustdoc lints for compiler/
      + Rustdoc lints for library/
    
    Note that this does *not* suggest `rustdoc::broken_intra_doc_links` for
    `rustdoc::intra_doc_link_resolution_failure`, since there was no time
    when the latter was valid.
    jyn514 committed Mar 2, 2021
    Configuration menu
    Copy the full SHA
    cc62018 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    37e4cfe View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    7195355 View commit details
    Browse the repository at this point in the history
  4. Improve error messages

    - Use `register_renamed` when rustdoc is running so the lint will still
      be active and use a structured suggestion
    - Test the behavior for rustc, not just for rustdoc (because it differs)
    jyn514 committed Mar 2, 2021
    Configuration menu
    Copy the full SHA
    e8ddfda View commit details
    Browse the repository at this point in the history
  5. Address review comments

    - Move MISSING_CRATE_LEVEL_DOCS to rustdoc directly
    - Update documentation
    
    This also takes the opportunity to make the `no-crate-level-doc-lint`
    test more specific.
    jyn514 committed Mar 2, 2021
    Configuration menu
    Copy the full SHA
    0517ea7 View commit details
    Browse the repository at this point in the history
  6. Update comments

    Note that the FIXME was removed because this can't be fixed,
    `register_renamed` calls LintId::of and there's no LintId for rustdoc
    lints when rustc is running.
    jyn514 committed Mar 2, 2021
    Configuration menu
    Copy the full SHA
    c7535d1 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    75efb6e View commit details
    Browse the repository at this point in the history