Skip to content

rustdoc: private_doc_tests lint no longer fires on stable #75951

Description

@ehuss

As of rustc 1.47.0-beta.1, the private_doc_tests lint is no longer working.

#![warn(private_doc_tests)]
/// hi!
/// ```
/// let x = 1;
/// ```
fn f() {}

I expected to see this happen: cargo doc should issue warning: documentation test in private item

Instead, this happened: No warnings emitted.

This appears to have changed in #74855. I don't see any discussion there about this, so I'm guessing it was unintentional.

cc @jyn514.

Activity

  1. added
    A-doctestsArea: Documentation tests, run by rustdoc
    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.
    T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.
    on Aug 26, 2020
  2. added
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    on Aug 26, 2020
  3. jyn514 commented on Aug 26, 2020

    @jyn514
    Member

    This was definitely unintentional. I thought I added a test for this ...

  4. jyn514 commented on Aug 26, 2020

    @jyn514
    Member

    Hmm, it tests with deny(rustdoc) but not with deny(missing_doc_code_examples). Maybe the name of the lint wasn't registered?

    https://github.com/rust-lang/rust/pull/74855/files#diff-2009d75a18198cb86d168844baa3c607

  5. added this to the 1.47 milestone on Aug 26, 2020
  6. ehuss commented on Aug 26, 2020

    @ehuss
    ContributorAuthor

    The issue is this line. Compiletest runs with RUSTC_BOOTSTRAP set. I don't recall off the top of my head how to force a test to be stable.

  7. jyn514 commented on Aug 26, 2020

    @jyn514
    Member

    Wait now I'm confused. I thought the point of this lint was that it only runs on nightly, because we're not sure if we want to stabilize it.

    cc @rust-lang/rustdoc

  8. jyn514 commented on Aug 26, 2020

    @jyn514
    Member

    @ehuss are you sure this used to work?

  9. ehuss commented on Aug 26, 2020

    @ehuss
    ContributorAuthor

    The private_doc_tests lint has been on stable since 1.32. It is documented here.

  10. jyn514 commented on Aug 26, 2020

    @jyn514
    Member

    Got it, I mixed it up with missing_doc_code_examples. Yeah this is a bug then - the two lints should be treated differently.

  11. added a commit that references this issue on Aug 26, 2020
  12. jyn514 commented on Aug 26, 2020

    @jyn514
    Member

    Actually it looks like I introduced the opposite bug for missing_doc_code_examples - it now runs on beta when it shouldn't.

  13. spastorino commented on Aug 26, 2020

    @spastorino
    Member

    Assigning P-high as discussed as part of the Prioritization Working Group procedure and removing I-prioritize.

  14. added
    P-highHigh priority
    and removed
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    on Aug 26, 2020
  15. added a commit that references this issue on Aug 26, 2020
  16. added a commit that references this issue on Aug 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-doctestsArea: Documentation tests, run by rustdocA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.P-highHigh priorityT-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions