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: entered unreachable code #100047

Closed
matthiaskrgr opened this issue Aug 2, 2022 · 2 comments · Fixed by #103096
Closed

rustdoc: entered unreachable code #100047

matthiaskrgr opened this issue Aug 2, 2022 · 2 comments · Fixed by #103096
Assignees
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@matthiaskrgr
Copy link
Member

Code

rustdoc src/librustdoc/clean/mod.rs

<code>

Meta

rustc --version --verbose:

rustdoc 1.64.0-nightly (fe3342816 2022-08-01)
binary: rustdoc
commit-hash: fe3342816a282949f014caa05ea2e669ff9d3d3c
commit-date: 2022-08-01
host: x86_64-unknown-linux-gnu
release: 1.64.0-nightly
LLVM version: 14.0.6

rustdoc src/librustdoc/clean/mod.rs

Backtrace

....
error[E0658]: box pattern syntax is experimental
    --> src/librustdoc/clean/types.rs:1616:46
     |
1616 |             Slice(..) | BorrowedRef { type_: box Slice(..), .. } => Some(PrimitiveType::Slice),
     |                                              ^^^^^^^^^^^^^
     |
     = note: see issue #29641 <https://github.com/rust-lang/rust/issues/29641> for more information
     = help: add `#![feature(box_patterns)]` to the crate attributes to enable

error[E0658]: box pattern syntax is experimental
    --> src/librustdoc/clean/types.rs:1617:46
     |
1617 |             Array(..) | BorrowedRef { type_: box Array(..), .. } => Some(PrimitiveType::Array),
     |                                              ^^^^^^^^^^^^^
     |
     = note: see issue #29641 <https://github.com/rust-lang/rust/issues/29641> for more information
     = help: add `#![feature(box_patterns)]` to the crate attributes to enable

error[E0658]: box pattern syntax is experimental
    --> src/librustdoc/clean/types.rs:1674:34
     |
1674 |             BorrowedRef { type_: box Generic(..), .. } => PrimitiveType::Reference,
     |                                  ^^^^^^^^^^^^^^^
     |
     = note: see issue #29641 <https://github.com/rust-lang/rust/issues/29641> for more information
     = help: add `#![feature(box_patterns)]` to the crate attributes to enable

thread 'rustc' panicked at 'internal error: entered unreachable code', compiler/rustc_resolve/src/lib.rs:1912:67
stack backtrace:
   0:     0x7fd188fc8b70 - std::backtrace_rs::backtrace::libunwind::trace::h83eef7e1b99ceac2
                               at /rustc/fe3342816a282949f014caa05ea2e669ff9d3d3c/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   1:     0x7fd188fc8b70 - std::backtrace_rs::backtrace::trace_unsynchronized::h11443e110f08dce7
                               at /rustc/fe3342816a282949f014caa05ea2e669ff9d3d3c/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7fd188fc8b70 - std::sys_common::backtrace::_print_fmt::h98d30f5880b6fe77
                               at /rustc/fe3342816a282949f014caa05ea2e669ff9d3d3c/library/std/src/sys_common/backtrace.rs:66:5
   3:     0x7fd188fc8b70 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hb3fb4cc2aa6407b5
                               at /rustc/fe3342816a282949f014caa05ea2e669ff9d3d3c/library/std/src/sys_common/backtrace.rs:45:22
   4:     0x7fd189023f7c - core::fmt::write::h4e85f46dfec88905
                               at /rustc/fe3342816a282949f014caa05ea2e669ff9d3d3c/library/core/src/fmt/mod.rs:1198:17
   5:     0x7fd188fb9dc5 - std::io::Write::write_fmt::h9357fcb2dba5c229
                               at /rustc/fe3342816a282949f014caa05ea2e669ff9d3d3c/library/std/src/io/mod.rs:1672:15
   6:     0x7fd188fcb841 - std::sys_common::backtrace::_print::h8e18b949553d004a
                               at /rustc/fe3342816a282949f014caa05ea2e669ff9d3d3c/library/std/src/sys_common/backtrace.rs:48:5
   7:     0x7fd188fcb841 - std::sys_common::backtrace::print::h60d8e98dad938672
                               at /rustc/fe3342816a282949f014caa05ea2e669ff9d3d3c/library/std/src/sys_common/backtrace.rs:35:9
   8:     0x7fd188fcb841 - std::panicking::default_hook::{{closure}}::hbe18146ce199bf86
                               at /rustc/fe3342816a282949f014caa05ea2e669ff9d3d3c/library/std/src/panicking.rs:295:22
   9:     0x7fd188fcb513 - std::panicking::default_hook::h1d233b95c05e4774
                               at /rustc/fe3342816a282949f014caa05ea2e669ff9d3d3c/library/std/src/panicking.rs:314:9
  10:     0x7fd18b8480d4 - <rustc_driver[8b04a589e2b44e89]::DEFAULT_HOOK::{closure#0}::{closure#0} as core[cdc6a31a4cbccd39]::ops::function::FnOnce<(&core[cdc6a31a4cbccd39]::panic::panic_info::PanicInfo,)>>::call_once::{shim:vtable#0}
  11:     0x7fd188fcc076 - std::panicking::rust_panic_with_hook::h4bd240a94f5d8396
                               at /rustc/fe3342816a282949f014caa05ea2e669ff9d3d3c/library/std/src/panicking.rs:702:17
  12:     0x7fd188fcbe89 - std::panicking::begin_panic_handler::{{closure}}::hd2974ad90d6aceb2
                               at /rustc/fe3342816a282949f014caa05ea2e669ff9d3d3c/library/std/src/panicking.rs:586:13
  13:     0x7fd188fc9094 - std::sys_common::backtrace::__rust_end_short_backtrace::h47aa8b9750307fbb
                               at /rustc/fe3342816a282949f014caa05ea2e669ff9d3d3c/library/std/src/sys_common/backtrace.rs:138:18
  14:     0x7fd188fcbbf2 - rust_begin_unwind
                               at /rustc/fe3342816a282949f014caa05ea2e669ff9d3d3c/library/std/src/panicking.rs:584:5
  15:     0x7fd189020a53 - core::panicking::panic_fmt::h6e77553746513d00
                               at /rustc/fe3342816a282949f014caa05ea2e669ff9d3d3c/library/core/src/panicking.rs:142:14
  16:     0x7fd18902089d - core::panicking::panic::hdc34fd4df4a7315e
                               at /rustc/fe3342816a282949f014caa05ea2e669ff9d3d3c/library/core/src/panicking.rs:48:5
  17:     0x7fd18bd065df - <rustc_resolve[e35959aaa459184]::Resolver>::resolve_rustdoc_path
  18:     0x564dcf7d50a7 - <rustdoc[30c353d87c1f2e80]::passes::collect_intra_doc_links::early::EarlyDocLinkResolver>::resolve_doc_links
  19:     0x564dcf7d6428 - <rustdoc[30c353d87c1f2e80]::passes::collect_intra_doc_links::early::EarlyDocLinkResolver as rustc_ast[cdfd466c058d0aad]::visit::Visitor>::visit_item
  20:     0x564dcf85bb7a - rustc_ast[cdfd466c058d0aad]::visit::walk_item::<rustdoc[30c353d87c1f2e80]::passes::collect_intra_doc_links::early::EarlyDocLinkResolver>
  21:     0x564dcf7d6504 - <rustdoc[30c353d87c1f2e80]::passes::collect_intra_doc_links::early::EarlyDocLinkResolver as rustc_ast[cdfd466c058d0aad]::visit::Visitor>::visit_item
  22:     0x564dcf858a09 - rustc_ast[cdfd466c058d0aad]::visit::walk_crate::<rustdoc[30c353d87c1f2e80]::passes::collect_intra_doc_links::early::EarlyDocLinkResolver>
  23:     0x564dcf7d21a3 - rustdoc[30c353d87c1f2e80]::passes::collect_intra_doc_links::early::early_resolve_intra_doc_links
  24:     0x564dcf90ac9e - <rustc_interface[507fe53e0572d3d2]::interface::Compiler>::enter::<rustdoc[30c353d87c1f2e80]::main_options::{closure#0}::{closure#0}, core[cdc6a31a4cbccd39]::result::Result<(), rustc_errors[fcb91965fb6576e9]::ErrorGuaranteed>>
  25:     0x564dcfaeb48c - rustc_span[6e576ba6dd4e221]::with_source_map::<core[cdc6a31a4cbccd39]::result::Result<(), rustc_errors[fcb91965fb6576e9]::ErrorGuaranteed>, rustc_interface[507fe53e0572d3d2]::interface::create_compiler_and_run<core[cdc6a31a4cbccd39]::result::Result<(), rustc_errors[fcb91965fb6576e9]::ErrorGuaranteed>, rustdoc[30c353d87c1f2e80]::main_options::{closure#0}>::{closure#1}>
  26:     0x564dcf90cd1b - rustc_interface[507fe53e0572d3d2]::interface::create_compiler_and_run::<core[cdc6a31a4cbccd39]::result::Result<(), rustc_errors[fcb91965fb6576e9]::ErrorGuaranteed>, rustdoc[30c353d87c1f2e80]::main_options::{closure#0}>
  27:     0x564dcf7e2bc2 - rustdoc[30c353d87c1f2e80]::main_options
  28:     0x564dcf98db9c - <scoped_tls[5bea244f1759cc4a]::ScopedKey<rustc_span[6e576ba6dd4e221]::SessionGlobals>>::set::<rustdoc[30c353d87c1f2e80]::main_args::{closure#0}, core[cdc6a31a4cbccd39]::result::Result<(), rustc_errors[fcb91965fb6576e9]::ErrorGuaranteed>>
  29:     0x564dcfa5f49f - std[470ad8214e061e82]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[507fe53e0572d3d2]::util::run_in_thread_pool_with_globals<rustdoc[30c353d87c1f2e80]::main_args::{closure#0}, core[cdc6a31a4cbccd39]::result::Result<(), rustc_errors[fcb91965fb6576e9]::ErrorGuaranteed>>::{closure#0}, core[cdc6a31a4cbccd39]::result::Result<(), rustc_errors[fcb91965fb6576e9]::ErrorGuaranteed>>
  30:     0x564dcf9409e9 - <<std[470ad8214e061e82]::thread::Builder>::spawn_unchecked_<rustc_interface[507fe53e0572d3d2]::util::run_in_thread_pool_with_globals<rustdoc[30c353d87c1f2e80]::main_args::{closure#0}, core[cdc6a31a4cbccd39]::result::Result<(), rustc_errors[fcb91965fb6576e9]::ErrorGuaranteed>>::{closure#0}, core[cdc6a31a4cbccd39]::result::Result<(), rustc_errors[fcb91965fb6576e9]::ErrorGuaranteed>>::{closure#1} as core[cdc6a31a4cbccd39]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  31:     0x7fd188fd5cb3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hd91dcbcc80c66aa0
                               at /rustc/fe3342816a282949f014caa05ea2e669ff9d3d3c/library/alloc/src/boxed.rs:1935:9
  32:     0x7fd188fd5cb3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h36fdba9d16140431
                               at /rustc/fe3342816a282949f014caa05ea2e669ff9d3d3c/library/alloc/src/boxed.rs:1935:9
  33:     0x7fd188fd5cb3 - std::sys::unix::thread::Thread::new::thread_start::h3bd76bb7cb4b4d75
                               at /rustc/fe3342816a282949f014caa05ea2e669ff9d3d3c/library/std/src/sys/unix/thread.rs:108:17
  34:     0x7fd188ced54d - <unknown>
  35:     0x7fd188d72874 - clone
  36:                0x0 - <unknown>

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/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.64.0-nightly (fe3342816 2022-08-01) running on x86_64-unknown-linux-gnu

query stack during panic:
end of query stack
error: aborting due to 191 previous errors

Some errors have detailed explanations: E0432, E0433, E0658, E0659.
For more information about an error, try `rustc --explain E0432`.

@matthiaskrgr matthiaskrgr 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) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. C-bug Category: This is a bug. labels Aug 2, 2022
@matthiaskrgr
Copy link
Member Author

tried to reduce a bit 🤔

mod auto_trait;
pub(crate) mod types;
use rustc_middle::ty::{self};
pub(crate) use self::types::*;

@petrochenkov
Copy link
Contributor

Fixed in #103096.

@bors bors closed this as completed in 1536ab1 Oct 17, 2022
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-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants