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

ICE: rustdoc: -Znormalize-docs #105742

Closed
matthiaskrgr opened this issue Dec 15, 2022 · 0 comments · Fixed by #106366
Closed

ICE: rustdoc: -Znormalize-docs #105742

matthiaskrgr opened this issue Dec 15, 2022 · 0 comments · Fixed by #106366
Labels
-Znormalize-docs Unstable rustdoc option: Normalize/evaluate types when generating docs C-bug Category: This is a bug. glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-nightly This issue requires a nightly compiler in some way. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@matthiaskrgr
Copy link
Member

Code

use std::ops::Index;

fn next<'a, T>(s: &'a mut dyn SVec<Item = T, Output = T>) {
    let _ = s;
}

trait SVec: Index<<Self as SVec>::Item, Output = <Index<<Self as SVec>::Item, Output = <Self as SVec>::Item> as SVec>::Item> {
    type Item<'a, T>;

    fn len(&self) -> <Self as SVec>::Item;
}

fn main() {}

Meta

rustc --version --verbose:

rustdoc 1.68.0-nightly (b70baa4f9 2022-12-14)
binary: rustdoc
commit-hash: unknown
commit-date: unknown
host: x86_64-unknown-linux-gnu
release: 1.68.0-nightly
LLVM version: 15.0.6

Error output

rustdoc -Znormalize-docs <file>

  --> ./ab56d8d51ecb5f8e40a09324749c855b37ee387e.rs:13:35
   |
13 | trait SVec: Index<<Self as SVec>::Item, Output = <Index<<Self as SVec>::Item, Output = <Self as SVec>::Item> as SVec>::Item> {
   |                                   ^^^^ expected 1 lifetime argument
   |
note: associated type defined here, with 1 lifetime parameter: `'a`
  --> ./ab56d8d51ecb5f8e40a09324749c855b37ee387e.rs:14:10
   |
14 |     type Item<'a, T>;
   |          ^^^^ --
help: add missing lifetime argument
   |
13 | trait SVec: Index<<Self as SVec>::Item<'a>, Output = <Index<<Self as SVec>::Item, Output = <Self as SVec>::Item> as SVec>::Item> {
   |                                   ~~~~~~~~

error[E0107]: missing generics for associated type `SVec::Item`
  --> ./ab56d8d51ecb5f8e40a09324749c855b37ee387e.rs:13:35
   |
13 | trait SVec: Index<<Self as SVec>::Item, Output = <Index<<Self as SVec>::Item, Output = <Self as SVec>::Item> as SVec>::Item> {
   |                                   ^^^^ expected 1 generic argument
   |
note: associated type defined here, with 1 generic parameter: `T`
  --> ./ab56d8d51ecb5f8e40a09324749c855b37ee387e.rs:14:10
   |
14 |     type Item<'a, T>;
   |          ^^^^     -
help: add missing generic argument
   |
13 | trait SVec: Index<<Self as SVec>::Item<T>, Output = <Index<<Self as SVec>::Item, Output = <Self as SVec>::Item> as SVec>::Item> {
   |                                   ~~~~~~~

error[E0107]: missing generics for associated type `SVec::Item`
  --> ./ab56d8d51ecb5f8e40a09324749c855b37ee387e.rs:13:73
   |
13 | trait SVec: Index<<Self as SVec>::Item, Output = <Index<<Self as SVec>::Item, Output = <Self as SVec>::Item> as SVec>::Item> {
   |                                                                         ^^^^ expected 1 lifetime argument
   |
note: associated type defined here, with 1 lifetime parameter: `'a`
  --> ./ab56d8d51ecb5f8e40a09324749c855b37ee387e.rs:14:10
   |
14 |     type Item<'a, T>;
   |          ^^^^ --
help: add missing lifetime argument
   |
13 | trait SVec: Index<<Self as SVec>::Item, Output = <Index<<Self as SVec>::Item<'a>, Output = <Self as SVec>::Item> as SVec>::Item> {
   |                                                                         ~~~~~~~~

error[E0107]: missing generics for associated type `SVec::Item`
  --> ./ab56d8d51ecb5f8e40a09324749c855b37ee387e.rs:13:73
   |
13 | trait SVec: Index<<Self as SVec>::Item, Output = <Index<<Self as SVec>::Item, Output = <Self as SVec>::Item> as SVec>::Item> {
   |                                                                         ^^^^ expected 1 generic argument
   |
note: associated type defined here, with 1 generic parameter: `T`
  --> ./ab56d8d51ecb5f8e40a09324749c855b37ee387e.rs:14:10
   |
14 |     type Item<'a, T>;
   |          ^^^^     -
help: add missing generic argument
   |
13 | trait SVec: Index<<Self as SVec>::Item, Output = <Index<<Self as SVec>::Item<T>, Output = <Self as SVec>::Item> as SVec>::Item> {
   |                                                                         ~~~~~~~

error[E0107]: missing generics for associated type `SVec::Item`
  --> ./ab56d8d51ecb5f8e40a09324749c855b37ee387e.rs:13:104
   |
13 | trait SVec: Index<<Self as SVec>::Item, Output = <Index<<Self as SVec>::Item, Output = <Self as SVec>::Item> as SVec>::Item> {
   |                                                                                                        ^^^^ expected 1 lifetime argument
   |
note: associated type defined here, with 1 lifetime parameter: `'a`
  --> ./ab56d8d51ecb5f8e40a09324749c855b37ee387e.rs:14:10
   |
14 |     type Item<'a, T>;
   |          ^^^^ --
help: add missing lifetime argument
   |
13 | trait SVec: Index<<Self as SVec>::Item, Output = <Index<<Self as SVec>::Item, Output = <Self as SVec>::Item<'a>> as SVec>::Item> {
   |                                                                                                        ~~~~~~~~

error[E0107]: missing generics for associated type `SVec::Item`
  --> ./ab56d8d51ecb5f8e40a09324749c855b37ee387e.rs:13:104
   |
13 | trait SVec: Index<<Self as SVec>::Item, Output = <Index<<Self as SVec>::Item, Output = <Self as SVec>::Item> as SVec>::Item> {
   |                                                                                                        ^^^^ expected 1 generic argument
   |
note: associated type defined here, with 1 generic parameter: `T`
  --> ./ab56d8d51ecb5f8e40a09324749c855b37ee387e.rs:14:10
   |
14 |     type Item<'a, T>;
   |          ^^^^     -
help: add missing generic argument
   |
13 | trait SVec: Index<<Self as SVec>::Item, Output = <Index<<Self as SVec>::Item, Output = <Self as SVec>::Item<T>> as SVec>::Item> {
   |                                                                                                        ~~~~~~~

error[E0107]: missing generics for associated type `SVec::Item`
  --> ./ab56d8d51ecb5f8e40a09324749c855b37ee387e.rs:13:120
   |
13 | trait SVec: Index<<Self as SVec>::Item, Output = <Index<<Self as SVec>::Item, Output = <Self as SVec>::Item> as SVec>::Item> {
   |                                                                                                                        ^^^^ expected 1 lifetime argument
   |
note: associated type defined here, with 1 lifetime parameter: `'a`
  --> ./ab56d8d51ecb5f8e40a09324749c855b37ee387e.rs:14:10
   |
14 |     type Item<'a, T>;
   |          ^^^^ --
help: add missing lifetime argument
   |
13 | trait SVec: Index<<Self as SVec>::Item, Output = <Index<<Self as SVec>::Item, Output = <Self as SVec>::Item> as SVec>::Item<'a>> {
   |                                                                                                                        ~~~~~~~~

error[E0107]: missing generics for associated type `SVec::Item`
  --> ./ab56d8d51ecb5f8e40a09324749c855b37ee387e.rs:13:120
   |
13 | trait SVec: Index<<Self as SVec>::Item, Output = <Index<<Self as SVec>::Item, Output = <Self as SVec>::Item> as SVec>::Item> {
   |                                                                                                                        ^^^^ expected 1 generic argument
   |
note: associated type defined here, with 1 generic parameter: `T`
  --> ./ab56d8d51ecb5f8e40a09324749c855b37ee387e.rs:14:10
   |
14 |     type Item<'a, T>;
   |          ^^^^     -
help: add missing generic argument
   |
13 | trait SVec: Index<<Self as SVec>::Item, Output = <Index<<Self as SVec>::Item, Output = <Self as SVec>::Item> as SVec>::Item<T>> {
   |                                                                                                                        ~~~~~~~

error[E0107]: missing generics for associated type `SVec::Item`
  --> ./ab56d8d51ecb5f8e40a09324749c855b37ee387e.rs:16:38
   |
16 |     fn len(&self) -> <Self as SVec>::Item;
   |                                      ^^^^ expected 1 lifetime argument
   |
note: associated type defined here, with 1 lifetime parameter: `'a`
  --> ./ab56d8d51ecb5f8e40a09324749c855b37ee387e.rs:14:10
   |
14 |     type Item<'a, T>;
   |          ^^^^ --
help: add missing lifetime argument
   |
16 |     fn len(&self) -> <Self as SVec>::Item<'_>;
   |                                      ~~~~~~~~

error[E0107]: missing generics for associated type `SVec::Item`
  --> ./ab56d8d51ecb5f8e40a09324749c855b37ee387e.rs:16:38
   |
16 |     fn len(&self) -> <Self as SVec>::Item;
   |                                      ^^^^ expected 1 generic argument
   |
note: associated type defined here, with 1 generic parameter: `T`
  --> ./ab56d8d51ecb5f8e40a09324749c855b37ee387e.rs:14:10
   |
14 |     type Item<'a, T>;
   |          ^^^^     -
help: add missing generic argument
   |
16 |     fn len(&self) -> <Self as SVec>::Item<T>;
   |                                      ~~~~~~~
Backtrace

thread 'rustc' panicked at 'Error', src/librustdoc/clean/mod.rs:1856:25
stack backtrace:
   0:     0x7f2b3af657da - std::backtrace_rs::backtrace::libunwind::trace::h58c649c53097142b
                               at /rustc/b70baa4f922a1809d79caeaeb902800c3be283b9/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f2b3af657da - std::backtrace_rs::backtrace::trace_unsynchronized::h8a2218341115550a
                               at /rustc/b70baa4f922a1809d79caeaeb902800c3be283b9/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f2b3af657da - std::sys_common::backtrace::_print_fmt::hea4b2f7f6d570ca4
                               at /rustc/b70baa4f922a1809d79caeaeb902800c3be283b9/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7f2b3af657da - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h8d8d34f4e85c6a60
                               at /rustc/b70baa4f922a1809d79caeaeb902800c3be283b9/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f2b3afc82ee - core::fmt::write::haf2065fc0d3659f4
                               at /rustc/b70baa4f922a1809d79caeaeb902800c3be283b9/library/core/src/fmt/mod.rs:1208:17
   5:     0x7f2b3af55b65 - std::io::Write::write_fmt::h6dce18c304ee54a2
                               at /rustc/b70baa4f922a1809d79caeaeb902800c3be283b9/library/std/src/io/mod.rs:1682:15
   6:     0x7f2b3af655a5 - std::sys_common::backtrace::_print::hec602170f4d3e048
                               at /rustc/b70baa4f922a1809d79caeaeb902800c3be283b9/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x7f2b3af655a5 - std::sys_common::backtrace::print::h8aa4a47604c83c88
                               at /rustc/b70baa4f922a1809d79caeaeb902800c3be283b9/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x7f2b3af682ef - std::panicking::default_hook::{{closure}}::h68a2f001ac3644c4
                               at /rustc/b70baa4f922a1809d79caeaeb902800c3be283b9/library/std/src/panicking.rs:267:22
   9:     0x7f2b3af6802b - std::panicking::default_hook::h4861c4cf633cd613
                               at /rustc/b70baa4f922a1809d79caeaeb902800c3be283b9/library/std/src/panicking.rs:286:9
  10:     0x7f2b3af68b0c - std::panicking::rust_panic_with_hook::h404216ffd42d1a9f
                               at /rustc/b70baa4f922a1809d79caeaeb902800c3be283b9/library/std/src/panicking.rs:688:13
  11:     0x7f2b3af68862 - std::panicking::begin_panic_handler::{{closure}}::hbfc6e95ed3b74164
                               at /rustc/b70baa4f922a1809d79caeaeb902800c3be283b9/library/std/src/panicking.rs:577:13
  12:     0x7f2b3af65c8c - std::sys_common::backtrace::__rust_end_short_backtrace::h6c2b4fdde46f911c
                               at /rustc/b70baa4f922a1809d79caeaeb902800c3be283b9/library/std/src/sys_common/backtrace.rs:137:18
  13:     0x7f2b3af685b2 - rust_begin_unwind
                               at /rustc/b70baa4f922a1809d79caeaeb902800c3be283b9/library/std/src/panicking.rs:575:5
  14:     0x7f2b3afc4cd3 - core::panicking::panic_fmt::h52720972d063b41a
                               at /rustc/b70baa4f922a1809d79caeaeb902800c3be283b9/library/core/src/panicking.rs:64:14
  15:     0x55f3756375ff - rustdoc[f79df397caf8daff]::clean::clean_middle_ty
  16:     0x55f37561307c - rustdoc[f79df397caf8daff]::clean::clean_ty
  17:     0x55f375318cf0 - rustdoc[f79df397caf8daff]::clean::utils::enter_impl_trait::<rustdoc[f79df397caf8daff]::clean::clean_function::{closure#0}, (rustdoc[f79df397caf8daff]::clean::types::Generics, rustdoc[f79df397caf8daff]::clean::types::FnDecl)>
  18:     0x55f3755360f0 - <rustdoc[f79df397caf8daff]::core::DocContext>::with_param_env::<rustdoc[f79df397caf8daff]::clean::types::Item, rustdoc[f79df397caf8daff]::clean::clean_trait_item::{closure#0}>
  19:     0x55f375411085 - <alloc[51c757b3bc4bb1d4]::vec::Vec<rustdoc[f79df397caf8daff]::clean::types::Item> as alloc[51c757b3bc4bb1d4]::vec::spec_from_iter::SpecFromIter<rustdoc[f79df397caf8daff]::clean::types::Item, core[a183604df3a39924]::iter::adapters::map::Map<core[a183604df3a39924]::slice::iter::Iter<rustc_hir[23c7b9dd50e700e0]::hir::TraitItemRef>, rustdoc[f79df397caf8daff]::clean::clean_maybe_renamed_item::{closure#1}::{closure#5}>>>::from_iter
  20:     0x55f37553448d - <rustdoc[f79df397caf8daff]::core::DocContext>::with_param_env::<alloc[51c757b3bc4bb1d4]::vec::Vec<rustdoc[f79df397caf8daff]::clean::types::Item>, rustdoc[f79df397caf8daff]::clean::clean_maybe_renamed_item::{closure#1}>
  21:     0x55f3756005cc - <&mut rustdoc[f79df397caf8daff]::clean::clean_doc_module::{closure#2} as core[a183604df3a39924]::ops::function::FnOnce<(&(&rustc_hir[23c7b9dd50e700e0]::hir::Item, core[a183604df3a39924]::option::Option<rustc_span[8d98255f5ee7a7e8]::symbol::Symbol>, core[a183604df3a39924]::option::Option<rustc_hir[23c7b9dd50e700e0]::hir_id::HirId>),)>>::call_once
  22:     0x55f3754039d4 - <alloc[51c757b3bc4bb1d4]::vec::Vec<rustdoc[f79df397caf8daff]::clean::types::Item> as alloc[51c757b3bc4bb1d4]::vec::spec_extend::SpecExtend<rustdoc[f79df397caf8daff]::clean::types::Item, core[a183604df3a39924]::iter::adapters::flatten::FlatMap<core[a183604df3a39924]::slice::iter::Iter<(&rustc_hir[23c7b9dd50e700e0]::hir::Item, core[a183604df3a39924]::option::Option<rustc_span[8d98255f5ee7a7e8]::symbol::Symbol>, core[a183604df3a39924]::option::Option<rustc_hir[23c7b9dd50e700e0]::hir_id::HirId>)>, alloc[51c757b3bc4bb1d4]::vec::Vec<rustdoc[f79df397caf8daff]::clean::types::Item>, rustdoc[f79df397caf8daff]::clean::clean_doc_module::{closure#2}>>>::spec_extend
  23:     0x55f3756073c2 - rustdoc[f79df397caf8daff]::clean::clean_doc_module
  24:     0x55f375314dc1 - rustdoc[f79df397caf8daff]::clean::utils::krate
  25:     0x55f3754c74d4 - <rustc_session[f809e505f670defe]::session::Session>::time::<rustdoc[f79df397caf8daff]::clean::types::Crate, rustdoc[f79df397caf8daff]::core::run_global_ctxt::{closure#4}>
  26:     0x55f375539547 - rustdoc[f79df397caf8daff]::core::run_global_ctxt
  27:     0x55f3754c8954 - <rustc_interface[59cd32f5a8db8a5b]::passes::QueryContext>::enter::<rustdoc[f79df397caf8daff]::main_args::{closure#1}::{closure#0}::{closure#1}, core[a183604df3a39924]::result::Result<(), rustc_errors[646af11ffc335ad2]::ErrorGuaranteed>>
  28:     0x55f3753895fa - <rustc_interface[59cd32f5a8db8a5b]::interface::Compiler>::enter::<rustdoc[f79df397caf8daff]::main_args::{closure#1}::{closure#0}, core[a183604df3a39924]::result::Result<(), rustc_errors[646af11ffc335ad2]::ErrorGuaranteed>>
  29:     0x55f375460b3a - rustc_span[8d98255f5ee7a7e8]::with_source_map::<core[a183604df3a39924]::result::Result<(), rustc_errors[646af11ffc335ad2]::ErrorGuaranteed>, rustc_interface[59cd32f5a8db8a5b]::interface::run_compiler<core[a183604df3a39924]::result::Result<(), rustc_errors[646af11ffc335ad2]::ErrorGuaranteed>, rustdoc[f79df397caf8daff]::main_args::{closure#1}>::{closure#0}::{closure#0}>
  30:     0x55f3752ef795 - <scoped_tls[d2f689311b6a895]::ScopedKey<rustc_span[8d98255f5ee7a7e8]::SessionGlobals>>::set::<rustc_interface[59cd32f5a8db8a5b]::interface::run_compiler<core[a183604df3a39924]::result::Result<(), rustc_errors[646af11ffc335ad2]::ErrorGuaranteed>, rustdoc[f79df397caf8daff]::main_args::{closure#1}>::{closure#0}, core[a183604df3a39924]::result::Result<(), rustc_errors[646af11ffc335ad2]::ErrorGuaranteed>>
  31:     0x55f3754738a0 - std[f8e68897caeb81ab]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[59cd32f5a8db8a5b]::util::run_in_thread_pool_with_globals<rustc_interface[59cd32f5a8db8a5b]::interface::run_compiler<core[a183604df3a39924]::result::Result<(), rustc_errors[646af11ffc335ad2]::ErrorGuaranteed>, rustdoc[f79df397caf8daff]::main_args::{closure#1}>::{closure#0}, core[a183604df3a39924]::result::Result<(), rustc_errors[646af11ffc335ad2]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[a183604df3a39924]::result::Result<(), rustc_errors[646af11ffc335ad2]::ErrorGuaranteed>>
  32:     0x55f3755fd02f - <<std[f8e68897caeb81ab]::thread::Builder>::spawn_unchecked_<rustc_interface[59cd32f5a8db8a5b]::util::run_in_thread_pool_with_globals<rustc_interface[59cd32f5a8db8a5b]::interface::run_compiler<core[a183604df3a39924]::result::Result<(), rustc_errors[646af11ffc335ad2]::ErrorGuaranteed>, rustdoc[f79df397caf8daff]::main_args::{closure#1}>::{closure#0}, core[a183604df3a39924]::result::Result<(), rustc_errors[646af11ffc335ad2]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[a183604df3a39924]::result::Result<(), rustc_errors[646af11ffc335ad2]::ErrorGuaranteed>>::{closure#1} as core[a183604df3a39924]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  33:     0x7f2b3af72903 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hefb6b2db81441f4e
                               at /rustc/b70baa4f922a1809d79caeaeb902800c3be283b9/library/alloc/src/boxed.rs:2000:9
  34:     0x7f2b3af72903 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h27d69019d3964068
                               at /rustc/b70baa4f922a1809d79caeaeb902800c3be283b9/library/alloc/src/boxed.rs:2000:9
  35:     0x7f2b3af72903 - std::sys::unix::thread::Thread::new::thread_start::hed02738834385cbc
                               at /rustc/b70baa4f922a1809d79caeaeb902800c3be283b9/library/std/src/sys/unix/thread.rs:108:17
  36:     0x7f2b3ad058fd - <unknown>
  37:     0x7f2b3ad87a60 - <unknown>
  38:                0x0 - <unknown>
error: aborting due to 10 previous errors

@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) ❄️ C-bug Category: This is a bug. requires-nightly This issue requires a nightly compiler in some way. labels Dec 15, 2022
@jyn514 jyn514 added the -Znormalize-docs Unstable rustdoc option: Normalize/evaluate types when generating docs label Dec 16, 2022
@rust-lang-glacier-bot rust-lang-glacier-bot added the glacier ICE tracked in rust-lang/glacier. label Dec 22, 2022
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Jan 2, 2023
@bors bors closed this as completed in ea3c4d8 Jan 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
-Znormalize-docs Unstable rustdoc option: Normalize/evaluate types when generating docs C-bug Category: This is a bug. glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-nightly This issue requires a nightly compiler in some way. 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.

3 participants