Repository: rust
Issue: cargo doc for diesel triggers debug_assertion in can_elide_generic_arg`
Labels: T-rustdoc,C-bug

running rustdoc for diesel master (https://github.com/diesel-rs/diesel/commit/8939fce6651a79433d3cdc7ec69e9ec9aaafea1c) with `debug_assertions` enabled triggers an ICE

```
 Documenting diesel v2.2.4 (/home/lcnr/diesel/diesel)
thread 'rustc' panicked at src/librustdoc/clean/utils.rs:162:5:
assertion `left matches right` failed
  left: (Lifetime('query/#0), Type(connection::DefaultLoadingMode))
 right: (ty::GenericArgKind::Lifetime(_), ty::GenericArgKind::Lifetime(_)) |
(ty::GenericArgKind::Type(_), ty::GenericArgKind::Type(_)) |
(ty::GenericArgKind::Const(_), ty::GenericArgKind::Const(_))
```

backtrace

<details>

``` bash
lcnr@lcnrPC:~/diesel$ cargo +stage2 doc --manifest-path diesel/Cargo.toml --no-deps --no-default-features
   Compiling proc-macro2 v1.0.92
   Compiling unicode-ident v1.0.14
   Compiling fnv v1.0.7
   Compiling ident_case v1.0.1
   Compiling strsim v0.11.1
   Compiling either v1.13.0
   Compiling heck v0.5.0
    Checking downcast-rs v1.2.1
   Compiling quote v1.0.37
   Compiling syn v2.0.89
   Compiling darling_core v0.20.10
   Compiling diesel_table_macro_syntax v0.2.0 (/home/lcnr/diesel/diesel_table_macro_syntax)
   Compiling darling_macro v0.20.10
   Compiling darling v0.20.10
   Compiling dsl_auto_type v0.1.0 (/home/lcnr/diesel/dsl_auto_type)
   Compiling diesel_derives v2.2.0 (/home/lcnr/diesel/diesel_derives)
 Documenting diesel v2.2.4 (/home/lcnr/diesel/diesel)
thread 'rustc' panicked at src/librustdoc/clean/utils.rs:162:5:
assertion `left matches right` failed
  left: (Lifetime('query/#0), Type(connection::DefaultLoadingMode))
 right: (ty::GenericArgKind::Lifetime(_), ty::GenericArgKind::Lifetime(_)) |
(ty::GenericArgKind::Type(_), ty::GenericArgKind::Type(_)) |
(ty::GenericArgKind::Const(_), ty::GenericArgKind::Const(_))
stack backtrace:
   0:     0x7f28b96933e1 - trace
                               at /home/lcnr/rust3/library/std/src/../../backtrace/src/backtrace/libunwind.rs:116:5
   1:     0x7f28b96933e1 - trace_unsynchronized<std::sys::backtrace::_print_fmt::{closure_env#1}>
                               at /home/lcnr/rust3/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f28b96933e1 - _print_fmt
                               at /home/lcnr/rust3/library/std/src/sys/backtrace.rs:66:9
   3:     0x7f28b96933e1 - fmt
                               at /home/lcnr/rust3/library/std/src/sys/backtrace.rs:39:26
   4:     0x7f28b9739983 - fmt
                               at /home/lcnr/rust3/library/core/src/fmt/rt.rs:177:76
   5:     0x7f28b9739983 - write
                               at /home/lcnr/rust3/library/core/src/fmt/mod.rs:1189:21
   6:     0x7f28b96a5d79 - write_fmt<std::sys::pal::unix::stdio::Stderr>
                               at /home/lcnr/rust3/library/std/src/io/mod.rs:1887:15
   7:     0x7f28b9693283 - print
                               at /home/lcnr/rust3/library/std/src/sys/backtrace.rs:42:9
   8:     0x7f28b96e669e - {closure#1}
   9:     0x7f28b96e6473 - default_hook
                               at /home/lcnr/rust3/library/std/src/panicking.rs:311:9
  10:     0x7f28b568bbde - {closure#0}
                               at /home/lcnr/rust3/compiler/rustc_driver_impl/src/lib.rs:1429:17
  11:     0x7f28b568bbde - call<(&(dyn core::ops::function::Fn<(&std::panic::PanicHookInfo), Output=()> + core::marker::Send + core::marker::Sync), &std::panic::PanicHookInfo), rustc_driver_impl::install_ice_hook::{closure_env#0}, alloc::alloc::Global>
                               at /home/lcnr/rust3/library/alloc/src/boxed.rs:1986:9
  12:     0x7f28b96e6e9f - rust_panic_with_hook
                               at /home/lcnr/rust3/library/std/src/panicking.rs:825:13
  13:     0x7f28b969389c - {closure#0}
                               at /home/lcnr/rust3/library/std/src/panicking.rs:690:13
  14:     0x7f28b96935e9 - std::sys::backtrace::__rust_end_short_backtrace::ha8d371277671dcc0
                               at /home/lcnr/rust3/library/std/src/sys/backtrace.rs:170:18
  15:     0x7f28b96e678d - begin_panic_handler
                               at /home/lcnr/rust3/library/std/src/panicking.rs:681:5
  16:     0x7f28b9741f20 - panic_fmt
                               at /home/lcnr/rust3/library/core/src/panicking.rs:76:14
  17:     0x7f28b9742491 - assert_failed_inner
  18:     0x618960cd9836 - core[31c131443582fd6c]::panicking::assert_matches_failed::<(rustc_type_ir[c0a93252c9596940]::generic_arg::GenericArgKind<rustc_middle[7864bb30f132c2cd]::ty::context::TyCtxt>, rustc_type_ir[c0a93252c9596940]::generic_arg::GenericArgKind<rustc_middle[7864bb30f132c2cd]::ty::context::TyCtxt>)>
                               at /home/lcnr/rust3/library/core/src/panicking.rs:393:5
  19:     0x618960aa7e85 - can_elide_generic_arg
                               at /home/lcnr/rust3/src/librustdoc/clean/utils.rs:162:5
  20:     0x618960aa7e85 - {closure#0}
                               at /home/lcnr/rust3/src/librustdoc/clean/utils.rs:120:16
  21:     0x618960aa7e85 - call_mut<((usize, &rustc_middle::ty::generic_args::GenericArg)), rustdoc::clean::utils::clean_middle_generic_args::{closure_env#0}>
                               at /home/lcnr/rust3/library/core/src/ops/function.rs:294:13
  22:     0x618960b29622 - {closure#0}<(usize, &rustc_middle::ty::generic_args::GenericArg), rustdoc::clean::types::GenericArg, &mut rustdoc::clean::utils::clean_middle_generic_args::{closure_env#0}>
                               at /home/lcnr/rust3/library/core/src/iter/traits/iterator.rs:2859:32
  23:     0x618960b29622 - {closure#0}<&rustc_middle::ty::generic_args::GenericArg, (), core::ops::control_flow::ControlFlow<rustdoc::clean::types::GenericArg, ()>, core::iter::traits::iterator::Iterator::find_map::check::{closure_env#0}<(usize, &rustc_middle::ty::generic_args::GenericArg), rustdoc::clean::types::GenericArg, &mut rustdoc::clean::utils::clean_middle_generic_args::{closure_env#0}>>
                               at /home/lcnr/rust3/library/core/src/iter/adapters/enumerate.rs:179:17
  24:     0x618960b29622 - try_rfold<core::slice::iter::Iter<rustc_middle::ty::generic_args::GenericArg>, (), core::iter::adapters::enumerate::{impl#2}::try_rfold::enumerate::{closure_env#0}<&rustc_middle::ty::generic_args::GenericArg, (), core::ops::control_flow::ControlFlow<rustdoc::clean::types::GenericArg, ()>, core::iter::traits::iterator::Iterator::find_map::check::{closure_env#0}<(usize, &rustc_middle::ty::generic_args::GenericArg), rustdoc::clean::types::GenericArg, &mut rustdoc::clean::utils::clean_middle_generic_args::{closure_env#0}>>, core::ops::control_flow::ControlFlow<rustdoc::clean::types::GenericArg, ()>>
                               at /home/lcnr/rust3/library/core/src/iter/traits/double_ended.rs:238:21
  25:     0x618960b29622 - try_rfold<core::slice::iter::Iter<rustc_middle::ty::generic_args::GenericArg>, (), core::iter::traits::iterator::Iterator::find_map::check::{closure_env#0}<(usize, &rustc_middle::ty::generic_args::GenericArg), rustdoc::clean::types::GenericArg, &mut rustdoc::clean::utils::clean_middle_generic_args::{closure_env#0}>, core::ops::control_flow::ControlFlow<rustdoc::clean::types::GenericArg, ()>>
                               at /home/lcnr/rust3/library/core/src/iter/adapters/enumerate.rs:184:9
  26:     0x618960b29622 - try_fold<core::iter::adapters::enumerate::Enumerate<core::slice::iter::Iter<rustc_middle::ty::generic_args::GenericArg>>, (), core::iter::traits::iterator::Iterator::find_map::check::{closure_env#0}<(usize, &rustc_middle::ty::generic_args::GenericArg), rustdoc::clean::types::GenericArg, &mut rustdoc::clean::utils::clean_middle_generic_args::{closure_env#0}>, core::ops::control_flow::ControlFlow<rustdoc::clean::types::GenericArg, ()>>
                               at /home/lcnr/rust3/library/core/src/iter/adapters/rev.rs:57:9
  27:     0x618960920982 - find_map<core::iter::adapters::rev::Rev<core::iter::adapters::enumerate::Enumerate<core::slice::iter::Iter<rustc_middle::ty::generic_args::GenericArg>>>, rustdoc::clean::types::GenericArg, &mut rustdoc::clean::utils::clean_middle_generic_args::{closure_env#0}>
                               at /home/lcnr/rust3/library/core/src/iter/traits/iterator.rs:2865:9
  28:     0x618960920982 - next<rustdoc::clean::types::GenericArg, core::iter::adapters::rev::Rev<core::iter::adapters::enumerate::Enumerate<core::slice::iter::Iter<rustc_middle::ty::generic_args::GenericArg>>>, rustdoc::clean::utils::clean_middle_generic_args::{closure_env#0}>
                               at /home/lcnr/rust3/library/core/src/iter/adapters/filter_map.rs:64:9
  29:     0x618960920982 - extend_desugared<rustdoc::clean::types::GenericArg, alloc::alloc::Global, core::iter::adapters::filter_map::FilterMap<core::iter::adapters::rev::Rev<core::iter::adapters::enumerate::Enumerate<core::slice::iter::Iter<rustc_middle::ty::generic_args::GenericArg>>>, rustdoc::clean::utils::clean_middle_generic_args::{closure_env#0}>>
                               at /home/lcnr/rust3/library/alloc/src/vec/mod.rs:3520:35
  30:     0x618960920982 - spec_extend<rustdoc::clean::types::GenericArg, core::iter::adapters::filter_map::FilterMap<core::iter::adapters::rev::Rev<core::iter::adapters::enumerate::Enumerate<core::slice::iter::Iter<rustc_middle::ty::generic_args::GenericArg>>>, rustdoc::clean::utils::clean_middle_generic_args::{closure_env#0}>, alloc::alloc::Global>
                               at /home/lcnr/rust3/library/alloc/src/vec/spec_extend.rs:19:9
  31:     0x618960ac2aa1 - extend<rustdoc::clean::types::GenericArg, alloc::alloc::Global, core::iter::adapters::filter_map::FilterMap<core::iter::adapters::rev::Rev<core::iter::adapters::enumerate::Enumerate<core::slice::iter::Iter<rustc_middle::ty::generic_args::GenericArg>>>, rustdoc::clean::utils::clean_middle_generic_args::{closure_env#0}>>
                               at /home/lcnr/rust3/library/alloc/src/vec/mod.rs:3481:9
  32:     0x618960ac2aa1 - clean_middle_generic_args
                               at /home/lcnr/rust3/src/librustdoc/clean/utils.rs:148:16
  33:     0x618960ac7ef8 - projection_to_path_segment
                               at /home/lcnr/rust3/src/librustdoc/clean/mod.rs:510:19
  34:     0x618960ac7ce9 - clean_projection
                               at /home/lcnr/rust3/src/librustdoc/clean/mod.rs:486:16
  35:     0x618960ae0903 - {closure#0}
                               at /home/lcnr/rust3/src/librustdoc/clean/mod.rs:2167:13
  36:     0x618960ae0903 - clean_middle_ty
                               at /home/lcnr/rust3/src/librustdoc/clean/mod.rs:2019:1
  37:     0x618960aa7d71 - {closure#0}
                               at /home/lcnr/rust3/src/librustdoc/clean/utils.rs:130:63
  38:     0x618960aa7d71 - call_mut<((usize, &rustc_middle::ty::generic_args::GenericArg)), rustdoc::clean::utils::clean_middle_generic_args::{closure_env#0}>
                               at /home/lcnr/rust3/library/core/src/ops/function.rs:294:13
  39:     0x618960b29622 - {closure#0}<(usize, &rustc_middle::ty::generic_args::GenericArg), rustdoc::clean::types::GenericArg, &mut rustdoc::clean::utils::clean_middle_generic_args::{closure_env#0}>
                               at /home/lcnr/rust3/library/core/src/iter/traits/iterator.rs:2859:32
  40:     0x618960b29622 - {closure#0}<&rustc_middle::ty::generic_args::GenericArg, (), core::ops::control_flow::ControlFlow<rustdoc::clean::types::GenericArg, ()>, core::iter::traits::iterator::Iterator::find_map::check::{closure_env#0}<(usize, &rustc_middle::ty::generic_args::GenericArg), rustdoc::clean::types::GenericArg, &mut rustdoc::clean::utils::clean_middle_generic_args::{closure_env#0}>>
                               at /home/lcnr/rust3/library/core/src/iter/adapters/enumerate.rs:179:17
  41:     0x618960b29622 - try_rfold<core::slice::iter::Iter<rustc_middle::ty::generic_args::GenericArg>, (), core::iter::adapters::enumerate::{impl#2}::try_rfold::enumerate::{closure_env#0}<&rustc_middle::ty::generic_args::GenericArg, (), core::ops::control_flow::ControlFlow<rustdoc::clean::types::GenericArg, ()>, core::iter::traits::iterator::Iterator::find_map::check::{closure_env#0}<(usize, &rustc_middle::ty::generic_args::GenericArg), rustdoc::clean::types::GenericArg, &mut rustdoc::clean::utils::clean_middle_generic_args::{closure_env#0}>>, core::ops::control_flow::ControlFlow<rustdoc::clean::types::GenericArg, ()>>
                               at /home/lcnr/rust3/library/core/src/iter/traits/double_ended.rs:238:21
  42:     0x618960b29622 - try_rfold<core::slice::iter::Iter<rustc_middle::ty::generic_args::GenericArg>, (), core::iter::traits::iterator::Iterator::find_map::check::{closure_env#0}<(usize, &rustc_middle::ty::generic_args::GenericArg), rustdoc::clean::types::GenericArg, &mut rustdoc::clean::utils::clean_middle_generic_args::{closure_env#0}>, core::ops::control_flow::ControlFlow<rustdoc::clean::types::GenericArg, ()>>
                               at /home/lcnr/rust3/library/core/src/iter/adapters/enumerate.rs:184:9
  43:     0x618960b29622 - try_fold<core::iter::adapters::enumerate::Enumerate<core::slice::iter::Iter<rustc_middle::ty::generic_args::GenericArg>>, (), core::iter::traits::iterator::Iterator::find_map::check::{closure_env#0}<(usize, &rustc_middle::ty::generic_args::GenericArg), rustdoc::clean::types::GenericArg, &mut rustdoc::clean::utils::clean_middle_generic_args::{closure_env#0}>, core::ops::control_flow::ControlFlow<rustdoc::clean::types::GenericArg, ()>>
                               at /home/lcnr/rust3/library/core/src/iter/adapters/rev.rs:57:9
  44:     0x618960920a3c - find_map<core::iter::adapters::rev::Rev<core::iter::adapters::enumerate::Enumerate<core::slice::iter::Iter<rustc_middle::ty::generic_args::GenericArg>>>, rustdoc::clean::types::GenericArg, &mut rustdoc::clean::utils::clean_middle_generic_args::{closure_env#0}>
                               at /home/lcnr/rust3/library/core/src/iter/traits/iterator.rs:2865:9
  45:     0x618960920a3c - next<rustdoc::clean::types::GenericArg, core::iter::adapters::rev::Rev<core::iter::adapters::enumerate::Enumerate<core::slice::iter::Iter<rustc_middle::ty::generic_args::GenericArg>>>, rustdoc::clean::utils::clean_middle_generic_args::{closure_env#0}>
                               at /home/lcnr/rust3/library/core/src/iter/adapters/filter_map.rs:64:9
  46:     0x618960920a3c - extend_desugared<rustdoc::clean::types::GenericArg, alloc::alloc::Global, core::iter::adapters::filter_map::FilterMap<core::iter::adapters::rev::Rev<core::iter::adapters::enumerate::Enumerate<core::slice::iter::Iter<rustc_middle::ty::generic_args::GenericArg>>>, rustdoc::clean::utils::clean_middle_generic_args::{closure_env#0}>>
                               at /home/lcnr/rust3/library/alloc/src/vec/mod.rs:3520:35
  47:     0x618960920a3c - spec_extend<rustdoc::clean::types::GenericArg, core::iter::adapters::filter_map::FilterMap<core::iter::adapters::rev::Rev<core::iter::adapters::enumerate::Enumerate<core::slice::iter::Iter<rustc_middle::ty::generic_args::GenericArg>>>, rustdoc::clean::utils::clean_middle_generic_args::{closure_env#0}>, alloc::alloc::Global>
                               at /home/lcnr/rust3/library/alloc/src/vec/spec_extend.rs:19:9
  48:     0x618960ac2aa1 - extend<rustdoc::clean::types::GenericArg, alloc::alloc::Global, core::iter::adapters::filter_map::FilterMap<core::iter::adapters::rev::Rev<core::iter::adapters::enumerate::Enumerate<core::slice::iter::Iter<rustc_middle::ty::generic_args::GenericArg>>>, rustdoc::clean::utils::clean_middle_generic_args::{closure_env#0}>>
                               at /home/lcnr/rust3/library/alloc/src/vec/mod.rs:3481:9
  49:     0x618960ac2aa1 - clean_middle_generic_args
                               at /home/lcnr/rust3/src/librustdoc/clean/utils.rs:148:16
  50:     0x618960ac2ee6 - clean_middle_generic_args_with_constraints
                               at /home/lcnr/rust3/src/librustdoc/clean/utils.rs:223:16
  51:     0x618960ac2ee6 - clean_middle_path
                               at /home/lcnr/rust3/src/librustdoc/clean/utils.rs:241:19
  52:     0x618960ae05fb - {closure#0}
                               at /home/lcnr/rust3/src/librustdoc/clean/mod.rs:2079:24
  53:     0x618960ae05fb - clean_middle_ty
                               at /home/lcnr/rust3/src/librustdoc/clean/mod.rs:2019:1
  54:     0x618960acd75f - {closure#0}
                               at /home/lcnr/rust3/src/librustdoc/clean/mod.rs:1287:21
  55:     0x618960acd75f - with_param_env<rustdoc::clean::types::Item, rustdoc::clean::clean_impl_item::{closure_env#0}>
                               at /home/lcnr/rust3/src/librustdoc/core.rs:86:19
  56:     0x618960acd75f - clean_impl_item
                               at /home/lcnr/rust3/src/librustdoc/clean/mod.rs:1271:5
  57:     0x61896092ff71 - {closure#4}
                               at /home/lcnr/rust3/src/librustdoc/clean/inline.rs:519:29
  58:     0x61896092ff71 - call_once<(&rustc_hir::hir::ImplItem), rustdoc::clean::inline::build_impl::{closure_env#4}>
                               at /home/lcnr/rust3/library/core/src/ops/function.rs:305:13
  59:     0x61896092ff71 - map<&rustc_hir::hir::ImplItem, rustdoc::clean::types::Item, &mut rustdoc::clean::inline::build_impl::{closure_env#4}>
                               at /home/lcnr/rust3/library/core/src/option.rs:1113:29
  60:     0x61896092ff71 - next<rustdoc::clean::types::Item, core::iter::adapters::filter::Filter<core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_hir::hir::ImplItemRef>, rustdoc::clean::inline::build_impl::{closure_env#2}>, rustdoc::clean::inline::build_impl::{closure_env#3}>, rustdoc::clean::inline::build_impl::{closure_env#4}>
                               at /home/lcnr/rust3/library/core/src/iter/adapters/map.rs:107:26
  61:     0x61896092ff71 - from_iter<rustdoc::clean::types::Item, core::iter::adapters::map::Map<core::iter::adapters::filter::Filter<core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_hir::hir::ImplItemRef>, rustdoc::clean::inline::build_impl::{closure_env#2}>, rustdoc::clean::inline::build_impl::{closure_env#3}>, rustdoc::clean::inline::build_impl::{closure_env#4}>>
                               at /home/lcnr/rust3/library/alloc/src/vec/spec_from_iter_nested.rs:25:32
  62:     0x61896092ff71 - from_iter<rustdoc::clean::types::Item, core::iter::adapters::map::Map<core::iter::adapters::filter::Filter<core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_hir::hir::ImplItemRef>, rustdoc::clean::inline::build_impl::{closure_env#2}>, rustdoc::clean::inline::build_impl::{closure_env#3}>, rustdoc::clean::inline::build_impl::{closure_env#4}>>
                               at /home/lcnr/rust3/library/alloc/src/vec/spec_from_iter.rs:34:9
  63:     0x618960abfd2f - from_iter<rustdoc::clean::types::Item, core::iter::adapters::map::Map<core::iter::adapters::filter::Filter<core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_hir::hir::ImplItemRef>, rustdoc::clean::inline::build_impl::{closure_env#2}>, rustdoc::clean::inline::build_impl::{closure_env#3}>, rustdoc::clean::inline::build_impl::{closure_env#4}>>
                               at /home/lcnr/rust3/library/alloc/src/vec/mod.rs:3412:9
  64:     0x618960abfd2f - collect<core::iter::adapters::map::Map<core::iter::adapters::filter::Filter<core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_hir::hir::ImplItemRef>, rustdoc::clean::inline::build_impl::{closure_env#2}>, rustdoc::clean::inline::build_impl::{closure_env#3}>, rustdoc::clean::inline::build_impl::{closure_env#4}>, alloc::vec::Vec<rustdoc::clean::types::Item, alloc::alloc::Global>>
                               at /home/lcnr/rust3/library/core/src/iter/traits/iterator.rs:1971:9
  65:     0x618960abfd2f - build_impl
                               at /home/lcnr/rust3/src/librustdoc/clean/inline.rs:520:18
  66:     0x618960ad66d3 - {closure#5}
                               at /home/lcnr/rust3/src/librustdoc/passes/collect_trait_impls.rs:82:17
  67:     0x618960ad66d3 - with_param_env<(), rustdoc::passes::collect_trait_impls::collect_trait_impls::{closure_env#5}>
                               at /home/lcnr/rust3/src/librustdoc/core.rs:86:19
  68:     0x6189608fc061 - collect_trait_impls
                               at /home/lcnr/rust3/src/librustdoc/passes/collect_trait_impls.rs:81:13
  69:     0x618960d1e4a7 - {closure#6}
                               at /home/lcnr/rust3/src/librustdoc/core.rs:430:55
  70:     0x618960d1e4a7 - run<rustdoc::clean::types::Crate, rustdoc::core::run_global_ctxt::{closure_env#6}>
                               at /home/lcnr/rust3/compiler/rustc_data_structures/src/profiling.rs:753:9
  71:     0x618960d1e4a7 - time<rustdoc::clean::types::Crate, rustdoc::core::run_global_ctxt::{closure_env#6}>
                               at /home/lcnr/rust3/compiler/rustc_session/src/utils.rs:16:9
  72:     0x618960ad9f3a - run_global_ctxt
                               at /home/lcnr/rust3/src/librustdoc/core.rs:430:25
  73:     0x618960d1d809 - {closure#0}
                               at /home/lcnr/rust3/src/librustdoc/lib.rs:867:21
  74:     0x618960d1d809 - run<core::result::Result<(rustdoc::clean::types::Crate, rustdoc::config::RenderOptions, rustdoc::formats::cache::Cache), rustc_span::ErrorGuaranteed>, rustdoc::main_args::{closure#2}::{closure#0}::{closure#0}::{closure_env#0}>
                               at /home/lcnr/rust3/compiler/rustc_data_structures/src/profiling.rs:753:9
  75:     0x618960d1d809 - time<core::result::Result<(rustdoc::clean::types::Crate, rustdoc::config::RenderOptions, rustdoc::formats::cache::Cache), rustc_span::ErrorGuaranteed>, rustdoc::main_args::{closure#2}::{closure#0}::{closure#0}::{closure_env#0}>
                               at /home/lcnr/rust3/compiler/rustc_session/src/utils.rs:16:9
  76:     0x618960a33361 - {closure#0}
                               at /home/lcnr/rust3/src/librustdoc/lib.rs:866:55
  77:     0x618960a33361 - {closure#1}<rustdoc::main_args::{closure#2}::{closure#0}::{closure_env#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
                               at /home/lcnr/rust3/compiler/rustc_middle/src/ty/context.rs:1371:37
  78:     0x618960a33361 - {closure#0}<rustc_middle::ty::context::{impl#20}::enter::{closure_env#1}<rustdoc::main_args::{closure#2}::{closure#0}::{closure_env#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>, core::result::Result<(), rustc_span::ErrorGuaranteed>>
                               at /home/lcnr/rust3/compiler/rustc_middle/src/ty/context/tls.rs:72:9
  79:     0x618960a33361 - try_with<core::cell::Cell<*const ()>, rustc_middle::ty::context::tls::enter_context::{closure_env#0}<rustc_middle::ty::context::{impl#20}::enter::{closure_env#1}<rustdoc::main_args::{closure#2}::{closure#0}::{closure_env#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>, core::result::Result<(), rustc_span::ErrorGuaranteed>>, core::result::Result<(), rustc_span::ErrorGuaranteed>>
                               at /home/lcnr/rust3/library/std/src/thread/local.rs:309:12
  80:     0x618960a33361 - with<core::cell::Cell<*const ()>, rustc_middle::ty::context::tls::enter_context::{closure_env#0}<rustc_middle::ty::context::{impl#20}::enter::{closure_env#1}<rustdoc::main_args::{closure#2}::{closure#0}::{closure_env#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>, core::result::Result<(), rustc_span::ErrorGuaranteed>>, core::result::Result<(), rustc_span::ErrorGuaranteed>>
                               at /home/lcnr/rust3/library/std/src/thread/local.rs:273:9
  81:     0x618960a33361 - enter_context<rustc_middle::ty::context::{impl#20}::enter::{closure_env#1}<rustdoc::main_args::{closure#2}::{closure#0}::{closure_env#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>, core::result::Result<(), rustc_span::ErrorGuaranteed>>
                               at /home/lcnr/rust3/compiler/rustc_middle/src/ty/context/tls.rs:69:9
  82:     0x618960a33361 - enter<rustdoc::main_args::{closure#2}::{closure#0}::{closure_env#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
                               at /home/lcnr/rust3/compiler/rustc_middle/src/ty/context.rs:1371:9
  83:     0x618960a33361 - enter<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustdoc::main_args::{closure#2}::{closure#0}::{closure_env#0}>
                               at /home/lcnr/rust3/compiler/rustc_interface/src/queries.rs:64:9
  84:     0x618960a33361 - {closure#0}
                               at /home/lcnr/rust3/src/librustdoc/lib.rs:865:13
  85:     0x618960a33361 - enter<rustdoc::main_args::{closure#2}::{closure_env#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
                               at /home/lcnr/rust3/compiler/rustc_interface/src/queries.rs:211:19
  86:     0x618960ca964b - {closure#2}
                               at /home/lcnr/rust3/src/librustdoc/lib.rs:859:9
  87:     0x618960ca964b - {closure#1}<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustdoc::main_args::{closure_env#2}>
                               at /home/lcnr/rust3/compiler/rustc_interface/src/interface.rs:505:27
  88:     0x618960c9a785 - {closure#0}<rustc_interface::interface::run_compiler::{closure_env#1}<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustdoc::main_args::{closure_env#2}>, core::result::Result<(), rustc_span::ErrorGuaranteed>>
                               at /home/lcnr/rust3/compiler/rustc_interface/src/util.rs:143:13
  89:     0x618960c9a785 - {closure#0}<rustc_interface::util::run_in_thread_pool_with_globals::{closure_env#0}<rustc_interface::interface::run_compiler::{closure_env#1}<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustdoc::main_args::{closure_env#2}>, core::result::Result<(), rustc_span::ErrorGuaranteed>>, core::result::Result<(), rustc_span::ErrorGuaranteed>>
                               at /home/lcnr/rust3/compiler/rustc_interface/src/util.rs:106:21
  90:     0x618960c9a785 - set<rustc_span::SessionGlobals, rustc_interface::util::run_in_thread_with_globals::{closure#0}::{closure#0}::{closure_env#0}<rustc_interface::util::run_in_thread_pool_with_globals::{closure_env#0}<rustc_interface::interface::run_compiler::{closure_env#1}<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustdoc::main_args::{closure_env#2}>, core::result::Result<(), rustc_span::ErrorGuaranteed>>, core::result::Result<(), rustc_span::ErrorGuaranteed>>, core::result::Result<(), rustc_span::ErrorGuaranteed>>
                               at /home/lcnr/.cargo/registry/src/index.crates.io-6f17d22bba15001f/scoped-tls-1.0.1/src/lib.rs:137:9
  91:     0x618960c9a785 - create_session_globals_then<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_interface::util::run_in_thread_with_globals::{closure#0}::{closure#0}::{closure_env#0}<rustc_interface::util::run_in_thread_pool_with_globals::{closure_env#0}<rustc_interface::interface::run_compiler::{closure_env#1}<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustdoc::main_args::{closure_env#2}>, core::result::Result<(), rustc_span::ErrorGuaranteed>>, core::result::Result<(), rustc_span::ErrorGuaranteed>>>
                               at /home/lcnr/rust3/compiler/rustc_span/src/lib.rs:138:5
  92:     0x618960c9a785 - {closure#0}<rustc_interface::util::run_in_thread_pool_with_globals::{closure_env#0}<rustc_interface::interface::run_compiler::{closure_env#1}<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustdoc::main_args::{closure_env#2}>, core::result::Result<(), rustc_span::ErrorGuaranteed>>, core::result::Result<(), rustc_span::ErrorGuaranteed>>
                               at /home/lcnr/rust3/compiler/rustc_interface/src/util.rs:105:17
  93:     0x618960c9a785 - __rust_begin_short_backtrace<rustc_interface::util::run_in_thread_with_globals::{closure#0}::{closure_env#0}<rustc_interface::util::run_in_thread_pool_with_globals::{closure_env#0}<rustc_interface::interface::run_compiler::{closure_env#1}<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustdoc::main_args::{closure_env#2}>, core::result::Result<(), rustc_span::ErrorGuaranteed>>, core::result::Result<(), rustc_span::ErrorGuaranteed>>, core::result::Result<(), rustc_span::ErrorGuaranteed>>
                               at /home/lcnr/rust3/library/std/src/sys/backtrace.rs:154:18
  94:     0x618960cac405 - {closure#0}<rustc_interface::util::run_in_thread_with_globals::{closure#0}::{closure_env#0}<rustc_interface::util::run_in_thread_pool_with_globals::{closure_env#0}<rustc_interface::interface::run_compiler::{closure_env#1}<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustdoc::main_args::{closure_env#2}>, core::result::Result<(), rustc_span::ErrorGuaranteed>>, core::result::Result<(), rustc_span::ErrorGuaranteed>>, core::result::Result<(), rustc_span::ErrorGuaranteed>>
                               at /home/lcnr/rust3/library/std/src/thread/mod.rs:561:17
  95:     0x618960cac405 - call_once<core::result::Result<(), rustc_span::ErrorGuaranteed>, std::thread::{impl#0}::spawn_unchecked_::{closure#1}::{closure_env#0}<rustc_interface::util::run_in_thread_with_globals::{closure#0}::{closure_env#0}<rustc_interface::util::run_in_thread_pool_with_globals::{closure_env#0}<rustc_interface::interface::run_compiler::{closure_env#1}<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustdoc::main_args::{closure_env#2}>, core::result::Result<(), rustc_span::ErrorGuaranteed>>, core::result::Result<(), rustc_span::ErrorGuaranteed>>, core::result::Result<(), rustc_span::ErrorGuaranteed>>>
                               at /home/lcnr/rust3/library/core/src/panic/unwind_safe.rs:272:9
  96:     0x618960cac405 - do_call<core::panic::unwind_safe::AssertUnwindSafe<std::thread::{impl#0}::spawn_unchecked_::{closure#1}::{closure_env#0}<rustc_interface::util::run_in_thread_with_globals::{closure#0}::{closure_env#0}<rustc_interface::util::run_in_thread_pool_with_globals::{closure_env#0}<rustc_interface::interface::run_compiler::{closure_env#1}<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustdoc::main_args::{closure_env#2}>, core::result::Result<(), rustc_span::ErrorGuaranteed>>, core::result::Result<(), rustc_span::ErrorGuaranteed>>, core::result::Result<(), rustc_span::ErrorGuaranteed>>>, core::result::Result<(), rustc_span::ErrorGuaranteed>>
                               at /home/lcnr/rust3/library/std/src/panicking.rs:573:40
  97:     0x618960cac405 - try<core::result::Result<(), rustc_span::ErrorGuaranteed>, core::panic::unwind_safe::AssertUnwindSafe<std::thread::{impl#0}::spawn_unchecked_::{closure#1}::{closure_env#0}<rustc_interface::util::run_in_thread_with_globals::{closure#0}::{closure_env#0}<rustc_interface::util::run_in_thread_pool_with_globals::{closure_env#0}<rustc_interface::interface::run_compiler::{closure_env#1}<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustdoc::main_args::{closure_env#2}>, core::result::Result<(), rustc_span::ErrorGuaranteed>>, core::result::Result<(), rustc_span::ErrorGuaranteed>>, core::result::Result<(), rustc_span::ErrorGuaranteed>>>>
                               at /home/lcnr/rust3/library/std/src/panicking.rs:536:19
  98:     0x618960cac405 - catch_unwind<core::panic::unwind_safe::AssertUnwindSafe<std::thread::{impl#0}::spawn_unchecked_::{closure#1}::{closure_env#0}<rustc_interface::util::run_in_thread_with_globals::{closure#0}::{closure_env#0}<rustc_interface::util::run_in_thread_pool_with_globals::{closure_env#0}<rustc_interface::interface::run_compiler::{closure_env#1}<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustdoc::main_args::{closure_env#2}>, core::result::Result<(), rustc_span::ErrorGuaranteed>>, core::result::Result<(), rustc_span::ErrorGuaranteed>>, core::result::Result<(), rustc_span::ErrorGuaranteed>>>, core::result::Result<(), rustc_span::ErrorGuaranteed>>
                               at /home/lcnr/rust3/library/std/src/panic.rs:358:14
  99:     0x618960cac405 - {closure#1}<rustc_interface::util::run_in_thread_with_globals::{closure#0}::{closure_env#0}<rustc_interface::util::run_in_thread_pool_with_globals::{closure_env#0}<rustc_interface::interface::run_compiler::{closure_env#1}<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustdoc::main_args::{closure_env#2}>, core::result::Result<(), rustc_span::ErrorGuaranteed>>, core::result::Result<(), rustc_span::ErrorGuaranteed>>, core::result::Result<(), rustc_span::ErrorGuaranteed>>
                               at /home/lcnr/rust3/library/std/src/thread/mod.rs:559:30
 100:     0x618960cac405 - call_once<std::thread::{impl#0}::spawn_unchecked_::{closure_env#1}<rustc_interface::util::run_in_thread_with_globals::{closure#0}::{closure_env#0}<rustc_interface::util::run_in_thread_pool_with_globals::{closure_env#0}<rustc_interface::interface::run_compiler::{closure_env#1}<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustdoc::main_args::{closure_env#2}>, core::result::Result<(), rustc_span::ErrorGuaranteed>>, core::result::Result<(), rustc_span::ErrorGuaranteed>>, core::result::Result<(), rustc_span::ErrorGuaranteed>>, ()>
                               at /home/lcnr/rust3/library/core/src/ops/function.rs:250:5
 101:     0x7f28b96a3a4d - call_once<(), dyn core::ops::function::FnOnce<(), Output=()>, alloc::alloc::Global>
                               at /home/lcnr/rust3/library/alloc/src/boxed.rs:1972:9
 102:     0x7f28b96a3a4d - call_once<(), alloc::boxed::Box<dyn core::ops::function::FnOnce<(), Output=()>, alloc::alloc::Global>, alloc::alloc::Global>
                               at /home/lcnr/rust3/library/alloc/src/boxed.rs:1972:9
 103:     0x7f28b969691f - thread_start
                               at /home/lcnr/rust3/library/std/src/sys/pal/unix/thread.rs:105:17
 104:     0x7f28b349ca94 - start_thread
                               at ./nptl/pthread_create.c:447:8
 105:     0x7f28b3529c3c - clone3
                               at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
 106:                0x0 - <unknown>

error: 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-rustdoc&template=ice.md

note: please make sure that you have updated to the latest nightly

note: please attach the file at `/home/lcnr/diesel/rustc-ice-2024-11-29T15_58_56-64760.txt` to your bug report

note: compiler flags: --crate-type lib

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
end of query stack
error: could not document `diesel`
```

</details>