Skip to content

Nightly Cargo doc fail on proc macro #57841

Closed
@DutchGhost

Description

@DutchGhost
//! [`bug`]
extern crate proc_macro;

use self::proc_macro::TokenStream;

#[proc_macro_attribute]
pub fn bug(_: TokenStream, item: TokenStream) -> TokenStream {
    item
}

If I run cargo doc on nightly rustc 1.33.0-nightly (ceb2512 2019-01-16), I get this ICE:

Backtrace:

thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', src\libcore\option.rs:345:21
stack backtrace:
   0: std::sys_common::alloc::realloc_fallback
   1: std::panicking::take_hook
   2: std::panicking::take_hook
   3: std::panicking::rust_panic_with_hook
   4: std::panicking::begin_panic_fmt
   5: rust_begin_unwind
   6: core::panicking::panic_fmt
   7: core::panicking::panic
   8: rustc_metadata::cstore::CStore::new
   9: rustc_metadata::cstore_impl::<impl rustc_metadata::cstore::CStore>::load_macro_untracked
  10: rustc_resolve::build_reduced_graph::<impl rustc_resolve::Resolver<'a>>::get_macro
  11: <unknown>
  12: <unknown>
  13: <unknown>
  14: <unknown>
  15: <unknown>
  16: <unknown>
  17: <unknown>
  18: <unknown>
  19: <unknown>
  20: <unknown>
  21: <unknown>
  22: <unknown>
  23: _rust_maybe_catch_panic
  24: <unknown>
  25: std::sys::windows::thread::Thread::new
  26: BaseThreadInitThunk
  27: RtlUserThreadStart

error: internal compiler error: unexpected panic

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.33.0-nightly (ceb251214 2019-01-16) running on x86_64-pc-windows-msvc

error: Could not document `rustdoc_crash`.

Running it in stable/beta works just fine.

A full setup with a Cargo.toml file can be found here: https://github.com/DutchGhost/rustdoc_proc_macro_crash

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-intra-doc-linksArea: Intra-doc links, the ability to link to items in docs by nameT-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