Skip to content

rustdoc internal compiler error #42875

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

Closed
ArcaneNibble opened this issue Jun 24, 2017 · 3 comments
Closed

rustdoc internal compiler error #42875

ArcaneNibble opened this issue Jun 24, 2017 · 3 comments
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@ArcaneNibble
Copy link

When I run cargo rustdoc --lib -- --no-defaults --passes "collapse-docs" --passes "unindent-comments" on this commit of the xc2bit crate: https://github.com/azonenberg/openfpga/tree/d91cc0e9927a5c106b8b50c76111a33970a81def/src/xc2bit, the compiler encounters an unexpected panic. The backtrace is:

thread 'rustc' panicked at 'index 18446744073709551615 out of range for slice of length 0', /checkout/src/libcore/slice/mod.rs:672
stack backtrace:
   0: std::sys::imp::backtrace::tracing::imp::unwind_backtrace
             at /checkout/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::_print
             at /checkout/src/libstd/sys_common/backtrace.rs:71
   2: std::panicking::default_hook::{{closure}}
             at /checkout/src/libstd/sys_common/backtrace.rs:60
             at /checkout/src/libstd/panicking.rs:355
   3: std::panicking::default_hook
             at /checkout/src/libstd/panicking.rs:365
   4: std::panicking::rust_panic_with_hook
             at /checkout/src/libstd/panicking.rs:549
   5: std::panicking::begin_panic
             at /checkout/src/libstd/panicking.rs:511
   6: std::panicking::begin_panic_fmt
             at /checkout/src/libstd/panicking.rs:495
   7: rust_begin_unwind
             at /checkout/src/libstd/panicking.rs:471
   8: core::panicking::panic_fmt
             at /checkout/src/libcore/panicking.rs:69
   9: core::slice::slice_index_len_fail
             at /checkout/src/libcore/slice/mod.rs:672
  10: rustdoc::html::format::resolved_path
  11: core::fmt::write
             at /checkout/src/libcore/fmt/mod.rs:954
  12: core::fmt::Formatter::write_fmt
             at /checkout/src/libcore/fmt/mod.rs:1262
  13: rustdoc::html::format::<impl core::fmt::Display for rustdoc::clean::Import>::fmt
  14: core::fmt::write
             at /checkout/src/libcore/fmt/mod.rs:954
  15: core::fmt::Formatter::write_fmt
             at /checkout/src/libcore/fmt/mod.rs:1262
  16: <rustdoc::html::render::Item<'a> as core::fmt::Display>::fmt
  17: core::fmt::write
             at /checkout/src/libcore/fmt/mod.rs:994
             at /checkout/src/libcore/fmt/mod.rs:962
  18: std::io::Write::write_fmt
  19: rustdoc::html::render::Context::render_item
  20: rustdoc::html::render::Context::item::{{closure}}
  21: rustdoc::html::render::run
  22: rustdoc::rust_input::{{closure}}
  23: std::panicking::try::do_call
  24: __rust_maybe_catch_panic
             at /checkout/src/libpanic_unwind/lib.rs:98
  25: <F as alloc::boxed::FnBox<A>>::call_box
  26: std::sys::imp::thread::Thread::new::thread_start
             at /checkout/src/liballoc/boxed.rs:650
             at /checkout/src/libstd/sys_common/thread.rs:21
             at /checkout/src/libstd/sys/unix/thread.rs:84
  27: start_thread
  28: __clone
$ rustc --version --verbose
rustc 1.18.0 (03fc9d622 2017-06-06)
binary: rustc
commit-hash: 03fc9d622e0ea26a3d37f5ab030737fcca6928b9
commit-date: 2017-06-06
host: x86_64-unknown-linux-gnu
release: 1.18.0
LLVM version: 3.9
$ rustdoc --version --verbose
rustdoc 1.18.0 (03fc9d622 2017-06-06)
binary: rustdoc
commit-hash: 03fc9d622e0ea26a3d37f5ab030737fcca6928b9
commit-date: 2017-06-06
host: x86_64-unknown-linux-gnu
release: 1.18.0
LLVM version: 3.9
@ArcaneNibble
Copy link
Author

ArcaneNibble commented Jun 24, 2017

I just tested nighty and it's broken there too:

thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', /checkout/src/libcore/option.rs:335
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
   0: std::sys::imp::backtrace::tracing::imp::unwind_backtrace
             at /checkout/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::_print
             at /checkout/src/libstd/sys_common/backtrace.rs:71
   2: std::panicking::default_hook::{{closure}}
             at /checkout/src/libstd/sys_common/backtrace.rs:60
             at /checkout/src/libstd/panicking.rs:355
   3: std::panicking::default_hook
             at /checkout/src/libstd/panicking.rs:365
   4: std::panicking::rust_panic_with_hook
             at /checkout/src/libstd/panicking.rs:549
   5: std::panicking::begin_panic
             at /checkout/src/libstd/panicking.rs:511
   6: std::panicking::begin_panic_fmt
             at /checkout/src/libstd/panicking.rs:495
   7: rust_begin_unwind
             at /checkout/src/libstd/panicking.rs:471
   8: core::panicking::panic_fmt
             at /checkout/src/libcore/panicking.rs:71
   9: core::panicking::panic
             at /checkout/src/libcore/panicking.rs:51
  10: rustdoc::html::format::resolved_path
  11: core::fmt::write
             at /checkout/src/libcore/fmt/mod.rs:954
  12: core::fmt::Formatter::write_fmt
             at /checkout/src/libcore/fmt/mod.rs:1262
  13: rustdoc::html::format::<impl core::fmt::Display for rustdoc::clean::Import>::fmt
  14: core::fmt::write
             at /checkout/src/libcore/fmt/mod.rs:954
  15: core::fmt::Formatter::write_fmt
             at /checkout/src/libcore/fmt/mod.rs:1262
  16: <rustdoc::html::render::Item<'a> as core::fmt::Display>::fmt
  17: core::fmt::write
             at /checkout/src/libcore/fmt/mod.rs:994
             at /checkout/src/libcore/fmt/mod.rs:962
  18: std::io::Write::write_fmt
  19: rustdoc::html::render::Context::render_item
  20: rustdoc::html::render::Context::item::{{closure}}
  21: rustdoc::html::render::run
$ rustc --verbose --version
rustc 1.20.0-nightly (229d0d326 2017-06-23)
binary: rustc
commit-hash: 229d0d3266002d343cdd2f4a3bf7f2fe9da15f38
commit-date: 2017-06-23
host: x86_64-unknown-linux-gnu
release: 1.20.0-nightly
LLVM version: 4.0
$ rustdoc --verbose --version
rustdoc 1.20.0-nightly (229d0d326 2017-06-23)
binary: rustdoc
commit-hash: 229d0d3266002d343cdd2f4a3bf7f2fe9da15f38
commit-date: 2017-06-23
host: x86_64-unknown-linux-gnu
release: 1.20.0-nightly
LLVM version: 4.0

@Mark-Simulacrum Mark-Simulacrum added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ labels Jun 24, 2017
@Mark-Simulacrum
Copy link
Member

Unwrap is here:

let last = path.segments.last().unwrap();
. With the command rustdoc --no-defaults --passes "collapse-docs" --passes "unindent-comments" lib.rs this reproduces given this file:

mod a {
    use *;
}

@ollie27
Copy link
Member

ollie27 commented Jun 24, 2017

I'm working on a fix.

EDIT: #42885

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ 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

3 participants