rustdoc: ICE: synthetic blanket impls: no errors encountered even though span_delayed_bug issued · Issue #119792 · rust-lang/rust (original) (raw)

This only happens with rust doc.

Crate builds and runs tests successfully on current master: https://gitlab.com/spearman/math-utils-rs/-/commit/9a16929f40de8a21815cae85d889bca8edf28ae2

ICE occurs with $ cargo doc --no-deps

Code

The backtrace doesn't seem to point to any specific code in the crate.

Meta

rustc --version --verbose:

rustc 1.77.0-nightly (190f4c961 2024-01-09)
binary: rustc
commit-hash: 190f4c96116a3b59b7de4881cfec544be0246d84
commit-date: 2024-01-09
host: x86_64-unknown-linux-gnu
release: 1.77.0-nightly
LLVM version: 17.0.6

Error output

Backtrace

$ cargo doc --no-deps
 Documenting math-utils v0.0.13 (/home/spearman/rs/local/utils-math)
error: internal compiler error: no errors encountered even though `span_delayed_bug` issued

error: internal compiler error: Impl DefId(0:4614 ~ math_utils[6851]::types::{impl#286}) was matchable against Obligation(predicate=Binder { value: TraitPredicate(<types::AngleWrapped<_> as std::ops::Rem<_>>, polarity:Positive), bound_vars: [] }, depth=2) but now is not
  |
  = note: delayed at compiler/rustc_trait_selection/src/traits/select/mod.rs:2429:45
             0: <rustc_errors::DiagCtxtInner>::emit_diagnostic
             1: <rustc_errors::DiagCtxt>::emit_diagnostic
             2: <rustc_errors::DiagCtxt>::span_delayed_bug::<rustc_span::span_encoding::Span, alloc:🧵:String>
             3: <rustc_trait_selection::traits::select::SelectionContext>::poly_select
             4: rustc_trait_selection::traits::project::opt_normalize_projection_type
             5: rustc_trait_selection::traits::project::poly_project_and_unify_type
             6: <rustc_trait_selection::traits::select::SelectionContext>::evaluate_candidate
             7: <rustc_trait_selection::traits::select::SelectionContext>::evaluate_trait_predicate_recursively
             8: <rustc_trait_selection::traits::select::SelectionContext>::evaluation_probe::<<rustc_trait_selection::traits::select::SelectionContext>::evaluate_root_obligation::{closure#0}>
             9: rustc_traits::evaluate_obligation::evaluate_obligation
            10: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::evaluate_obligation::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 2]>>
            11: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefaultCache<rustc_type_ir::canonical::Canonical<rustc_middle::ty::context::TyCtxt, rustc_middle::ty::ParamEnvAnd<rustc_middle::ty::Predicate>>, rustc_middle::query::erase::Erased<[u8; 2]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
            12: rustc_query_impl::query_impl::evaluate_obligation::get_query_non_incr::__rust_end_short_backtrace
            13: <rustc_infer::infer::InferCtxt as rustc_trait_selection::traits::query::evaluate_obligation::InferCtxtExt>::evaluate_obligation
            14: rustdoc::clean::utils::get_auto_trait_and_blanket_impls
            15: <rustdoc::passes::collect_trait_impls::SyntheticImplCollector as rustdoc::visit::DocVisitor>::visit_item
            16: <rustdoc::passes::collect_trait_impls::SyntheticImplCollector as rustdoc::visit::DocVisitor>::visit_item
            17: <rustdoc::passes::collect_trait_impls::SyntheticImplCollector as rustdoc::visit::DocVisitor>::visit_item
            18: rustdoc::passes::collect_trait_impls::collect_trait_impls
            19: rustdoc::core::run_global_ctxt
            20: rustdoc::main_args::{closure#1}::{closure#0}::{closure#0}
            21: rustc_interface::interface::run_compiler::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustdoc::main_args::{closure#1}>::{closure#0}
            22: std::sys_common::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<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustdoc::main_args::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
            23: <<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<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustdoc::main_args::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
            24: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                       at /rustc/190f4c96116a3b59b7de4881cfec544be0246d84/library/alloc/src/boxed.rs:2016:9
            25: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                       at /rustc/190f4c96116a3b59b7de4881cfec544be0246d84/library/alloc/src/boxed.rs:2016:9
            26: std::sys::unix::thread::Thread:🆕:thread_start
                       at /rustc/190f4c96116a3b59b7de4881cfec544be0246d84/library/std/src/sys/unix/thread.rs:108:17
            27: start_thread
            28: __GI___clone3
          

error: internal compiler error: Impl DefId(0:4713 ~ math_utils[6851]::types::{impl#313}) was matchable against Obligation(predicate=Binder { value: TraitPredicate(<types::AngleWrappedSigned<_> as std::ops::Rem<_>>, polarity:Positive), bound_vars: [] }, depth=2) but now is not
  |
  = note: delayed at compiler/rustc_trait_selection/src/traits/select/mod.rs:2429:45
             0: <rustc_errors::DiagCtxtInner>::emit_diagnostic
             1: <rustc_errors::DiagCtxt>::emit_diagnostic
             2: <rustc_errors::DiagCtxt>::span_delayed_bug::<rustc_span::span_encoding::Span, alloc:🧵:String>
             3: <rustc_trait_selection::traits::select::SelectionContext>::poly_select
             4: rustc_trait_selection::traits::project::opt_normalize_projection_type
             5: rustc_trait_selection::traits::project::poly_project_and_unify_type
             6: <rustc_trait_selection::traits::select::SelectionContext>::evaluate_candidate
             7: <rustc_trait_selection::traits::select::SelectionContext>::evaluate_trait_predicate_recursively
             8: <rustc_trait_selection::traits::select::SelectionContext>::evaluation_probe::<<rustc_trait_selection::traits::select::SelectionContext>::evaluate_root_obligation::{closure#0}>
             9: rustc_traits::evaluate_obligation::evaluate_obligation
            10: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::evaluate_obligation::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 2]>>
            11: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefaultCache<rustc_type_ir::canonical::Canonical<rustc_middle::ty::context::TyCtxt, rustc_middle::ty::ParamEnvAnd<rustc_middle::ty::Predicate>>, rustc_middle::query::erase::Erased<[u8; 2]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
            12: rustc_query_impl::query_impl::evaluate_obligation::get_query_non_incr::__rust_end_short_backtrace
            13: <rustc_infer::infer::InferCtxt as rustc_trait_selection::traits::query::evaluate_obligation::InferCtxtExt>::evaluate_obligation
            14: rustdoc::clean::utils::get_auto_trait_and_blanket_impls
            15: <rustdoc::passes::collect_trait_impls::SyntheticImplCollector as rustdoc::visit::DocVisitor>::visit_item
            16: <rustdoc::passes::collect_trait_impls::SyntheticImplCollector as rustdoc::visit::DocVisitor>::visit_item
            17: <rustdoc::passes::collect_trait_impls::SyntheticImplCollector as rustdoc::visit::DocVisitor>::visit_item
            18: rustdoc::passes::collect_trait_impls::collect_trait_impls
            19: rustdoc::core::run_global_ctxt
            20: rustdoc::main_args::{closure#1}::{closure#0}::{closure#0}
            21: rustc_interface::interface::run_compiler::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustdoc::main_args::{closure#1}>::{closure#0}
            22: std::sys_common::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<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustdoc::main_args::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
            23: <<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<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustdoc::main_args::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
            24: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                       at /rustc/190f4c96116a3b59b7de4881cfec544be0246d84/library/alloc/src/boxed.rs:2016:9
            25: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                       at /rustc/190f4c96116a3b59b7de4881cfec544be0246d84/library/alloc/src/boxed.rs:2016:9
            26: std::sys::unix::thread::Thread:🆕:thread_start
                       at /rustc/190f4c96116a3b59b7de4881cfec544be0246d84/library/std/src/sys/unix/thread.rs:108:17
            27: start_thread
            28: __GI___clone3
          

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 attach the file at `/home/spearman/rs/local/utils-math/rustc-ice-2024-01-10T01_15_36-693223.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 `math-utils`

Caused by:
  process didn't exit successfully: `/home/spearman/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/rustdoc --edition=2021 --crate-type lib --crate-name math_utils src/lib.rs -o /home/spearman/rs/local/utils-math/target/doc --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=199 -C metadata=1228b3c84efd442c -L dependency=/home/spearman/rs/local/utils-math/target/debug/deps --extern cordic=/home/spearman/rs/local/utils-math/target/debug/deps/libcordic-38a1c6708d30398f.rmeta --extern derive_more=/home/spearman/rs/local/utils-math/target/debug/deps/libderive_more-350f12f6eba7e9a6.so --extern either=/home/spearman/rs/local/utils-math/target/debug/deps/libeither-360ce3c4f1737f87.rmeta --extern fixed=/home/spearman/rs/local/utils-math/target/debug/deps/libfixed-e8718b679acab2b3.rmeta --extern fixed_sqrt=/home/spearman/rs/local/utils-math/target/debug/deps/libfixed_sqrt-6fc148de1837bfe5.rmeta --extern rand=/home/spearman/rs/local/utils-math/target/debug/deps/librand-dff2f50eb8111482.rmeta --extern strum=/home/spearman/rs/local/utils-math/target/debug/deps/libstrum-ee1653a868fa76dc.rmeta --extern vek=/home/spearman/rs/local/utils-math/target/debug/deps/libvek-da2680a69e1fa61a.rmeta --crate-version 0.0.13` (exit status: 101)