Skip to content

[ICE]: cargo doc fails for the crate galvyn #163528

Description

@gammelalf

Hi,

my crate galvyn does not build on docs.rs due to a compiler error.

I can reproduce it locally with a simple cargo +nightly doc.

The stable rust version seems fine.

Below are the outputs and versions for my local machine. You can also check https://docs.rs/crate/galvyn/latest/builds.

Code

I don't have a small snippet triggering the error.

If I find the time for it, I will search for one.

Meta

rustc --version --verbose:

rustc 1.101.0-nightly (5c543b0b8 2026-09-29)
binary: rustc
commit-hash: 5c543b0b8c73c7b72bc8284ced4fb22ead15734d
commit-date: 2026-09-29
host: x86_64-unknown-linux-gnu
release: 1.101.0-nightly
LLVM version: 23.1.1

Error output

note: no errors encountered even though delayed bugs were created

note: those delayed bugs will now be shown as internal compiler errors

error: internal compiler error: did not expect successful goal when collecting ambiguity errors for `Binder { value: OutlivesClause(Alias(No, Alias { kind: Projection { def_id: DefId(26:11 ~ tower_service[3c8e]::Service::Future) }, args: [axum::Router<()>, axum::http::Request<axum::body::Body>], .. }), 'static), bound_vars: [] }`
  |
  = note: delayed at /rustc-dev/5c543b0b8c73c7b72bc8284ced4fb22ead15734d/compiler/rustc_trait_selection/src/solve/fulfill/derive_errors.rs:140:29 - disabled backtrace

error: internal compiler error: did not expect successful goal when collecting ambiguity errors for `Binder { value: OutlivesClause(Alias(No, Alias { kind: Projection { def_id: DefId(26:11 ~ tower_service[3c8e]::Service::Future) }, args: [axum::routing::RouterAsService<'?0, axum::body::Body, ()>, axum::http::Request<axum::body::Body>], .. }), 'static), bound_vars: [] }`
  |
  = note: delayed at /rustc-dev/5c543b0b8c73c7b72bc8284ced4fb22ead15734d/compiler/rustc_trait_selection/src/solve/fulfill/derive_errors.rs:140:29 - disabled backtrace

error: internal compiler error: did not expect successful goal when collecting ambiguity errors for `Binder { value: OutlivesClause(Alias(No, Alias { kind: Projection { def_id: DefId(26:11 ~ tower_service[3c8e]::Service::Future) }, args: [axum::routing::RouterIntoService<axum::body::Body, ()>, axum::http::Request<axum::body::Body>], .. }), 'static), bound_vars: [] }`
  |
  = note: delayed at /rustc-dev/5c543b0b8c73c7b72bc8284ced4fb22ead15734d/compiler/rustc_trait_selection/src/solve/fulfill/derive_errors.rs:140:29 - disabled backtrace

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/user/git/galvyn/rustc-ice-2026-09-30T09_10_04-288396.txt` to your bug report

note: rustc 1.101.0-nightly (5c543b0b8 2026-09-29) running on x86_64-unknown-linux-gnu

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 `galvyn`

Backtrace

error: internal compiler error: did not expect successful goal when collecting ambiguity errors for `Binder { value: OutlivesClause(Alias(No, Alias { kind: Projection { def_id: DefId(26:11 ~ tower_service[3c8e]::Service::Future) }, args: [axum::Router<()>, axum::http::Request<axum::body::Body>], .. }), 'static), bound_vars: [] }`
  |
  = note: delayed at /rustc-dev/5c543b0b8c73c7b72bc8284ced4fb22ead15734d/compiler/rustc_trait_selection/src/solve/fulfill/derive_errors.rs:140:29
             0: <rustc_errors::DiagCtxtInner>::emit_diagnostic
             1: <rustc_errors::DiagCtxtHandle>::emit_diagnostic
             2: <rustc_errors::diagnostic::Diag>::emit_err
             3: <rustc_errors::DiagCtxtHandle>::span_delayed_bug::<rustc_span::span_encoding::Span, alloc::string::String>
             4: rustc_trait_selection::solve::fulfill::collect_remaining_errors_impl::<rustc_infer::traits::engine::ScrubbedTraitError>
             5: <rustc_trait_selection::traits::engine::FulfillmentEngine<rustc_infer::traits::engine::ScrubbedTraitError> as rustc_infer::traits::engine::TraitEngine<rustc_infer::traits::engine::ScrubbedTraitError>>::evaluate_obligations_error_on_ambiguity
             6: <rustc_infer::infer::InferCtxt as rustc_trait_selection::traits::query::evaluate_obligation::InferCtxtExt>::evaluate_obligation
             7: rustdoc::clean::utils::synthesize_auto_trait_and_blanket_impls
             8: <rustdoc::passes::collect_trait_impls::SyntheticImplCollector as rustdoc::visit::DocVisitor>::visit_item
             9: <rustdoc::passes::collect_trait_impls::SyntheticImplCollector as rustdoc::visit::DocVisitor>::visit_item
            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: <rustc_session::session::Session>::time::<rustdoc::clean::types::Crate, rustdoc::passes::run::{closure#0}>
            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#2}
            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#2}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
            19: <std::thread::lifecycle::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#2}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
            20: <std::sys::thread::unix::Thread>::new::thread_start
            21: <unknown>
            22: <unknown>
          

error: internal compiler error: did not expect successful goal when collecting ambiguity errors for `Binder { value: OutlivesClause(Alias(No, Alias { kind: Projection { def_id: DefId(26:11 ~ tower_service[3c8e]::Service::Future) }, args: [axum::routing::RouterAsService<'?0, axum::body::Body, ()>, axum::http::Request<axum::body::Body>], .. }), 'static), bound_vars: [] }`
  |
  = note: delayed at /rustc-dev/5c543b0b8c73c7b72bc8284ced4fb22ead15734d/compiler/rustc_trait_selection/src/solve/fulfill/derive_errors.rs:140:29
             0: <rustc_errors::DiagCtxtInner>::emit_diagnostic
             1: <rustc_errors::DiagCtxtHandle>::emit_diagnostic
             2: <rustc_errors::diagnostic::Diag>::emit_err
             3: <rustc_errors::DiagCtxtHandle>::span_delayed_bug::<rustc_span::span_encoding::Span, alloc::string::String>
             4: rustc_trait_selection::solve::fulfill::collect_remaining_errors_impl::<rustc_infer::traits::engine::ScrubbedTraitError>
             5: <rustc_trait_selection::traits::engine::FulfillmentEngine<rustc_infer::traits::engine::ScrubbedTraitError> as rustc_infer::traits::engine::TraitEngine<rustc_infer::traits::engine::ScrubbedTraitError>>::evaluate_obligations_error_on_ambiguity
             6: <rustc_infer::infer::InferCtxt as rustc_trait_selection::traits::query::evaluate_obligation::InferCtxtExt>::evaluate_obligation
             7: rustdoc::clean::utils::synthesize_auto_trait_and_blanket_impls
             8: <rustdoc::passes::collect_trait_impls::SyntheticImplCollector as rustdoc::visit::DocVisitor>::visit_item
             9: <rustdoc::passes::collect_trait_impls::SyntheticImplCollector as rustdoc::visit::DocVisitor>::visit_item
            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: <rustc_session::session::Session>::time::<rustdoc::clean::types::Crate, rustdoc::passes::run::{closure#0}>
            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#2}
            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#2}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
            19: <std::thread::lifecycle::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#2}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
            20: <std::sys::thread::unix::Thread>::new::thread_start
            21: <unknown>
            22: <unknown>
          

error: internal compiler error: did not expect successful goal when collecting ambiguity errors for `Binder { value: OutlivesClause(Alias(No, Alias { kind: Projection { def_id: DefId(26:11 ~ tower_service[3c8e]::Service::Future) }, args: [axum::routing::RouterIntoService<axum::body::Body, ()>, axum::http::Request<axum::body::Body>], .. }), 'static), bound_vars: [] }`
  |
  = note: delayed at /rustc-dev/5c543b0b8c73c7b72bc8284ced4fb22ead15734d/compiler/rustc_trait_selection/src/solve/fulfill/derive_errors.rs:140:29
             0: <rustc_errors::DiagCtxtInner>::emit_diagnostic
             1: <rustc_errors::DiagCtxtHandle>::emit_diagnostic
             2: <rustc_errors::diagnostic::Diag>::emit_err
             3: <rustc_errors::DiagCtxtHandle>::span_delayed_bug::<rustc_span::span_encoding::Span, alloc::string::String>
             4: rustc_trait_selection::solve::fulfill::collect_remaining_errors_impl::<rustc_infer::traits::engine::ScrubbedTraitError>
             5: <rustc_trait_selection::traits::engine::FulfillmentEngine<rustc_infer::traits::engine::ScrubbedTraitError> as rustc_infer::traits::engine::TraitEngine<rustc_infer::traits::engine::ScrubbedTraitError>>::evaluate_obligations_error_on_ambiguity
             6: <rustc_infer::infer::InferCtxt as rustc_trait_selection::traits::query::evaluate_obligation::InferCtxtExt>::evaluate_obligation
             7: rustdoc::clean::utils::synthesize_auto_trait_and_blanket_impls
             8: <rustdoc::passes::collect_trait_impls::SyntheticImplCollector as rustdoc::visit::DocVisitor>::visit_item
             9: <rustdoc::passes::collect_trait_impls::SyntheticImplCollector as rustdoc::visit::DocVisitor>::visit_item
            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: <rustc_session::session::Session>::time::<rustdoc::clean::types::Crate, rustdoc::passes::run::{closure#0}>
            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#2}
            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#2}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
            19: <std::thread::lifecycle::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#2}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
            20: <std::sys::thread::unix::Thread>::new::thread_start
            21: <unknown>
            22: <unknown>

Activity

  1. 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.
    C-bugCategory: This is a bug.
    on Sep 30, 2026
  2. added
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Sep 30, 2026
  3. added
    E-needs-bisectionCall for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc
    E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example
    regression-untriagedUntriaged performance or correctness regression.
    on Sep 30, 2026
  4. added
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    on Sep 30, 2026
  5. apiraino commented on Sep 30, 2026

    @apiraino
    Contributor

    just by looking at the error, I think we have already other reports and possibly this could be fixed by #162782

  6. gammelalf commented on Sep 30, 2026

    @gammelalf
    Author

    Sounds plausible.

    I reduced galvyn to the minimal code:

    pub mod core {
        pub use galvyn_core::*;
    }

    galvyn-core contains several definition similar to the example of #162782.

    However, galvyn-core on its own works.

  7. gammelalf commented on Sep 30, 2026

    @gammelalf
    Author

    I reduced it some more:

    // galvyn/src/lib.rs
    pub mod core {
        pub use galvyn_core::*;
    }
    // galvyn-core/src/lib.rs
    
    use std::convert::Infallible;
    
    use axum::extract::Request;
    use axum::response::IntoResponse;
    use tower::Service;
    
    pub mod re_exports {
        pub use axum;
    }
    
    /// Trait alias for [`tower::Service`] constraint to be used by axum
    pub trait AxumService:
        Service<Request, Error = Infallible, Response: IntoResponse, Future: Send + 'static>
    {
    }
    impl<T> AxumService for T where
        T: Service<Request, Error = Infallible, Response: IntoResponse, Future: Send + 'static>
    {
    }

    I tried inline galvyn-core into galvyn, the error would be gone.
    I also tried inlining the tower Service trait, the error would be gone.
    And this reduced galvyn-core on its own works fine.

    https://github.com/myOmikron/galvyn/tree/ice-example

  8. gammelalf commented on Sep 30, 2026

    @gammelalf
    Author

    Final minimal example: (produced by claude)

    pub trait Tr {
        type A;
    }
    
    pub struct S<T>(T);
    
    impl Tr for S<()> {
        type A = ();
    }
    
    pub trait Blanket {}
    
    impl<T: Tr<A: 'static>> Blanket for T {}

    This is almost exactly the same as in #162782

    FYI
    (According to claude) The re-exports were necessary in my initial example to cause rustdoc to generate a page for the struct with a blanket implementation for the two traits. This can also be done by declaring everything in a single crate.

  9. added and removed
    E-needs-bisectionCall for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc
    E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    regression-untriagedUntriaged performance or correctness regression.
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Oct 1, 2026
  10. added
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    on Oct 1, 2026
  11. removed
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    on Oct 1, 2026
  12. lcnr commented on Oct 7, 2026

    @lcnr
    Contributor

    this has been fixed by #162782 afaict. Tried it out locally

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-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.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions