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 panics when some unstable features is used without #![feature(…)] #36159

Closed
kennytm opened this issue Aug 31, 2016 · 0 comments
Closed
Labels
T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@kennytm
Copy link
Member

kennytm commented Aug 31, 2016

(May be same as #31647?)

With the source:

#[b] struct S;

Running rustdoc 1.rs gives the error:

error: The attribute `b` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642)
 --> 1.rs:1:1
  |
1 | #[b]
  | ^^^^
  |
  = help: add #![feature(custom_attribute)] to the crate attributes to enable

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: run with `RUST_BACKTRACE=1` for a backtrace

thread 'rustc' panicked at 'phase_2_configure_and_expand aborted in rustdoc!: 1', ../src/libcore/result.rs:783
stack backtrace:
   1:        0x10901be0a - std::sys::backtrace::tracing::imp::write::h46f28e67d38b4637
   2:        0x10902a5cf - std::panicking::default_hook::{{closure}}::h1d3243f546573ff4
   3:        0x109028bcd - std::panicking::default_hook::h96c288d728df3ebf
   4:        0x109029266 - std::panicking::rust_panic_with_hook::hb1322e5f2588b4db
   5:        0x109029104 - std::panicking::begin_panic::hfbeda5aad583dc32
   6:        0x109029022 - std::panicking::begin_panic_fmt::h4fe9fb9d5109c4bf
   7:        0x109028f87 - rust_begin_unwind
   8:        0x109088e50 - core::panicking::panic_fmt::h4395919ece15c671
   9:        0x104989912 - core::result::unwrap_failed::h7169715daa6d1b4b
  10:        0x104a57626 - rustdoc::core::run_core::h3ae16d38e236204c
  11:        0x104981826 - std::panicking::try::do_call::h3d5952fa0eca5ef1
  12:        0x1090311aa - __rust_maybe_catch_panic
  13:        0x1049a7e36 - <F as alloc::boxed::FnBox<A>>::call_box::ha55f7783d6f9e562
  14:        0x109027a44 - std::sys::thread::Thread::new::thread_start::h5b631f48cd23f128
  15:     0x7fff92d3499c - _pthread_body
  16:     0x7fff92d34919 - _pthread_start

Similar for other features like:

  • fn main() { Ok(())?; }
  • fn main() { box 1; }
  • const fn f() {}
  • #[structural_match] struct S;
  • #![no_core]
  • #[naked] fn a() {}
  • #[start] fn start() {}
  • fn b() { 1: i32; }
  • fn b() { let a: ! = 0; }
  • fn a() { 1...2; }
  • trait T { type A = i32; }
  • trait T { const a: i32; }
  • trait T {} impl T for .. {}
  • fn á() {}
  • extern "rust-intrinsic" fn a() {}

But some features are fine (won't panic):

  • unsafe fn main() { std::intrinsics::ctpop(1); } // and other library features
  • fn main() { asm!(""); }
  • #![cfg(target_feature="simd")]
  • fn a() { concat_idents!(a); }

Repro on both stable and nightly (1.11 – 1.13).

@Aatch Aatch added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Aug 31, 2016
bors added a commit that referenced this issue Jan 4, 2017
Avoid rustdoc ICE when an unstable feature is used

Fix #36159.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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