Skip to content

rustdoc panics with Unable to resolve external crate #72381

Closed
@cipriancraciun

Description

@cipriancraciun

I'm running rustdoc via cargo doc on a small project with multiple crates via the workspaces feature, and I get the following error (I've sanitized the paths, project name and dependencies):

Documenting <project> v0.0.0 (/.../sources/...)
thread 'rustc' panicked at 'Unable to resolve external crate <dependency>', src/librustdoc/core.rs:354:33
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: Could not document `<project>`.

It always fails with random external dependencies or crates that are part of the workspace. It does succeed however for a crate without any dependencies.

I've tried with Rust 1.43.0 and 1.43.1, on openSUSE Tumbleweed Linux, both from the distributions repository (1.43.0) and rustup (1.43.1). I've also tried with latest nightly with the same outcome.

rustc --version --verbose:

rustc 1.43.1 (8d69840ab 2020-05-04)
binary: rustc
commit-hash: 8d69840ab92ea7f4d323420088dd8c9775f180cd
commit-date: 2020-05-04
host: x86_64-unknown-linux-gnu
release: 1.43.1
LLVM version: 9.0
Backtrace

~~~~ 0: 0x7fec4d588e84 - backtrace::backtrace::libunwind::trace::h5d52ba5f20882f09 at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.44/src/backtrace/libunwind.rs:86 1: 0x7fec4d588e84 - backtrace::backtrace::trace_unsynchronized::hceee092869668a74 at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.44/src/backtrace/mod.rs:66 2: 0x7fec4d588e84 - std::sys_common::backtrace::_print_fmt::ha312c2904605e4d5 at src/libstd/sys_common/backtrace.rs:78 3: 0x7fec4d588e84 - ::fmt::h5b9981092140b727 at src/libstd/sys_common/backtrace.rs:59 4: 0x7fec4d5c187c - core::fmt::write::h5f6d7d8de88b4173 at src/libcore/fmt/mod.rs:1063 5: 0x7fec4d57aba3 - std::io::Write::write_fmt::h893169117de3cc15 at src/libstd/io/mod.rs:1426 6: 0x7fec4d58dcb5 - std::sys_common::backtrace::_print::h8ab61d4120f7a335 at src/libstd/sys_common/backtrace.rs:62 7: 0x7fec4d58dcb5 - std::sys_common::backtrace::print::h8aae19fbb153bf2a at src/libstd/sys_common/backtrace.rs:49 8: 0x7fec4d58dcb5 - std::panicking::default_hook::{{closure}}::h1ee5b7d8b6f83429 at src/libstd/panicking.rs:204 9: 0x7fec4d58da02 - std::panicking::default_hook::hd6c32c13403f9210 at src/libstd/panicking.rs:224 10: 0x7fec4d58e312 - std::panicking::rust_panic_with_hook::h1f2449d529a25f22 at src/libstd/panicking.rs:470 11: 0x7fec4d58defb - rust_begin_unwind at src/libstd/panicking.rs:378 12: 0x7fec4d58de6b - std::panicking::begin_panic_fmt::h7c14cf40a8be97ee at src/libstd/panicking.rs:332 13: 0x563d34526ef8 - rustdoc::core::run_core::{{closure}}::{{closure}}::{{closure}}::{{closure}}::h5a5fec5e0f5685ac 14: 0x563d3450aada - rustc_interface::passes::BoxedResolver::access::{{closure}}::h9b9e71b1599a62a5 15: 0x7fec4e0049ec - rustc_interface::passes::configure_and_expand::{{closure}}::h91f469c3c3c046cf 16: 0x563d3450a3a6 - rustc_interface::passes::BoxedResolver::access::h7380bf3af1b357ea 17: 0x563d345fbb3b - rustc_interface::interface::run_compiler_in_existing_thread_pool::hbfb381d6a6b1c5d8 18: 0x563d345a606c - rustdoc::core::run_core::h3e13637dfb5154dd 19: 0x563d3440f2d0 - as core::ops::function::FnOnce<()>>::call_once::ha269444829893481 20: 0x563d3444a57b - std::panicking::try::do_call::h3fc76fb3531c3219 21: 0x7fec4d59f6b7 - __rust_maybe_catch_panic at src/libpanic_unwind/lib.rs:86 22: 0x563d3441034b - rustc_driver::catch_fatal_errors::h7a280b9cdf28f352 23: 0x563d343db6fd - rustdoc::main_options::h42dedd41a78b0329 24: 0x563d34446a57 - scoped_tls::ScopedKey::set::ha6b8c3cc8b8d950f 25: 0x563d3459f9e4 - rustc_ast::attr::with_globals::he8fa93d7ebdc5344 26: 0x563d343ab492 - std::sys_common::backtrace::__rust_begin_short_backtrace::h291078985b95d359 27: 0x7fec4d59f6b7 - __rust_maybe_catch_panic at src/libpanic_unwind/lib.rs:86 28: 0x563d3444cca6 - core::ops::function::FnOnce::call_once{{vtable.shim}}::hc250b6ab2be39f01 29: 0x7fec4d56a64f - as core::ops::function::FnOnce>::call_once::h36e46972b1b7f7b7 at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd/src/liballoc/boxed.rs:1017 30: 0x7fec4d59dfbd - as core::ops::function::FnOnce>::call_once::hdde89c32ce6999de at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd/src/liballoc/boxed.rs:1017 31: 0x7fec4d59dfbd - std::sys_common::thread::start_thread::h5ae3fdd4dad03dd5 at src/libstd/sys_common/thread.rs:13 32: 0x7fec4d59dfbd - std::sys::unix::thread::Thread::new::thread_start::h76b2403b2434c4c0 at src/libstd/sys/unix/thread.rs:80 33: 0x7fec4d4deefa - start_thread 34: 0x7fec4d3f33bf - __GI___clone 35: 0x0 - ~~~~

Metadata

Metadata

Assignees

Labels

A-resolveArea: Name/path resolution done by `rustc_resolve` specificallyC-bugCategory: This is a bug.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions