Closed
Description
Summary
I was attempting to run cargo doc --open
at the top level of a Cargo workspace, which resulted in several warnings regarding output filename collisions for lexical-core
, proc_macro2
, quote
, syn
, and unicode-xid
(rust-lang/cargo#6313).
Later on, there is an internal compiler error caused by lexical-core 0.4.6:
error: internal compiler error: src/librustc/hir/def.rs:339: attempted .def_id() on invalid res: Err
thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:644:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
This issue only occurs in cargo doc
, as far as I can tell. Running cargo build
, cargo run
, and cargo bench
all behave as expected.
Toolchain information
rustc 1.38.0 (625451e37 2019-09-23)
rustdoc 1.38.0 (625451e37 2019-09-23)
x86_64-unknown-linux-gnu
- Arch Linux (
5.3.5-arch1-1-ARCH
)
How to reproduce
- Clone this repository and enter the root directory.
cargo doc --open
Debug output
Output filename collision warning messages
warning: output filename collision.
The lib target `lexical-core` in package `lexical-core v0.6.2` has the same output filename as the lib target `lexical-core` in package `lexical-core v0.4.6`.
Colliding filename is: /home/ekalderon/Documents/nix-language-server/target/doc/lexical_core/index.html
The targets should have unique names.
Consider changing their names to be unique or compiling them separately.
This may become a hard error in the future; see <https://github.com/rust-lang/cargo/issues/6313>.
warning: output filename collision.
The lib target `proc_macro2` in package `proc-macro2 v1.0.5` has the same output filename as the lib target `proc-macro2` in package `proc-macro2 v0.4.30`.
Colliding filename is: /home/ekalderon/Documents/nix-language-server/target/doc/proc_macro2/index.html
The output filenames should be unique.
Consider changing their names to be unique or compiling them separately.
This may become a hard error in the future; see <https://github.com/rust-lang/cargo/issues/6313>.
If this looks unexpected, it may be a bug in Cargo. Please file a bug report at
https://github.com/rust-lang/cargo/issues/ with as much information as you
can provide.
cargo 1.38.0 (23ef9a4ef 2019-08-20) running on `x86_64-unknown-linux-gnu` target `x86_64-unknown-linux-gnu`
First unit: Unit { pkg: Package { id: PackageId { name: "proc-macro2", version: "1.0.5", source: "registry `https://github.com/rust-lang/crates.io-index`" }, ..: ".." }, target: Target { ..: lib_target("proc_macro2", ["lib"], "/home/ekalderon/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-1.0.5/src/lib.rs", Edition2018) }, profile: Profile { incremental: false, ..: default_doc() }, kind: Host, mode: Doc { deps: true } }
Second unit: Unit { pkg: Package { id: PackageId { name: "proc-macro2", version: "0.4.30", source: "registry `https://github.com/rust-lang/crates.io-index`" }, ..: ".." }, target: Target { ..: lib_target("proc-macro2", ["lib"], "/home/ekalderon/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-0.4.30/src/lib.rs", Edition2015) }, profile: Profile { incremental: false, ..: default_doc() }, kind: Host, mode: Doc { deps: true } }
warning: output filename collision.
The lib target `quote` in package `quote v1.0.2` has the same output filename as the lib target `quote` in package `quote v0.6.13`.
Colliding filename is: /home/ekalderon/Documents/nix-language-server/target/doc/quote/index.html
The targets should have unique names.
Consider changing their names to be unique or compiling them separately.
This may become a hard error in the future; see <https://github.com/rust-lang/cargo/issues/6313>.
warning: output filename collision.
The lib target `syn` in package `syn v1.0.5` has the same output filename as the lib target `syn` in package `syn v0.15.44`.
Colliding filename is: /home/ekalderon/Documents/nix-language-server/target/doc/syn/index.html
The targets should have unique names.
Consider changing their names to be unique or compiling them separately.
This may become a hard error in the future; see <https://github.com/rust-lang/cargo/issues/6313>.
warning: output filename collision.
The lib target `unicode-xid` in package `unicode-xid v0.2.0` has the same output filename as the lib target `unicode-xid` in package `unicode-xid v0.1.0`.
Colliding filename is: /home/ekalderon/Documents/nix-language-server/target/doc/unicode_xid/index.html
The targets should have unique names.
Consider changing their names to be unique or compiling them separately.
This may become a hard error in the future; see <https://github.com/rust-lang/cargo/issues/6313>.
Full backtrace output for ICE
error: internal compiler error: src/librustc/hir/def.rs:339: attempted .def_id() on invalid res: Err
thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:644:9
stack backtrace:
0: backtrace::backtrace::libunwind::trace
at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.34/src/backtrace/libunwind.rs:88
1: backtrace::backtrace::trace_unsynchronized
at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.34/src/backtrace/mod.rs:66
2: std::sys_common::backtrace::_print
at src/libstd/sys_common/backtrace.rs:47
3: std::sys_common::backtrace::print
at src/libstd/sys_common/backtrace.rs:36
4: std::panicking::default_hook::{{closure}}
at src/libstd/panicking.rs:200
5: std::panicking::default_hook
at src/libstd/panicking.rs:214
6: std::panicking::rust_panic_with_hook
at src/libstd/panicking.rs:477
7: std::panicking::begin_panic
8: rustc_errors::Handler::bug
9: rustc::util::bug::opt_span_bug_fmt::{{closure}}
10: rustc::ty::context::tls::with_opt::{{closure}}
11: rustc::ty::context::tls::with_context_opt
12: rustc::ty::context::tls::with_opt
13: rustc::util::bug::opt_span_bug_fmt
14: rustc::util::bug::bug_fmt
15: rustc::hir::def::Res<Id>::def_id::{{closure}}
16: rustdoc::clean::register_res
17: <syntax::source_map::Spanned<rustc::hir::VisibilityKind> as rustdoc::clean::Clean<core::option::Option<rustdoc::clean::Visibility>>>::clean
18: <rustc::hir::ImplItem as rustdoc::clean::Clean<rustdoc::clean::Item>>::clean
19: <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T,I>>::from_iter
20: <rustdoc::doctree::Impl as rustdoc::clean::Clean<alloc::vec::Vec<rustdoc::clean::Item>>>::clean
21: <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T,I>>::spec_extend
22: <rustdoc::doctree::Module as rustdoc::clean::Clean<rustdoc::clean::Item>>::clean
23: <rustdoc::doctree::Module as rustdoc::clean::Clean<rustdoc::clean::Item>>::clean
24: <rustdoc::doctree::Module as rustdoc::clean::Clean<rustdoc::clean::Item>>::clean
25: <rustdoc::doctree::Module as rustdoc::clean::Clean<rustdoc::clean::Item>>::clean
26: <rustc::hir::Crate as rustdoc::clean::Clean<rustdoc::clean::Crate>>::clean
27: rustc_interface::passes::BoxedGlobalCtxt::access::{{closure}}
28: rustc_interface::passes::create_global_ctxt::{{closure}}
29: rustc_interface::interface::run_compiler_in_existing_thread_pool
30: rustdoc::core::run_core
31: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
32: std::panicking::try::do_call
33: __rust_maybe_catch_panic
at src/libpanic_unwind/lib.rs:80
34: rustc_driver::report_ices_to_stderr_if_any
35: rustdoc::main_options
36: std::thread::local::LocalKey<T>::with
37: scoped_tls::ScopedKey<T>::set
38: syntax::with_globals
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
error: aborting due to previous error
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: rustc 1.38.0 (625451e37 2019-09-23) running on x86_64-unknown-linux-gnu
error: Could not document `lexical-core`.