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

Don't panic when an external crate can't be resolved #80372

Merged
merged 1 commit into from
Jan 8, 2021

Conversation

jyn514
Copy link
Member

@jyn514 jyn514 commented Dec 26, 2020

This isn't actually a bug, it can occur when rustdoc tries to resolve a
crate that isn't used in the main code.

Fixes #72381.

r? @kinnison if you have time, otherwise @Manishearth

@jyn514 jyn514 added A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Dec 26, 2020
@rust-log-analyzer

This comment has been minimized.

This isn't actually a bug, it can occur when rustdoc tries to resolve a
crate that isn't used in the main code.
@jyn514 jyn514 added the A-resolve Area: Name resolution label Dec 26, 2020
@inodentry
Copy link

This is a very important fix. I am unable to generate documentation for many of my projects (notably when using bevy_tilemap), because it triggers this condition. Thank you for addressing this, hope it gets merged soon.

@jyn514
Copy link
Member Author

jyn514 commented Dec 30, 2020

@jamadazi hmm, I'm surprised to hear that - this should always be fixable by just not passing the --extern flag to rustdoc.

@inodentry
Copy link

inodentry commented Dec 30, 2020

I am very much interested in generating combined documentation for all my dependencies, together with the crates in the current workspace. That is how I typically use rustdoc -- to give me full, complete, offline documentation for everything relevant to my project (including the whole dependency tree). It makes it very easy to access whatever docs I want, from a single place, offline.

EDIT: also, this is the default behaviour of cargo doc anyway. So that should be well-supported. But it triggers this bug in my case (or at least I suspect it is this bug, because the error message is the same).

@jyn514 jyn514 added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 8, 2021
@Manishearth
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Jan 8, 2021

📌 Commit 7edd181 has been approved by Manishearth

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 8, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 8, 2021
Rollup of 7 pull requests

Successful merges:

 - rust-lang#79675 (Make sure rust-call errors occur correctly for traits)
 - rust-lang#80372 (Don't panic when an external crate can't be resolved)
 - rust-lang#80761 (handle generic trait methods in coverage-report tests)
 - rust-lang#80785 (rustc_ast_pretty: Remove `PrintState::insert_extra_parens`)
 - rust-lang#80791 (Fix type name in doc example for Iter and IterMut)
 - rust-lang#80794 (Use Option::map_or instead of `.map(..).unwrap_or(..)`)
 - rust-lang#80799 (Get rid of custom pretty-printing in rustdoc)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 901b9a2 into rust-lang:master Jan 8, 2021
@bors
Copy link
Contributor

bors commented Jan 8, 2021

⌛ Testing commit 7edd181 with merge 9155a9d...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name A-resolve Area: Name resolution S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rustdoc panics with Unable to resolve external crate
6 participants