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

rustdoc: only show intra_doc_link_resolution_failure lints for items being documented #51684

Closed
QuietMisdreavus opened this issue Jun 21, 2018 · 6 comments
Labels
C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@QuietMisdreavus
Copy link
Member

One thing i noticed about this lint is that it's firing for items that aren't even being exported. For example, in this build log, there are a lot of repeat hits for the cfg_if! macro, even though i would not expect all of these crates to be re-exporting the macro. In one particular situation, it seems to have caused a crate with #![deny(warnings)] on it to fail to build, just because of this dependency! We should probably wait to emit these lints until the passes which strip items have been run, to reduce some of these erroneous reports.

@QuietMisdreavus QuietMisdreavus added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. C-enhancement Category: An issue proposing an enhancement or a PR with one. labels Jun 21, 2018
@QuietMisdreavus
Copy link
Member Author

cc @GuillaumeGomez since you implemented both the lint and the warning that preceded it.

@QuietMisdreavus
Copy link
Member Author

QuietMisdreavus commented Jun 21, 2018

cc #43466 as well since it's an intra-doc-link problem

@QuietMisdreavus QuietMisdreavus added C-bug Category: This is a bug. and removed C-enhancement Category: An issue proposing an enhancement or a PR with one. labels Jun 23, 2018
@clarfonthey
Copy link
Contributor

Just ran into this. I would like to see these capped to warn like they are normally for lints on dependency crates, rather than preventing a doc build on my crate for something I can't control.

@GuillaumeGomez
Copy link
Member

You can now play with cap-lints with rustdoc just like you would with rustc. However, this issue is a separate problem which needs to be fixed on its own.

@nrc
Copy link
Member

nrc commented Jul 18, 2018

It would be good, I think, to automatically suppress this lint for all dependent crates by default.

Perhaps off-topic, but this lint seems to be firing a lot for some crates (crossbeam, regex, and (I think) std). Many of these look like markdown links, which presumably we should not be firing the lint for?

@QuietMisdreavus
Copy link
Member Author

It took a bit of a refactor, but i've posted #52800 to solve this issue.

bors added a commit that referenced this issue Aug 5, 2018
rustdoc: refactor how passes are structured, and turn intra-doc-link collection into a pass

This builds on #52751 and should not be merged until that finally finishes the bors queue

Part 2 of my passes refactor. This introduces the concept of an "early pass", which is run right before exiting the compiler context. This is important for passes that may want to ask the compiler about things. For example, i took out the intra-doc-link collection and turned it into a early pass. I also made the `strip-hidden`, `strip-private` and `strip-priv-imports` passes occur as early passes, so that intra-doc-link collection wouldn't run on docs that weren't getting printed.

Fixes #51684, technically #51468 too but that version of `h2` hits a legit intra-link error after that `>_>`

r? @rust-lang/rustdoc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants