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: implementing trait with associated const for primitive causes panic (regression) #31808

Closed
Jascha-N opened this issue Feb 21, 2016 · 1 comment · Fixed by #31837
Closed

Comments

@Jascha-N
Copy link

Nightly rustdoc seems to panic when implementing a trait with an associated const for a primitive type.

Reduced test case:

#![feature(associated_consts)]

pub trait Foo {
    const BAR: usize;
}

impl Foo for () {
    const BAR: usize = 0;
}

Message:
thread '<unnamed>' panicked at 'called Option::unwrap()on aNone value', ../src/libcore\option.rs:330

Meta

>rustdoc -vV
rustdoc 1.8.0-nightly (57c357d89 2016-02-16)
binary: rustdoc
commit-hash: 57c357d89183df173b0e42a0f745d9cfdb67fb1a
commit-date: 2016-02-16
host: x86_64-pc-windows-msvc
release: 1.8.0-nightly

Backtrace:

   0:     0x7ffc6b5cd947 - panicking::Location<'a>::line::hd292ced6adc3cf6b7fz
   1:     0x7ffc6b5cd146 - panicking::take_handler::h49f661ca9b556367Wdz
   2:     0x7ffc6b59410f - sys_common::unwind::begin_unwind_inner::h72177c2eb1fe6c2eLct
   3:     0x7ffc6b594b9d - sys_common::unwind::begin_unwind_fmt::h9befc5f9bdb15c19Rbt
   4:     0x7ffc6b5c2f82 - rust_begin_unwind
   5:     0x7ffc6b5daac8 - panicking::panic_fmt::h8430b6988b78563f6YL
   6:     0x7ffc6b5db3c0 - panicking::panic::h331ae34734277dc3DXL
   7:     0x7ffc669c128e - html::render::Cache.DocFolder::fold_item::h467e95350f348073Q5o
   8:     0x7ffc6684b7d1 - html::render::run::h9521371f3809b50bX8n
   9:     0x7ffc6682626a - main_args::h6d07868c1334373bU3u
  10:     0x7ffc66822751 - main::hf5a3402ea1356a63GZu
  11:     0x7ffc6b5c2eb8 - sys_common::thread_local::Key.Drop::drop::h122da565f997e58984s
  12:     0x7ffc6b5bc7f2 - sys_common::unwind::inner_try::h6f3bf9f042fec881N9s
  13:     0x7ffc66822cdf - main::hf5a3402ea1356a63GZu
  14:     0x7ffc6b5cb62b - sys::process::Command::cwd::h2628fdc5c60e66846Sx
  15:     0x7ffc860f8101 - BaseThreadInitThunk
@Jascha-N
Copy link
Author

The last nightly version that documented the above code successfully is:

>rustc -vV
rustc 1.8.0-nightly (ce4b75f25 2016-02-12)
binary: rustc
commit-hash: ce4b75f25662cb9facafc4bef368410a2979b936
commit-date: 2016-02-12
host: x86_64-pc-windows-msvc
release: 1.8.0-nightly

I've narrowed the breakage down to one of the following commits: a085e3b, 938202c, 5c98ae3.

@Jascha-N Jascha-N changed the title rustdoc: implementing trait with associated const for primitive causes panic rustdoc: implementing trait with associated const for primitive causes panic (regression) Feb 22, 2016
Manishearth added a commit to Manishearth/rust that referenced this issue Feb 25, 2016
…ichton

This effectively only records associated items from either inherent impls or trait definitions in the search-index.

fixes rust-lang#31808

r? @alexcrichton
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant