Skip to content
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

ice: WARN rustc_infer::infer::generalize may incompletely handle alias type / 'called Result::unwrap_err() on an Ok value: ?4t', ice + weird debug output #118696

Closed
matthiaskrgr opened this issue Dec 7, 2023 · 6 comments
Labels
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. T-types Relevant to the types team, which will review and decide on the PR/issue.

Comments

@matthiaskrgr
Copy link
Member

auto-reduced (treereduce-rust):

trait ToUnit<'a> {
    type Unit;
}

struct LocalTy;
impl<'a> ToUnit<'a> for *const LocalTy {}

impl<'a, T: Copy + ?Sized> ToUnit<'a> for *const T {}

trait Overlap<T> {}

type Assoc<'a, T> = <*const T as ToUnit<'a>>::Unit;

impl<T> Overlap<T> for T {}

impl<T> Overlap<for<'a> fn(&'a (), Assoc<'a, T>)> for T where for<'a> *const T: Overlap<T> {}

original:

// revisions: old next
//[next] compile-flags: -Ztrait-solver=next

// A regression test for #105787

// Using the higher ranked projection hack to prevent us from replacing the projection
// with an inference variable.
trait ToUnit<'a> {
    type Unit;
}

struct LocalTy;
impl<'a> ToUnit<'a> for *const LocalTy {
    type Unit = ();
}

impl<'a, T: Copy + ?Sized> ToUnit<'a> for *const T {
    type Unit = ();
}

trait Overlap<T> {
    type Assoc;
}

type Assoc<'a, T> = <*const T as ToUnit<'a>>::Unit;

impl<T> Overlap<T> for T {
    type Assoc = usize;
}

impl<T> Overlap<for<'a> fn(&'a (), Assoc<'a, T>)> for T
//~^ ERROR conflicting implementations of trait
where
    for<'a> *const T: Overlap<T>,
{
    type Assoc = Box<usize>;
}

fn foo<T: Overlap<U>, U>(x: T::Assoc) -> T::Assoc {
    x
}

fn main() {
    foo::<for<'a> fn(&'a (), ()), for<'a> fn(&'a (), ())>(3usize);
}

Version information

rustc 1.76.0-nightly (f32d29837 2023-12-06)
binary: rustc
commit-hash: f32d29837d3642475e23716cd8af5711d00c01ae
commit-date: 2023-12-06
host: x86_64-unknown-linux-gnu
release: 1.76.0-nightly
LLVM version: 17.0.5

Command:
/home/matthias/.rustup/toolchains/master/bin/rustc

Program output

error[E0601]: `main` function not found in crate `mvce`
  --> /tmp/icemaker_global_tempdir.tY9BgKNIQG1j/rustc_testrunner_tmpdir_reporting.1KC2ZNRG81SS/mvce.rs:16:94
   |
16 | impl<T> Overlap<for<'a> fn(&'a (), Assoc<'a, T>)> for T where for<'a> *const T: Overlap<T> {}
   |                                                                                              ^ consider adding a `main` function to `/tmp/icemaker_global_tempdir.tY9BgKNIQG1j/rustc_testrunner_tmpdir_reporting.1KC2ZNRG81SS/mvce.rs`

WARN rustc_infer::infer::generalize may incompletely handle alias type: Alias(Projection, AliasTy { args: [*const ?1t, ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:23 ~ mvce[4d9c]::{impl#3}::'a#1), 'a) })], def_id: DefId(0:5 ~ mvce[4d9c]::ToUnit::Unit) })
WARN rustc_infer::infer::generalize may incompletely handle alias type: Alias(Projection, AliasTy { args: [*const ?1t, RePlaceholder(!3_BoundRegion { var: 0, kind: BrNamed(DefId(0:23 ~ mvce[4d9c]::{impl#3}::'a#1), 'a) })], def_id: DefId(0:5 ~ mvce[4d9c]::ToUnit::Unit) })
WARN rustc_infer::infer::generalize may incompletely handle alias type: Alias(Projection, AliasTy { args: [*const ?5t, RePlaceholder(!5_BoundRegion { var: 0, kind: BrNamed(DefId(0:23 ~ mvce[4d9c]::{impl#3}::'a#1), 'a) })], def_id: DefId(0:5 ~ mvce[4d9c]::ToUnit::Unit) })
thread 'rustc' panicked at compiler/rustc_infer/src/infer/generalize.rs:28:40:
called `Result::unwrap_err()` on an `Ok` value: ?4t
stack backtrace:
   0:     0x7fed605d745c - std::backtrace_rs::backtrace::libunwind::trace::h05b6a3fdb7984b42
                               at /rustc/f32d29837d3642475e23716cd8af5711d00c01ae/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5
   1:     0x7fed605d745c - std::backtrace_rs::backtrace::trace_unsynchronized::h598b668ef45ec588
                               at /rustc/f32d29837d3642475e23716cd8af5711d00c01ae/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7fed605d745c - std::sys_common::backtrace::_print_fmt::hbefb24ad1b1e1b2a
                               at /rustc/f32d29837d3642475e23716cd8af5711d00c01ae/library/std/src/sys_common/backtrace.rs:68:5
   3:     0x7fed605d745c - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h4780316eb305e509
                               at /rustc/f32d29837d3642475e23716cd8af5711d00c01ae/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7fed6062a4a0 - core::fmt::rt::Argument::fmt::h5cb309a7c172eabe
                               at /rustc/f32d29837d3642475e23716cd8af5711d00c01ae/library/core/src/fmt/rt.rs:142:9
   5:     0x7fed6062a4a0 - core::fmt::write::h6308397b9e39079a
                               at /rustc/f32d29837d3642475e23716cd8af5711d00c01ae/library/core/src/fmt/mod.rs:1120:17
   6:     0x7fed605cb34f - std::io::Write::write_fmt::ha9de23c18c6ad43b
                               at /rustc/f32d29837d3642475e23716cd8af5711d00c01ae/library/std/src/io/mod.rs:1810:15
   7:     0x7fed605d7244 - std::sys_common::backtrace::_print::h12314f11f05d3175
                               at /rustc/f32d29837d3642475e23716cd8af5711d00c01ae/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7fed605d7244 - std::sys_common::backtrace::print::h2ee0c1070160e61c
                               at /rustc/f32d29837d3642475e23716cd8af5711d00c01ae/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7fed605d9ed7 - std::panicking::default_hook::{{closure}}::h8e9e3d82075b4ca5
  10:     0x7fed605d9c3f - std::panicking::default_hook::hc6307ef37ca7e274
                               at /rustc/f32d29837d3642475e23716cd8af5711d00c01ae/library/std/src/panicking.rs:292:9
  11:     0x7fed5d2f6f30 - std[f19864afa78103cd]::panicking::update_hook::<alloc[2aa8f2c60f7e6c66]::boxed::Box<rustc_driver_impl[5d68deab5a6eda66]::install_ice_hook::{closure#0}>>::{closure#0}
  12:     0x7fed605da618 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h1331fce690faa3ac
                               at /rustc/f32d29837d3642475e23716cd8af5711d00c01ae/library/alloc/src/boxed.rs:2021:9
  13:     0x7fed605da618 - std::panicking::rust_panic_with_hook::h966b13c595fb6a12
                               at /rustc/f32d29837d3642475e23716cd8af5711d00c01ae/library/std/src/panicking.rs:783:13
  14:     0x7fed605da36e - std::panicking::begin_panic_handler::{{closure}}::hfef9796ac34a1d90
                               at /rustc/f32d29837d3642475e23716cd8af5711d00c01ae/library/std/src/panicking.rs:657:13
  15:     0x7fed605d7926 - std::sys_common::backtrace::__rust_end_short_backtrace::h3b5384eeaf17c0a1
                               at /rustc/f32d29837d3642475e23716cd8af5711d00c01ae/library/std/src/sys_common/backtrace.rs:171:18
  16:     0x7fed605da0d2 - rust_begin_unwind
                               at /rustc/f32d29837d3642475e23716cd8af5711d00c01ae/library/std/src/panicking.rs:645:5
  17:     0x7fed60626b65 - core::panicking::panic_fmt::h4a9c5999dba52929
                               at /rustc/f32d29837d3642475e23716cd8af5711d00c01ae/library/core/src/panicking.rs:72:14
  18:     0x7fed60627273 - core::result::unwrap_failed::he5de6a6e1050fec5
                               at /rustc/f32d29837d3642475e23716cd8af5711d00c01ae/library/core/src/result.rs:1649:5
  19:     0x7fed5e65a276 - <rustc_infer[231235591c7201f1]::infer::combine::CombineFields>::instantiate
  20:     0x7fed5e63c28b - <rustc_infer[231235591c7201f1]::infer::sub::Sub as rustc_middle[abf3d24358494a96]::ty::relate::TypeRelation>::tys
  21:     0x7fed5ee6d1a4 - <core[c98a5e2a9f438e2a]::iter::adapters::enumerate::Enumerate<core[c98a5e2a9f438e2a]::iter::adapters::map::Map<core[c98a5e2a9f438e2a]::iter::adapters::chain::Chain<core[c98a5e2a9f438e2a]::iter::adapters::map::Map<core[c98a5e2a9f438e2a]::iter::adapters::zip::Zip<core[c98a5e2a9f438e2a]::slice::iter::Iter<rustc_middle[abf3d24358494a96]::ty::Ty>, core[c98a5e2a9f438e2a]::slice::iter::Iter<rustc_middle[abf3d24358494a96]::ty::Ty>>, <rustc_middle[abf3d24358494a96]::ty::sty::FnSig as rustc_middle[abf3d24358494a96]::ty::relate::Relate>::relate<rustc_infer[231235591c7201f1]::infer::sub::Sub>::{closure#0}>, core[c98a5e2a9f438e2a]::iter::sources::once::Once<((rustc_middle[abf3d24358494a96]::ty::Ty, rustc_middle[abf3d24358494a96]::ty::Ty), bool)>>, <rustc_middle[abf3d24358494a96]::ty::sty::FnSig as rustc_middle[abf3d24358494a96]::ty::relate::Relate>::relate<rustc_infer[231235591c7201f1]::infer::sub::Sub>::{closure#1}>> as core[c98a5e2a9f438e2a]::iter::traits::iterator::Iterator>::try_fold::<(), core[c98a5e2a9f438e2a]::iter::adapters::map::map_try_fold<(usize, core[c98a5e2a9f438e2a]::result::Result<rustc_middle[abf3d24358494a96]::ty::Ty, rustc_middle[abf3d24358494a96]::ty::error::TypeError>), core[c98a5e2a9f438e2a]::result::Result<rustc_middle[abf3d24358494a96]::ty::Ty, rustc_middle[abf3d24358494a96]::ty::error::TypeError>, (), core[c98a5e2a9f438e2a]::ops::control_flow::ControlFlow<core[c98a5e2a9f438e2a]::ops::control_flow::ControlFlow<rustc_middle[abf3d24358494a96]::ty::Ty>>, <rustc_middle[abf3d24358494a96]::ty::sty::FnSig as rustc_middle[abf3d24358494a96]::ty::relate::Relate>::relate<rustc_infer[231235591c7201f1]::infer::sub::Sub>::{closure#2}, <core[c98a5e2a9f438e2a]::iter::adapters::GenericShunt<core[c98a5e2a9f438e2a]::iter::adapters::map::Map<core[c98a5e2a9f438e2a]::iter::adapters::enumerate::Enumerate<core[c98a5e2a9f438e2a]::iter::adapters::map::Map<core[c98a5e2a9f438e2a]::iter::adapters::chain::Chain<core[c98a5e2a9f438e2a]::iter::adapters::map::Map<core[c98a5e2a9f438e2a]::iter::adapters::zip::Zip<core[c98a5e2a9f438e2a]::slice::iter::Iter<rustc_middle[abf3d24358494a96]::ty::Ty>, core[c98a5e2a9f438e2a]::slice::iter::Iter<rustc_middle[abf3d24358494a96]::ty::Ty>>, <rustc_middle[abf3d24358494a96]::ty::sty::FnSig as rustc_middle[abf3d24358494a96]::ty::relate::Relate>::relate<rustc_infer[231235591c7201f1]::infer::sub::Sub>::{closure#0}>, core[c98a5e2a9f438e2a]::iter::sources::once::Once<((rustc_middle[abf3d24358494a96]::ty::Ty, rustc_middle[abf3d24358494a96]::ty::Ty), bool)>>, <rustc_middle[abf3d24358494a96]::ty::sty::FnSig as rustc_middle[abf3d24358494a96]::ty::relate::Relate>::relate<rustc_infer[231235591c7201f1]::infer::sub::Sub>::{closure#1}>>, <rustc_middle[abf3d24358494a96]::ty::sty::FnSig as rustc_middle[abf3d24358494a96]::ty::relate::Relate>::relate<rustc_infer[231235591c7201f1]::infer::sub::Sub>::{closure#2}>, core[c98a5e2a9f438e2a]::result::Result<core[c98a5e2a9f438e2a]::convert::Infallible, rustc_middle[abf3d24358494a96]::ty::error::TypeError>> as core[c98a5e2a9f438e2a]::iter::traits::iterator::Iterator>::try_fold<(), core[c98a5e2a9f438e2a]::iter::traits::iterator::Iterator::try_for_each::call<rustc_middle[abf3d24358494a96]::ty::Ty, core[c98a5e2a9f438e2a]::ops::control_flow::ControlFlow<rustc_middle[abf3d24358494a96]::ty::Ty>, core[c98a5e2a9f438e2a]::ops::control_flow::ControlFlow<rustc_middle[abf3d24358494a96]::ty::Ty>::Break>::{closure#0}, core[c98a5e2a9f438e2a]::ops::control_flow::ControlFlow<rustc_middle[abf3d24358494a96]::ty::Ty>>::{closure#0}>::{closure#0}, core[c98a5e2a9f438e2a]::ops::control_flow::ControlFlow<core[c98a5e2a9f438e2a]::ops::control_flow::ControlFlow<rustc_middle[abf3d24358494a96]::ty::Ty>>>
  22:     0x7fed5ee6cca7 - <rustc_infer[231235591c7201f1]::infer::combine::CombineFields>::higher_ranked_sub::<rustc_middle[abf3d24358494a96]::ty::sty::FnSig>
  23:     0x7fed5ee6c1f7 - <rustc_middle[abf3d24358494a96]::ty::sty::Binder<rustc_middle[abf3d24358494a96]::ty::sty::FnSig> as rustc_middle[abf3d24358494a96]::ty::relate::Relate>::relate::<rustc_infer[231235591c7201f1]::infer::equate::Equate>
  24:     0x7fed5e65c665 - <rustc_infer[231235591c7201f1]::infer::InferCtxt>::super_combine_tys::<rustc_infer[231235591c7201f1]::infer::equate::Equate>
  25:     0x7fed5e65a9a6 - <rustc_infer[231235591c7201f1]::infer::equate::Equate as rustc_middle[abf3d24358494a96]::ty::relate::TypeRelation>::tys
  26:     0x7fed5f04e229 - <rustc_trait_selection[18b1413cf292a40b]::traits::select::SelectionContext>::confirm_candidate
  27:     0x7fed5f03ee17 - <rustc_trait_selection[18b1413cf292a40b]::traits::select::SelectionContext>::evaluate_candidate
  28:     0x7fed5f013078 - <rustc_trait_selection[18b1413cf292a40b]::traits::select::SelectionContext>::evaluate_trait_predicate_recursively
  29:     0x7fed5f344d7f - <rustc_trait_selection[18b1413cf292a40b]::traits::select::SelectionContext>::evaluation_probe::<<rustc_trait_selection[18b1413cf292a40b]::traits::select::SelectionContext>::evaluate_root_obligation::{closure#0}>
  30:     0x7fed5f343308 - rustc_trait_selection[18b1413cf292a40b]::traits::coherence::overlap
  31:     0x7fed5ec2a8bd - <rustc_middle[abf3d24358494a96]::traits::specialization_graph::Children as rustc_trait_selection[18b1413cf292a40b]::traits::specialize::specialization_graph::ChildrenExt>::insert
  32:     0x7fed5ec29ea9 - <rustc_middle[abf3d24358494a96]::traits::specialization_graph::Graph as rustc_trait_selection[18b1413cf292a40b]::traits::specialize::specialization_graph::GraphExt>::insert
  33:     0x7fed5f1024ca - rustc_trait_selection[18b1413cf292a40b]::traits::specialize::specialization_graph_provider
  34:     0x7fed5f101ef2 - rustc_query_impl[516b0f6d3c576e47]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[516b0f6d3c576e47]::query_impl::specialization_graph_of::dynamic_query::{closure#2}::{closure#0}, rustc_middle[abf3d24358494a96]::query::erase::Erased<[u8; 8usize]>>
  35:     0x7fed5e6513d4 - rustc_query_system[63b2eb5e5eb99e14]::query::plumbing::try_execute_query::<rustc_query_impl[516b0f6d3c576e47]::DynamicConfig<rustc_query_system[63b2eb5e5eb99e14]::query::caches::DefaultCache<rustc_span[24843a324ed31ab0]::def_id::DefId, rustc_middle[abf3d24358494a96]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[516b0f6d3c576e47]::plumbing::QueryCtxt, false>
  36:     0x7fed5ea468a2 - rustc_query_impl[516b0f6d3c576e47]::query_impl::specialization_graph_of::get_query_non_incr::__rust_end_short_backtrace
  37:     0x7fed5ea46c9d - rustc_hir_analysis[650abdd69e2e0337]::coherence::coherent_trait
  38:     0x7fed5ea46b89 - rustc_query_impl[516b0f6d3c576e47]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[516b0f6d3c576e47]::query_impl::coherent_trait::dynamic_query::{closure#2}::{closure#0}, rustc_middle[abf3d24358494a96]::query::erase::Erased<[u8; 0usize]>>
  39:     0x7fed5f0114bd - rustc_query_system[63b2eb5e5eb99e14]::query::plumbing::try_execute_query::<rustc_query_impl[516b0f6d3c576e47]::DynamicConfig<rustc_query_system[63b2eb5e5eb99e14]::query::caches::DefaultCache<rustc_span[24843a324ed31ab0]::def_id::DefId, rustc_middle[abf3d24358494a96]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[516b0f6d3c576e47]::plumbing::QueryCtxt, false>
  40:     0x7fed5f01124d - rustc_query_impl[516b0f6d3c576e47]::query_impl::coherent_trait::get_query_non_incr::__rust_end_short_backtrace
  41:     0x7fed5f0364ea - rustc_hir_analysis[650abdd69e2e0337]::check_crate
  42:     0x7fed5eec32e2 - rustc_interface[403c7d9aab312e25]::passes::analysis
  43:     0x7fed5eec2f1d - rustc_query_impl[516b0f6d3c576e47]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[516b0f6d3c576e47]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[abf3d24358494a96]::query::erase::Erased<[u8; 1usize]>>
  44:     0x7fed5f560a00 - rustc_query_system[63b2eb5e5eb99e14]::query::plumbing::try_execute_query::<rustc_query_impl[516b0f6d3c576e47]::DynamicConfig<rustc_query_system[63b2eb5e5eb99e14]::query::caches::SingleCache<rustc_middle[abf3d24358494a96]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[516b0f6d3c576e47]::plumbing::QueryCtxt, false>
  45:     0x7fed5f560807 - rustc_query_impl[516b0f6d3c576e47]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  46:     0x7fed5f56f0e2 - rustc_interface[403c7d9aab312e25]::interface::run_compiler::<core[c98a5e2a9f438e2a]::result::Result<(), rustc_span[24843a324ed31ab0]::ErrorGuaranteed>, rustc_driver_impl[5d68deab5a6eda66]::run_compiler::{closure#0}>::{closure#0}
  47:     0x7fed5f5624c9 - std[f19864afa78103cd]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[403c7d9aab312e25]::util::run_in_thread_with_globals<rustc_interface[403c7d9aab312e25]::util::run_in_thread_pool_with_globals<rustc_interface[403c7d9aab312e25]::interface::run_compiler<core[c98a5e2a9f438e2a]::result::Result<(), rustc_span[24843a324ed31ab0]::ErrorGuaranteed>, rustc_driver_impl[5d68deab5a6eda66]::run_compiler::{closure#0}>::{closure#0}, core[c98a5e2a9f438e2a]::result::Result<(), rustc_span[24843a324ed31ab0]::ErrorGuaranteed>>::{closure#0}, core[c98a5e2a9f438e2a]::result::Result<(), rustc_span[24843a324ed31ab0]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[c98a5e2a9f438e2a]::result::Result<(), rustc_span[24843a324ed31ab0]::ErrorGuaranteed>>
  48:     0x7fed5f5622f3 - <<std[f19864afa78103cd]::thread::Builder>::spawn_unchecked_<rustc_interface[403c7d9aab312e25]::util::run_in_thread_with_globals<rustc_interface[403c7d9aab312e25]::util::run_in_thread_pool_with_globals<rustc_interface[403c7d9aab312e25]::interface::run_compiler<core[c98a5e2a9f438e2a]::result::Result<(), rustc_span[24843a324ed31ab0]::ErrorGuaranteed>, rustc_driver_impl[5d68deab5a6eda66]::run_compiler::{closure#0}>::{closure#0}, core[c98a5e2a9f438e2a]::result::Result<(), rustc_span[24843a324ed31ab0]::ErrorGuaranteed>>::{closure#0}, core[c98a5e2a9f438e2a]::result::Result<(), rustc_span[24843a324ed31ab0]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[c98a5e2a9f438e2a]::result::Result<(), rustc_span[24843a324ed31ab0]::ErrorGuaranteed>>::{closure#1} as core[c98a5e2a9f438e2a]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  49:     0x7fed605e44a5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::ha603a9d78630b4d9
                               at /rustc/f32d29837d3642475e23716cd8af5711d00c01ae/library/alloc/src/boxed.rs:2007:9
  50:     0x7fed605e44a5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hdd9615f963a03fca
                               at /rustc/f32d29837d3642475e23716cd8af5711d00c01ae/library/alloc/src/boxed.rs:2007:9
  51:     0x7fed605e44a5 - std::sys::unix::thread::Thread::new::thread_start::h15fde3375b9b660d
                               at /rustc/f32d29837d3642475e23716cd8af5711d00c01ae/library/std/src/sys/unix/thread.rs:108:17
  52:     0x7fed5a4aa9eb - <unknown>
  53:     0x7fed5a52e7cc - <unknown>
  54:                0x0 - <unknown>

error: 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.76.0-nightly (f32d29837 2023-12-06) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [specialization_graph_of] building specialization graph of trait `Overlap`
#1 [coherent_trait] coherence checking all impls of trait `Overlap`
#2 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0601`.

@matthiaskrgr matthiaskrgr added 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. C-bug Category: This is a bug. labels Dec 7, 2023
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Dec 7, 2023
@matthiaskrgr matthiaskrgr changed the title ice: WARN rustc_infer::infer::generalize may incompletely handle alias type / 'called Result::unwrap_err() on an Ok value: ?4t' ice: WARN rustc_infer::infer::generalize may incompletely handle alias type / 'called Result::unwrap_err() on an Ok value: ?4t', ice + weird debug output Dec 7, 2023
@matthiaskrgr
Copy link
Member Author

warn

@saethlin saethlin removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Dec 7, 2023
@Noratrieb Noratrieb added the T-types Relevant to the types team, which will review and decide on the PR/issue. label Dec 7, 2023
@spastorino
Copy link
Member

I think this is fixed by #118710. Maybe worth adding the test case produced by @matthiaskrgr

@matthiaskrgr
Copy link
Member Author

fwiw the ICE is fixed but I can still see the warnings comming from here
https://github.com/rust-lang/rust/blob/master/compiler/rustc_infer/src/infer/generalize.rs#L353
cc @lcnr

@lcnr
Copy link
Contributor

lcnr commented Dec 9, 2023

yeah, the warning is expected and also present in the original ui test 🤔 I personally think that the added debug assert in #118710 is sufficient to prevent any regressions here, given that it triggers when compiling std without the fix. closing 👍 nice to see that there's some repro without rustdoc though ^^

@lcnr lcnr closed this as completed Dec 9, 2023
@spastorino
Copy link
Member

Should we add this test?

@lcnr
Copy link
Contributor

lcnr commented Dec 9, 2023

🤷 I think that adding broken code as tests for unrelated stuff is a bit :/ so I would personally let it be

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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. T-types Relevant to the types team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

6 participants