Skip to content

rustdoc ICE: entered unreachable code on hidden tuple item #88600

Closed

Description

@Emilgardis

Code

pub enum Foo {
    Test(#[doc(hidden)] Option<()>),
}

panics when running cargo doc. This seems to come from

.map(|f| if let clean::StructFieldItem(ref ty) = *f.kind { ty } else { unreachable!() })

cc #88391

Meta

rustc --version --verbose:

rustc 1.56.0-nightly (50171c310 2021-09-01)
binary: rustc
commit-hash: 50171c310cd15e1b2d3723766ce64e2e4d6696fc
commit-date: 2021-09-01
host: x86_64-pc-windows-msvc
release: 1.56.0-nightly
LLVM version: 13.0.0

Error output

cargo doc --no-deps      
 Documenting hidden v0.1.0-rc.1 (G:\workspace\small dev space\test_crate-version)
thread 'rustc' panicked at 'internal error: entered unreachable code', src\librustdoc\html\render\print_item.rs:943:80
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

error: internal compiler error: unexpected panic

error: Unrecognized option: 'crate-version'

error: could not document `hidden`

Caused by:
  process didn't exit successfully: `rustdoc --edition=2018 --crate-type lib --crate-name hidden src\lib.rs -o "G:\workspace\small dev space\test_crate-version\target\doc" --error-format=json --json=diagnostic-rendered-ansi -L "dependency=G:\workspace\small dev space\test_crate-version\target\debug\deps" --crate-version 0.1.0-rc.1` (exit code: 1)
Backtrace

thread 'rustc' panicked at 'internal error: entered unreachable code', src\librustdoc\html\render\print_item.rs:943:80
stack backtrace:
   0:     0x7ff80a64801e - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h97844c02df23ebf1
   1:     0x7ff80a6728da - core::fmt::write::h7e004fee938dc3bd
   2:     0x7ff80a63b388 - <std::io::IoSlice as core::fmt::Debug>::fmt::h34e482c524fdd2ee
   3:     0x7ff80a64bab6 - std::panicking::take_hook::hd051283b0b015437
   4:     0x7ff80a64b5c8 - std::panicking::take_hook::hd051283b0b015437
   5:     0x7ff80390ad95 - <md5::Md5 as std::io::Write>::flush::h7054a9d890538508
   6:     0x7ff80a64c3b0 - std::panicking::rust_panic_with_hook::h1dfae7c828339eef
   7:     0x7ff80a64be3f - rust_begin_unwind
   8:     0x7ff80a648947 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h97844c02df23ebf1
   9:     0x7ff80a64bdc9 - rust_begin_unwind
  10:     0x7ff80a6a8980 - core::panicking::panic_fmt::hec18c52ab5ec8c2e
  11:     0x7ff80a6a88cc - core::panicking::panic::h5cccc34aab9ab48d
  12:     0x7ff707957d6c - <unknown>
  13:     0x7ff70794a0b7 - <unknown>
  14:     0x7ff70793c43f - <unknown>
  15:     0x7ff707947276 - <unknown>
  16:     0x7ff707a41406 - <unknown>
  17:     0x7ff70785ede5 - <unknown>
  18:     0x7ff70797661a - <unknown>
  19:     0x7ff70789aab3 - <unknown>
  20:     0x7ff70796e8f4 - <unknown>
  21:     0x7ff70789cf3a - <unknown>
  22:     0x7ff70789363a - <unknown>
  23:     0x7ff7079e6296 - <unknown>
  24:     0x7ff707978de8 - <unknown>
  25:     0x7ff70791d68d - <unknown>
  26:     0x7ff80a65a64c - std::sys::windows::thread::Thread::new::h4e02b30388f9fde7
  27:     0x7ff8dec054e0 - BaseThreadInitThunk
  28:     0x7ff8dfa2485b - RtlUserThreadStart

Activity

  1. added
    C-bugCategory: This is a bug.
    I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    on Sep 2, 2021
  2. changed the title [-]rustdoc ICE: entered unreachable code[/-] [+]rustdoc ICE: entered unreachable code on hidden tuple item[/+] on Sep 2, 2021
  3. added
    T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.
    and removed
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    on Sep 5, 2021
  4. added
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    on Sep 5, 2021
  5. jyn514 commented on Sep 5, 2021

    @jyn514
    Member

    @Emilgardis what is that attribute intended to do? Enum fields are always public.

  6. Emilgardis commented on Sep 5, 2021

    @Emilgardis
    ContributorAuthor

    I wanted to hide the field from docs because it was not important. But I agree it's probably a bit strange.

  7. added this to the 1.56.0 milestone on Sep 5, 2021
  8. added
    P-highHigh priority
    and removed
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    on Sep 5, 2021
  9. camelid commented on Sep 5, 2021

    @camelid
    Member

    Assigning priority as discussed in the prioritization working group.

  10. added a commit that references this issue on Sep 9, 2021
    fa7834a
  11. added a commit that references this issue on Sep 10, 2021
    0438048
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-highHigh priorityT-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions