Skip to content

rustdoc: ICE: synthetic auto trait impls: failed to unify obligation #136778

Open
@Jazzpirate

Description

@Jazzpirate

I don't think this is easily reproducible; the error occurs in https://github.com/KWARC/FLAMS.git on running RUSTDOCFLAGS="--enable-index-page -Zunstable-options --generate-link-to-definition --cfg docsrs" cargo +nightly doc --workspace --no-deps --all-features --release --document-private-items, but that project is huge...

The rustc-ice-*.txt file only says

rustc version: 1.86.0-nightly (43ca9d18e 2025-02-08)
platform: x86_64-unknown-linux-gnu

Meta

rustc --version --verbose:

rustc 1.86.0-nightly (43ca9d18e 2025-02-08)
binary: rustc
commit-hash: 43ca9d18e333797f0aa3b525501a7cec8d61a96b
commit-date: 2025-02-08
host: x86_64-unknown-linux-gnu
release: 1.86.0-nightly
LLVM version: 19.1.7

Error output


error: internal compiler error: Failed to unify obligation `Obligation(predicate=AliasTerm { args: [Err/#4, (std::string::String, flams_utils::sourcerefs::SourceRange<Alias(Projection, AliasTy { args: [flams_utils::parsing::ParseStr<'a/#0, Pos/#2>, 'a/#0], def_id: DefId(24:428 ~ flams_utils[9611]::parsing::ParseSource::Pos), .. })>, quickparse::stex::DiagnosticLevel)], def_id: DefId(2:3806 ~ core[05ee]::ops::function::FnOnce::Output), .. }, depth=1)` with poly_projection `Binder { value: ProjectionPredicate(AliasTerm { args: [Err/#4, (std::string::String, flams_utils::sourcerefs::SourceRange<Alias(Projection, AliasTy { args: [flams_utils::parsing::ParseStr<'a/#0, Pos/#2>, 'a/#0], def_id: DefId(24:428 ~ flams_utils[9611]::parsing::ParseSource::Pos), .. })>, quickparse::stex::DiagnosticLevel)], def_id: DefId(2:3806 ~ core[05ee]::ops::function::FnOnce::Output), .. }, Term::Ty(())), bound_vars: [] }`: Sorts(ExpectedFound { expected: Alias(Projection, AliasTy { args: [flams_utils::parsing::ParseStr<'a/#0, Pos/#2>, 'a/#0], def_id: DefId(24:428 ~ flams_utils[9611]::parsing::ParseSource::Pos), .. }), found: Pos/#2 })
  |
  = note: delayed at compiler/rustc_trait_selection/src/traits/project.rs:2001:23
             0: <rustc_errors::DiagCtxtInner>::emit_diagnostic
             1: <rustc_errors::DiagCtxtHandle>::emit_diagnostic
             2: <rustc_span::ErrorGuaranteed as rustc_errors::diagnostic::EmissionGuarantee>::emit_producing_guarantee
             3: <rustc_errors::DiagCtxtHandle>::span_delayed_bug::<rustc_span::span_encoding::Span, alloc::string::String>
             4: rustc_trait_selection::traits::project::confirm_param_env_candidate
             5: rustc_trait_selection::traits::project::opt_normalize_projection_term
             6: rustc_trait_selection::traits::project::poly_project_and_unify_term
             7: <rustc_trait_selection::traits::auto_trait::AutoTraitFinder>::evaluate_predicates
             8: rustdoc::clean::auto_trait::synthesize_auto_trait_impl
             9: rustdoc::clean::utils::synthesize_auto_trait_and_blanket_impls
            10: <rustdoc::passes::collect_trait_impls::SyntheticImplCollector as rustdoc::visit::DocVisitor>::visit_item
            11: <rustdoc::passes::collect_trait_impls::SyntheticImplCollector as rustdoc::visit::DocVisitor>::visit_item
            12: <rustdoc::passes::collect_trait_impls::SyntheticImplCollector as rustdoc::visit::DocVisitor>::visit_item
            13: <rustdoc::passes::collect_trait_impls::SyntheticImplCollector as rustdoc::visit::DocVisitor>::visit_item
            14: rustdoc::passes::collect_trait_impls::collect_trait_impls
            15: rustdoc::core::run_global_ctxt
            16: rustdoc::main_args::{closure#2}::{closure#0}
            17: rustc_interface::interface::run_compiler::<(), rustdoc::main_args::{closure#2}>::{closure#1}
            18: std::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<(), rustdoc::main_args::{closure#2}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
            19: <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<(), rustdoc::main_args::{closure#2}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
            20: std::sys::pal::unix::thread::Thread::new::thread_start
            21: start_thread
                       at ./nptl/pthread_create.c:447:8
            22: clone3
                       at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:78:0
          

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/jazzpirate/work/Software/sTeX/iMMT/rustc-ice-2025-02-09T16_53_20-895291.txt` to your bug report

note: compiler flags: --crate-type lib -Z unstable-options

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

query stack during panic:
end of query stack
Backtrace

<backtrace>

Metadata

Metadata

Assignees

Labels

A-auto-traitsArea: auto traits (e.g., `auto trait Send {}`)A-synthetic-implsArea: Synthetic impls, used by rustdoc to document auto traits and traits with blanket implsC-bugCategory: This is a bug.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.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions