Skip to content

ICE: rustdoc: unable to fulfill trait #102154

Closed

Description

@matthiaskrgr

Code

code from glacier/fixed ./82830.rs

trait A<Y, N> {
    type B;
}
type MaybeBox<T> = <T as A<T, Box<T>>>::B;
struct P {
    t: MaybeBox<P>
}
impl<Y, N> A<Y, N> for P {
    type B = N;
}
fn main() {
    let t: MaybeBox<P>;
}

Meta

rustc --version --verbose:

rustdoc 1.66.0-nightly (89e4e1f1b 2022-09-22)
binary: rustdoc
commit-hash: 89e4e1f1b32e2a88cf696337f77e10273142c1a0
commit-date: 2022-09-22
host: x86_64-unknown-linux-gnu
release: 1.66.0-nightly
LLVM version: 15.0.0

Error output

rustdoc ./82830.rs

<output>
Backtrace

thread 'rustc' panicked at 'Unable to fulfill trait DefId(2:9577 ~ core[18c4]::panic::unwind_safe::RefUnwindSafe) for 'P': [FulfillmentError(Obligation(predicate=Binder(TraitPredicate(<P as std::marker::Sized>, polarity:Positive), []), depth=2),Cycle([Obligation(predicate=Binder(TraitPredicate(<P as std::marker::Sized>, polarity:Positive), []), depth=2)]))]', /rustc/89e4e1f1b32e2a88cf696337f77e10273142c1a0/compiler/rustc_trait_selection/src/traits/auto_trait.rs:212:17
stack backtrace:
   0:     0x7fadeada2ff0 - std::backtrace_rs::backtrace::libunwind::trace::h2ca6883764224c50
                               at /rustc/89e4e1f1b32e2a88cf696337f77e10273142c1a0/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   1:     0x7fadeada2ff0 - std::backtrace_rs::backtrace::trace_unsynchronized::hc8d7bf16fbb24a66
                               at /rustc/89e4e1f1b32e2a88cf696337f77e10273142c1a0/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7fadeada2ff0 - std::sys_common::backtrace::_print_fmt::h8131a70362d50711
                               at /rustc/89e4e1f1b32e2a88cf696337f77e10273142c1a0/library/std/src/sys_common/backtrace.rs:66:5
   3:     0x7fadeada2ff0 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h90d935aa8f152cc4
                               at /rustc/89e4e1f1b32e2a88cf696337f77e10273142c1a0/library/std/src/sys_common/backtrace.rs:45:22
   4:     0x7fadeadfde1e - core::fmt::write::he269743b74f5c696
                               at /rustc/89e4e1f1b32e2a88cf696337f77e10273142c1a0/library/core/src/fmt/mod.rs:1202:17
   5:     0x7fadead93af5 - std::io::Write::write_fmt::hc8f981841522dcb7
                               at /rustc/89e4e1f1b32e2a88cf696337f77e10273142c1a0/library/std/src/io/mod.rs:1679:15
   6:     0x7fadeada5d73 - std::sys_common::backtrace::_print::hc472289dfed76ac5
                               at /rustc/89e4e1f1b32e2a88cf696337f77e10273142c1a0/library/std/src/sys_common/backtrace.rs:48:5
   7:     0x7fadeada5d73 - std::sys_common::backtrace::print::hb5cbce6ae3413adf
                               at /rustc/89e4e1f1b32e2a88cf696337f77e10273142c1a0/library/std/src/sys_common/backtrace.rs:35:9
   8:     0x7fadeada5d73 - std::panicking::default_hook::{{closure}}::h2cd9e26e5a4d26cf
                               at /rustc/89e4e1f1b32e2a88cf696337f77e10273142c1a0/library/std/src/panicking.rs:267:22
   9:     0x7fadeada5a5f - std::panicking::default_hook::h285a577a219daf6b
                               at /rustc/89e4e1f1b32e2a88cf696337f77e10273142c1a0/library/std/src/panicking.rs:286:9
  10:     0x7faded5a9f11 - rustc_driver[3f123be23da454cf]::DEFAULT_HOOK::{closure#0}::{closure#0}
  11:     0x7fadeada65ab - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::hb82c925d16f3379b
                               at /rustc/89e4e1f1b32e2a88cf696337f77e10273142c1a0/library/alloc/src/boxed.rs:1954:9
  12:     0x7fadeada65ab - std::panicking::rust_panic_with_hook::hb93707af70744542
                               at /rustc/89e4e1f1b32e2a88cf696337f77e10273142c1a0/library/std/src/panicking.rs:673:13
  13:     0x7fadeada6407 - std::panicking::begin_panic_handler::{{closure}}::hd681f529bfde9833
                               at /rustc/89e4e1f1b32e2a88cf696337f77e10273142c1a0/library/std/src/panicking.rs:560:13
  14:     0x7fadeada349c - std::sys_common::backtrace::__rust_end_short_backtrace::h0a1c018d6d45d3ac
                               at /rustc/89e4e1f1b32e2a88cf696337f77e10273142c1a0/library/std/src/sys_common/backtrace.rs:138:18
  15:     0x7fadeada6122 - rust_begin_unwind
                               at /rustc/89e4e1f1b32e2a88cf696337f77e10273142c1a0/library/std/src/panicking.rs:556:5
  16:     0x7fadeadfa9f3 - core::panicking::panic_fmt::h9c23657a9510a693
                               at /rustc/89e4e1f1b32e2a88cf696337f77e10273142c1a0/library/core/src/panicking.rs:142:14
  17:     0x55fe41d697a1 - <rustc_trait_selection[85ad35dc24063c91]::traits::auto_trait::AutoTraitFinder>::find_auto_trait_generics::<rustdoc[49db050148857d76]::clean::types::Generics, <rustdoc[49db050148857d76]::clean::auto_trait::AutoTraitFinder>::generate_for_trait::{closure#0}>
  18:     0x55fe41cf7926 - <rustdoc[49db050148857d76]::clean::auto_trait::AutoTraitFinder>::generate_for_trait
  19:     0x55fe41d50c41 - <alloc[e78ec9fa308054ee]::vec::Vec<rustdoc[49db050148857d76]::clean::types::Item> as alloc[e78ec9fa308054ee]::vec::spec_from_iter::SpecFromIter<rustdoc[49db050148857d76]::clean::types::Item, core[18c4b1d7071fd1cd]::iter::adapters::filter_map::FilterMap<alloc[e78ec9fa308054ee]::vec::into_iter::IntoIter<rustc_span[8952443004196ec6]::def_id::DefId>, <rustdoc[49db050148857d76]::clean::auto_trait::AutoTraitFinder>::get_auto_trait_impls::{closure#0}>>>::from_iter
  20:     0x55fe41cf8682 - <rustdoc[49db050148857d76]::clean::auto_trait::AutoTraitFinder>::get_auto_trait_impls
  21:     0x55fe41dbdc31 - rustdoc[49db050148857d76]::clean::utils::get_auto_trait_and_blanket_impls
  22:     0x55fe41eeb69a - <rustdoc[49db050148857d76]::passes::collect_trait_impls::SyntheticImplCollector as rustdoc[49db050148857d76]::visit::DocVisitor>::visit_item
  23:     0x55fe41eeb7da - <rustdoc[49db050148857d76]::passes::collect_trait_impls::SyntheticImplCollector as rustdoc[49db050148857d76]::visit::DocVisitor>::visit_item
  24:     0x55fe41eec70d - <rustdoc[49db050148857d76]::passes::collect_trait_impls::SyntheticImplCollector as rustdoc[49db050148857d76]::visit::DocVisitor>::visit_crate
  25:     0x55fe41f64b82 - <rustc_session[116fffadb813d920]::session::Session>::time::<alloc[e78ec9fa308054ee]::vec::Vec<rustdoc[49db050148857d76]::clean::types::Item>, rustdoc[49db050148857d76]::passes::collect_trait_impls::collect_trait_impls::{closure#0}>
  26:     0x55fe41ee9540 - rustdoc[49db050148857d76]::passes::collect_trait_impls::collect_trait_impls
  27:     0x55fe41f64dfd - <rustc_session[116fffadb813d920]::session::Session>::time::<rustdoc[49db050148857d76]::clean::types::Crate, rustdoc[49db050148857d76]::core::run_global_ctxt::{closure#7}>
  28:     0x55fe41e3e8a8 - rustdoc[49db050148857d76]::core::run_global_ctxt
  29:     0x55fe41f650df - <rustc_session[116fffadb813d920]::session::Session>::time::<(rustdoc[49db050148857d76]::clean::types::Crate, rustdoc[49db050148857d76]::config::RenderOptions, rustdoc[49db050148857d76]::formats::cache::Cache), rustdoc[49db050148857d76]::main_options::{closure#0}::{closure#0}::{closure#1}::{closure#0}>
  30:     0x55fe41eb0801 - <rustc_interface[7e3736c909effbd2]::passes::QueryContext>::enter::<rustdoc[49db050148857d76]::main_options::{closure#0}::{closure#0}::{closure#1}, core[18c4b1d7071fd1cd]::result::Result<(), rustc_errors[34b5fd58e2bb12db]::ErrorGuaranteed>>
  31:     0x55fe41c961fa - <rustc_interface[7e3736c909effbd2]::interface::Compiler>::enter::<rustdoc[49db050148857d76]::main_options::{closure#0}::{closure#0}, core[18c4b1d7071fd1cd]::result::Result<(), rustc_errors[34b5fd58e2bb12db]::ErrorGuaranteed>>
  32:     0x55fe41fdbbf0 - rustc_span[8952443004196ec6]::with_source_map::<core[18c4b1d7071fd1cd]::result::Result<(), rustc_errors[34b5fd58e2bb12db]::ErrorGuaranteed>, rustc_interface[7e3736c909effbd2]::interface::create_compiler_and_run<core[18c4b1d7071fd1cd]::result::Result<(), rustc_errors[34b5fd58e2bb12db]::ErrorGuaranteed>, rustdoc[49db050148857d76]::main_options::{closure#0}>::{closure#1}>
  33:     0x55fe41cd9025 - rustdoc[49db050148857d76]::main_options
  34:     0x55fe41eae59b - <scoped_tls[b33617bf2807a620]::ScopedKey<rustc_span[8952443004196ec6]::SessionGlobals>>::set::<rustdoc[49db050148857d76]::main_args::{closure#0}, core[18c4b1d7071fd1cd]::result::Result<(), rustc_errors[34b5fd58e2bb12db]::ErrorGuaranteed>>
  35:     0x55fe41f7ac70 - std[e75007de79557301]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[7e3736c909effbd2]::util::run_in_thread_pool_with_globals<rustdoc[49db050148857d76]::main_args::{closure#0}, core[18c4b1d7071fd1cd]::result::Result<(), rustc_errors[34b5fd58e2bb12db]::ErrorGuaranteed>>::{closure#0}, core[18c4b1d7071fd1cd]::result::Result<(), rustc_errors[34b5fd58e2bb12db]::ErrorGuaranteed>>
  36:     0x55fe41e2b8fc - <<std[e75007de79557301]::thread::Builder>::spawn_unchecked_<rustc_interface[7e3736c909effbd2]::util::run_in_thread_pool_with_globals<rustdoc[49db050148857d76]::main_args::{closure#0}, core[18c4b1d7071fd1cd]::result::Result<(), rustc_errors[34b5fd58e2bb12db]::ErrorGuaranteed>>::{closure#0}, core[18c4b1d7071fd1cd]::result::Result<(), rustc_errors[34b5fd58e2bb12db]::ErrorGuaranteed>>::{closure#1} as core[18c4b1d7071fd1cd]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  37:     0x7fadeadb0393 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hf8eb4b8b28ab25ff
                               at /rustc/89e4e1f1b32e2a88cf696337f77e10273142c1a0/library/alloc/src/boxed.rs:1940:9
  38:     0x7fadeadb0393 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h7b97191167d4a57f
                               at /rustc/89e4e1f1b32e2a88cf696337f77e10273142c1a0/library/alloc/src/boxed.rs:1940:9
  39:     0x7fadeadb0393 - std::sys::unix::thread::Thread::new::thread_start::h6566f949dcab60e6
                               at /rustc/89e4e1f1b32e2a88cf696337f77e10273142c1a0/library/std/src/sys/unix/thread.rs:108:17
  40:     0x7fadeaae878d - <unknown>
  41:     0x7fadeab698e4 - clone
  42:                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.66.0-nightly (89e4e1f1b 2022-09-22) running on x86_64-unknown-linux-gnu

query stack during panic:
end of query stack

Activity

  1. added
    T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.
    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.
    C-bugCategory: This is a bug.
    on Sep 22, 2022
  2. matthiaskrgr commented on Sep 23, 2022

    @matthiaskrgr
    MemberAuthor

    Two files from the repo that reproduce this since yesterday:
    ./src/test/ui/generic-associated-types/bugs/issue-80626.rs
    ./src/test/ui/traits/issue-82830.rs

  3. added a commit that references this issue on Sep 23, 2022
  4. GuillaumeGomez commented on Sep 24, 2022

    @GuillaumeGomez
    Member

    I think it's because of a change in the compiler. Maybe you know about this @oli-obk ?

  5. matthiaskrgr commented on Sep 24, 2022

    @matthiaskrgr
    MemberAuthor

    cargo-bisect-rustc points to 89e4e1f

  6. oli-obk commented on Sep 25, 2022

    @oli-obk
    Contributor

    This is almost certainly #102037 (the ice mentions cycles). Likely rustdoc is unwrapping something in generate_for_trait in the closure arg for the call to find_auto_trait_generics

  7. Alexendoo commented on Nov 14, 2022

    @Alexendoo
    Member

    No longer ICEs since #104293

  8. added
    E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.
    on Nov 14, 2022
  9. aDotInTheVoid commented on Nov 14, 2022

    @aDotInTheVoid
    Member

    @rustbot claim

  10. added a commit that references this issue on Nov 15, 2022
  11. added a commit that references this issue on Nov 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.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.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.glacierICE tracked in rust-lang/glacier.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions