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 ICE for intra links referring to builtin macros #48341

Closed
Manishearth opened this issue Feb 18, 2018 · 2 comments
Closed

rustdoc ICE for intra links referring to builtin macros #48341

Manishearth opened this issue Feb 18, 2018 · 2 comments
Assignees
Labels
C-bug Category: This is a bug. 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

@Manishearth
Copy link
Member

/// [foo](format_args)
struct Foo;

when passed through rustdoc gives the following crash:

thread 'rustc' panicked at 'index out of bounds: the len is 11 but the index is 4294967295', /Users/travis/build/rust-lang/rust/src/liballoc/vec.rs:1551:10
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
   1: std::sys_common::backtrace::print
   2: std::panicking::default_hook::{{closure}}
   3: std::panicking::default_hook
   4: std::panicking::rust_panic_with_hook
   5: std::panicking::begin_panic
   6: std::panicking::begin_panic_fmt
   7: rust_begin_unwind
   8: core::panicking::panic_fmt
   9: core::panicking::panic_bounds_check
  10: rustc::ty::maps::<impl rustc::ty::maps::queries::crate_name<'tcx>>::compute_result
  11: rustc::dep_graph::graph::DepGraph::with_task_impl
  12: rustc_errors::Handler::track_diagnostics
  13: rustc::ty::maps::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::cycle_check
  14: rustc::ty::maps::<impl rustc::ty::maps::queries::crate_name<'tcx>>::force
  15: rustc::ty::maps::<impl rustc::ty::maps::queries::crate_name<'tcx>>::try_get
  16: rustc::ty::maps::TyCtxtAt::crate_name
  17: rustc::ty::maps::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'lcx>>::crate_name
  18: rustdoc::clean::inline::record_extern_fqn
  19: rustdoc::clean::register_def
  20: <[syntax::ast::Attribute] as rustdoc::clean::Clean<rustdoc::clean::Attributes>>::clean
  21: <rustdoc::doctree::Struct as rustdoc::clean::Clean<rustdoc::clean::Item>>::clean
  22: <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T, I>>::spec_extend
  23: <rustdoc::doctree::Module as rustdoc::clean::Clean<rustdoc::clean::Item>>::clean
  24: <rustdoc::visit_ast::RustdocVisitor<'a, 'tcx, 'rcx> as rustdoc::clean::Clean<rustdoc::clean::Crate>>::clean
  25: rustdoc::core::run_core::{{closure}}
  26: <std::thread::local::LocalKey<T>>::with
  27: <std::thread::local::LocalKey<T>>::with
  28: rustc::ty::context::TyCtxt::create_and_enter
  29: rustc_driver::driver::phase_3_run_analysis_passes
  30: rustdoc::core::run_core

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.25.0-nightly (3d292b793 2018-02-03) running on x86_64-apple-darwin

This is because resolve_macro returns DefIds containing CrateNum = -1 (cratenum is an unsigned integer, 🤷‍♀️) for syntax extensions

@Manishearth Manishearth 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 Feb 18, 2018
@Manishearth Manishearth self-assigned this Feb 18, 2018
@Manishearth
Copy link
Member Author

@jseyfried FWIW, the debug impl on DefIDs panics when you attempt to run it on BUILTIN_MACROS_CRATE defs.

(also other things panic since they expect the crate number to be normal)

@Manishearth
Copy link
Member Author

This gets fixed in #48335

@pietroalbini pietroalbini added the C-bug Category: This is a bug. label Feb 20, 2018
@bors bors closed this as completed in 5fdc10c Feb 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. 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

2 participants