Skip to content

Cargo doc regression in crates that include #![deny(unused_imports)] #51661

Closed
@dtolnay

Description

@dtolnay
#![deny(unused_imports)]

use std::fs::File;

pub fn f() {
    let _: File;
}

cargo doc of the above lib.rs works up through cargo +nightly-2018-06-17 doc. As of cargo +nightly-2018-06-18 doc it fails with:

$ cargo +nightly-2018-06-18 doc
 Documenting unused-imports v0.0.0
error: unused import: `std::fs::File`
 --> src/lib.rs:3:5
  |
3 | use std::fs::File;
  |     ^^^^^^^^^^^^^
  |
note: lint level defined here
 --> src/lib.rs:1:9
  |
1 | #![deny(unused_imports)]
  |         ^^^^^^^^^^^^^^

error: Compilation failed, aborting rustdoc

error: Could not document `unused-imports`.

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-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