Skip to content

[Rustdoc] Thread 'rustc' panicked at 'Unable to fulfill trait DefId' #81786

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

Closed
hestati63 opened this issue Feb 5, 2021 · 1 comment
Closed
Assignees
Labels
A-trait-system Area: Trait system C-bug Category: This is a bug. F-auto_traits `#![feature(auto_traits)]` F-negative_impls #![feature(negative_impls)] 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-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

@hestati63
Copy link

Code

#![feature(auto_traits, negative_impls)]

auto trait AutoTrait {}

pub struct Struct<K, V> {
    k: K,
    v: V
}

impl<T> !AutoTrait for *const T {}

impl<K, V> AutoTrait for Struct<K, V>
where
    K: AutoTrait,
    V: AutoTrait,
{
}

impl AutoTrait for Struct<usize, *const usize> {}

pub struct Wrap<'a> {
    inner: &'a Struct<usize, *const usize>,
}

Meta

rustc --version --verbose:

rustc 1.51.0-nightly (04caa632d 2021-01-30)
binary: rustc
commit-hash: 04caa632dd10c2bf64b69524c7f9c4c30a436877
commit-date: 2021-01-30
host: x86_64-unknown-linux-gnu
release: 1.51.0-nightly
LLVM version: 11.0.1

Error output

$  cargo doc
thread 'rustc' panicked at 'Unable to fulfill trait DefId(0:3 ~ testtest[8787]::AutoTrait) for 'Wrap<'a>': [FulfillmentError(Obligation(predicate=Binder(TraitPredicate(<Struct<usize, *const usize> as AutoTrait>)), depth=2),Ambiguity)]', /rustc/04caa632dd10c2bf64b69524c7f9c4c30a436877/compiler/rustc_trait_selection/src/traits/auto_trait.rs:190:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

error: internal compiler error: unexpected panic

error: Unrecognized option: 'document-private-items'
Backtrace

thread 'rustc' panicked at 'Unable to fulfill trait DefId(0:3 ~ testtest[8787]::AutoTrait) for 'Wrap<'a>': [FulfillmentError(Obligation(predicate=Binder(TraitPredicate(<Struct<usize, *const usize> as AutoTrait>)), depth=2),Ambiguity)]', /rustc/04caa632dd10c2bf64b69524c7f9c4c30a436877/compiler/rustc_trait_selection/src/traits/auto_trait.rs:190:17
stack backtrace:
   0: rust_begin_unwind
             at /rustc/04caa632dd10c2bf64b69524c7f9c4c30a436877/library/std/src/panicking.rs:493:5
   1: std::panicking::begin_panic_fmt
             at /rustc/04caa632dd10c2bf64b69524c7f9c4c30a436877/library/std/src/panicking.rs:435:5
   2: rustc_trait_selection::traits::auto_trait::AutoTraitFinder::find_auto_trait_generics::{{closure}}::{{closure}}
   3: rustc_infer::infer::InferCtxtBuilder::enter
   4: rustc_trait_selection::traits::auto_trait::AutoTraitFinder::find_auto_trait_generics
   5: <core::iter::adapters::cloned::Cloned<I> as core::iter::traits::iterator::Iterator>::try_fold
   6: <alloc::vec::Vec<T> as alloc::vec::spec_from_iter::SpecFromIter<T,I>>::from_iter
   7: rustdoc::clean::utils::get_auto_trait_and_blanket_impls
   8: <rustdoc::passes::collect_trait_impls::SyntheticImplCollector as rustdoc::fold::DocFolder>::fold_item
   9: alloc::vec::source_iter_marker::<impl alloc::vec::spec_from_iter::SpecFromIter<T,I> for alloc::vec::Vec<T>>::from_iter
  10: rustdoc::fold::DocFolder::fold_inner_recur
  11: <rustdoc::passes::collect_trait_impls::SyntheticImplCollector as rustdoc::fold::DocFolder>::fold_item
  12: rustdoc::fold::DocFolder::fold_crate
  13: rustdoc::passes::collect_trait_impls::collect_trait_impls
  14: rustc_session::utils::<impl rustc_session::session::Session>::time
  15: rustc_interface::passes::QueryContext::enter
  16: rustc_interface::interface::create_compiler_and_run
  17: rustdoc::main_options
  18: scoped_tls::ScopedKey<T>::set

@hestati63 hestati63 added 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. labels Feb 5, 2021
@jonas-schievink jonas-schievink added A-trait-system Area: Trait system F-auto_traits `#![feature(auto_traits)]` F-negative_impls #![feature(negative_impls)] requires-nightly This issue requires a nightly compiler in some way. labels Feb 5, 2021
@Aaron1011 Aaron1011 self-assigned this Feb 5, 2021
fanninpm added a commit to fanninpm/glacier that referenced this issue Feb 11, 2021
@JohnTitor JohnTitor added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Feb 12, 2021
@rust-lang-glacier-bot rust-lang-glacier-bot added the glacier ICE tracked in rust-lang/glacier. label Feb 12, 2021
@Alexendoo
Copy link
Member

Alexendoo commented Mar 25, 2022

No longer ICEs, I believe due to #95069

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-trait-system Area: Trait system C-bug Category: This is a bug. F-auto_traits `#![feature(auto_traits)]` F-negative_impls #![feature(negative_impls)] 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-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

No branches or pull requests

7 participants