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: cannot relate bound region: ReErased <= ReLateBound(...) #108562

Closed
bugadani opened this issue Feb 28, 2023 · 2 comments · Fixed by #108575
Closed

ICE: cannot relate bound region: ReErased <= ReLateBound(...) #108562

bugadani opened this issue Feb 28, 2023 · 2 comments · Fixed by #108575
Assignees
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.

Comments

@bugadani
Copy link
Contributor

Code

https://rust.godbolt.org/z/7fqj554dv

pub struct Bar<S>(S);

pub trait Foo {}

impl<S> Foo for Bar<S>
where
    for<'a> &'a S: IntoIterator,
    for<'a> <&'a S>::Item: Foo,
{
}

Meta

rustc --version --verbose:

rustc -vV
rustc 1.69.0-nightly (7281249a1 2023-02-27)
binary: rustc
commit-hash: 7281249a19a9755e9d889ee251ec323629caadab
commit-date: 2023-02-27
host: x86_64-pc-windows-msvc
release: 1.69.0-nightly
LLVM version: 15.0.7

Error output

error: internal compiler error: compiler/rustc_infer/src/infer/region_constraints/mod.rs:568:17: cannot relate bound region: ReErased <= ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:12 ~ example[113b]::{impl#0}::'a#1), 'a) })

thread 'rustc' panicked at 'Box<dyn Any>', /rustc/7281249a19a9755e9d889ee251ec323629caadab/compiler/rustc_errors/src/lib.rs:995:33
...
Backtrace

thread 'rustc' panicked at 'Box<dyn Any>', /rustc/7281249a19a9755e9d889ee251ec323629caadab/compiler/rustc_errors/src/lib.rs:995:33
stack backtrace:
   0:     0x7fa589eb7baa - std::backtrace_rs::backtrace::libunwind::trace::hed88b98b82d4f2e9
                               at /rustc/7281249a19a9755e9d889ee251ec323629caadab/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7fa589eb7baa - std::backtrace_rs::backtrace::trace_unsynchronized::ha265951554c18f80
                               at /rustc/7281249a19a9755e9d889ee251ec323629caadab/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7fa589eb7baa - std::sys_common::backtrace::_print_fmt::h905c58b80bf24d6a
                               at /rustc/7281249a19a9755e9d889ee251ec323629caadab/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7fa589eb7baa - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h42fd3bc77561f5c7
                               at /rustc/7281249a19a9755e9d889ee251ec323629caadab/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7fa589f1b2fe - core::fmt::write::hb1a89058387c66a8
                               at /rustc/7281249a19a9755e9d889ee251ec323629caadab/library/core/src/fmt/mod.rs:1232:17
   5:     0x7fa589eaac15 - std::io::Write::write_fmt::h807c51614e4697cf
                               at /rustc/7281249a19a9755e9d889ee251ec323629caadab/library/std/src/io/mod.rs:1684:15
   6:     0x7fa589eb7975 - std::sys_common::backtrace::_print::h94c45e542d878e8b
                               at /rustc/7281249a19a9755e9d889ee251ec323629caadab/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x7fa589eb7975 - std::sys_common::backtrace::print::hf09a0b93d8d5d616
                               at /rustc/7281249a19a9755e9d889ee251ec323629caadab/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x7fa589eba6ef - std::panicking::default_hook::{{closure}}::h854554d33df993ef
                               at /rustc/7281249a19a9755e9d889ee251ec323629caadab/library/std/src/panicking.rs:271:22
   9:     0x7fa589eba42b - std::panicking::default_hook::h47e0374d899bdb79
                               at /rustc/7281249a19a9755e9d889ee251ec323629caadab/library/std/src/panicking.rs:290:9
  10:     0x7fa58d1232f5 - rustc_driver_impl[1328d09be3dc1a8e]::DEFAULT_HOOK::{closure#0}::{closure#0}
  11:     0x7fa589ebaf2d - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::hd6f08b1b7897cbbd
                               at /rustc/7281249a19a9755e9d889ee251ec323629caadab/library/alloc/src/boxed.rs:2002:9
  12:     0x7fa589ebaf2d - std::panicking::rust_panic_with_hook::h73cfebaefb6d5c31
                               at /rustc/7281249a19a9755e9d889ee251ec323629caadab/library/std/src/panicking.rs:696:13
  13:     0x7fa58d4505d1 - std[d01210ab3b315fe2]::panicking::begin_panic::<rustc_errors[724dfc767d977539]::ExplicitBug>::{closure#0}
  14:     0x7fa58d44d3c6 - std[d01210ab3b315fe2]::sys_common::backtrace::__rust_end_short_backtrace::<std[d01210ab3b315fe2]::panicking::begin_panic<rustc_errors[724dfc767d977539]::ExplicitBug>::{closure#0}, !>
  15:     0x7fa58d44cc86 - std[d01210ab3b315fe2]::panicking::begin_panic::<rustc_errors[724dfc767d977539]::ExplicitBug>
  16:     0x7fa58d44cc76 - std[d01210ab3b315fe2]::panic::panic_any::<rustc_errors[724dfc767d977539]::ExplicitBug>
  17:     0x7fa58d449a72 - <rustc_errors[724dfc767d977539]::HandlerInner>::span_bug::<rustc_span[ca1c0a0508e86155]::span_encoding::Span, &alloc[24dd174104beeac0]::string::String>
  18:     0x7fa58d449837 - <rustc_errors[724dfc767d977539]::Handler>::span_bug::<rustc_span[ca1c0a0508e86155]::span_encoding::Span, &alloc[24dd174104beeac0]::string::String>
  19:     0x7fa58d480d2b - rustc_middle[1bc382fc214918e1]::util::bug::opt_span_bug_fmt::<rustc_span[ca1c0a0508e86155]::span_encoding::Span>::{closure#0}
  20:     0x7fa58d480d7a - rustc_middle[1bc382fc214918e1]::ty::context::tls::with_opt::<rustc_middle[1bc382fc214918e1]::util::bug::opt_span_bug_fmt<rustc_span[ca1c0a0508e86155]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  21:     0x7fa58d47fab6 - rustc_middle[1bc382fc214918e1]::ty::context::tls::with_context_opt::<rustc_middle[1bc382fc214918e1]::ty::context::tls::with_opt<rustc_middle[1bc382fc214918e1]::util::bug::opt_span_bug_fmt<rustc_span[ca1c0a0508e86155]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  22:     0x7fa58d47e3a6 - rustc_middle[1bc382fc214918e1]::util::bug::opt_span_bug_fmt::<rustc_span[ca1c0a0508e86155]::span_encoding::Span>
  23:     0x7fa58d47e364 - rustc_middle[1bc382fc214918e1]::util::bug::span_bug_fmt::<rustc_span[ca1c0a0508e86155]::span_encoding::Span>
  24:     0x7fa58b1dedfd - <rustc_infer[8a4c236fb3c80402]::infer::equate::Equate as rustc_middle[1bc382fc214918e1]::ty::relate::TypeRelation>::relate::<rustc_middle[1bc382fc214918e1]::ty::sty::Region>
  25:     0x7fa58b1da06d - rustc_middle[1bc382fc214918e1]::ty::relate::super_relate_tys::<rustc_infer[8a4c236fb3c80402]::infer::equate::Equate>
  26:     0x7fa58b1d7c34 - <rustc_infer[8a4c236fb3c80402]::infer::equate::Equate as rustc_middle[1bc382fc214918e1]::ty::relate::TypeRelation>::tys
  27:     0x7fa58beda53b - <rustc_infer[8a4c236fb3c80402]::infer::InferCtxt>::can_eq::<rustc_middle[1bc382fc214918e1]::ty::Ty>
  28:     0x7fa58d25531b - <&mut core[dfaf1ef37f016df7]::iter::adapters::cloned::clone_try_fold<rustc_span[ca1c0a0508e86155]::def_id::DefId, (), core[dfaf1ef37f016df7]::ops::control_flow::ControlFlow<()>, core[dfaf1ef37f016df7]::iter::traits::iterator::Iterator::any::check<rustc_span[ca1c0a0508e86155]::def_id::DefId, <dyn rustc_hir_analysis[58bd12f7f7a259]::astconv::AstConv>::probe_traits_that_match_assoc_ty::{closure#0}::{closure#1}>::{closure#0}>::{closure#0} as core[dfaf1ef37f016df7]::ops::function::FnMut<((), &rustc_span[ca1c0a0508e86155]::def_id::DefId)>>::call_mut
  29:     0x7fa58d29fe02 - <core[dfaf1ef37f016df7]::iter::adapters::map::Map<indexmap[47092f51bf5dd968]::map::Iter<rustc_middle[1bc382fc214918e1]::ty::fast_reject::SimplifiedType, alloc[24dd174104beeac0]::vec::Vec<rustc_span[ca1c0a0508e86155]::def_id::DefId>>, <rustc_middle[1bc382fc214918e1]::ty::context::TyCtxt>::all_impls::{closure#0}> as core[dfaf1ef37f016df7]::iter::traits::iterator::Iterator>::try_fold::<(), <core[dfaf1ef37f016df7]::iter::adapters::flatten::FlattenCompat<_, _>>::iter_try_fold::flatten<&alloc[24dd174104beeac0]::vec::Vec<rustc_span[ca1c0a0508e86155]::def_id::DefId>, (), core[dfaf1ef37f016df7]::ops::control_flow::ControlFlow<()>, <core[dfaf1ef37f016df7]::iter::adapters::flatten::FlattenCompat<_, _> as core[dfaf1ef37f016df7]::iter::traits::iterator::Iterator>::try_fold::flatten<core[dfaf1ef37f016df7]::slice::iter::Iter<rustc_span[ca1c0a0508e86155]::def_id::DefId>, (), core[dfaf1ef37f016df7]::ops::control_flow::ControlFlow<()>, core[dfaf1ef37f016df7]::iter::adapters::cloned::clone_try_fold<rustc_span[ca1c0a0508e86155]::def_id::DefId, (), core[dfaf1ef37f016df7]::ops::control_flow::ControlFlow<()>, core[dfaf1ef37f016df7]::iter::traits::iterator::Iterator::any::check<rustc_span[ca1c0a0508e86155]::def_id::DefId, <dyn rustc_hir_analysis[58bd12f7f7a259]::astconv::AstConv>::probe_traits_that_match_assoc_ty::{closure#0}::{closure#1}>::{closure#0}>::{closure#0}>::{closure#0}>::{closure#0}, core[dfaf1ef37f016df7]::ops::control_flow::ControlFlow<()>>
  30:     0x7fa58d2b148d - <core[dfaf1ef37f016df7]::iter::adapters::chain::Chain<core[dfaf1ef37f016df7]::slice::iter::Iter<rustc_span[ca1c0a0508e86155]::def_id::DefId>, core[dfaf1ef37f016df7]::iter::adapters::flatten::FlatMap<indexmap[47092f51bf5dd968]::map::Iter<rustc_middle[1bc382fc214918e1]::ty::fast_reject::SimplifiedType, alloc[24dd174104beeac0]::vec::Vec<rustc_span[ca1c0a0508e86155]::def_id::DefId>>, &alloc[24dd174104beeac0]::vec::Vec<rustc_span[ca1c0a0508e86155]::def_id::DefId>, <rustc_middle[1bc382fc214918e1]::ty::context::TyCtxt>::all_impls::{closure#0}>> as core[dfaf1ef37f016df7]::iter::traits::iterator::Iterator>::try_fold::<(), core[dfaf1ef37f016df7]::iter::adapters::cloned::clone_try_fold<rustc_span[ca1c0a0508e86155]::def_id::DefId, (), core[dfaf1ef37f016df7]::ops::control_flow::ControlFlow<()>, core[dfaf1ef37f016df7]::iter::traits::iterator::Iterator::any::check<rustc_span[ca1c0a0508e86155]::def_id::DefId, <dyn rustc_hir_analysis[58bd12f7f7a259]::astconv::AstConv>::probe_traits_that_match_assoc_ty::{closure#0}::{closure#1}>::{closure#0}>::{closure#0}, core[dfaf1ef37f016df7]::ops::control_flow::ControlFlow<()>>
  31:     0x7fa58d24e35c - <&mut <dyn rustc_hir_analysis[58bd12f7f7a259]::astconv::AstConv>::probe_traits_that_match_assoc_ty::{closure#0} as core[dfaf1ef37f016df7]::ops::function::FnMut<(&rustc_span[ca1c0a0508e86155]::def_id::DefId,)>>::call_mut
  32:     0x7fa58d2858ef - <core[dfaf1ef37f016df7]::iter::adapters::copied::Copied<core[dfaf1ef37f016df7]::slice::iter::Iter<rustc_span[ca1c0a0508e86155]::def_id::DefId>> as core[dfaf1ef37f016df7]::iter::traits::iterator::Iterator>::try_fold::<(), &mut core[dfaf1ef37f016df7]::iter::traits::iterator::Iterator::find::check<rustc_span[ca1c0a0508e86155]::def_id::DefId, &mut <dyn rustc_hir_analysis[58bd12f7f7a259]::astconv::AstConv>::probe_traits_that_match_assoc_ty::{closure#0}>::{closure#0}, core[dfaf1ef37f016df7]::ops::control_flow::ControlFlow<rustc_span[ca1c0a0508e86155]::def_id::DefId>>
  33:     0x7fa58d2859da - <core[dfaf1ef37f016df7]::iter::adapters::copied::Copied<core[dfaf1ef37f016df7]::slice::iter::Iter<rustc_span[ca1c0a0508e86155]::def_id::CrateNum>> as core[dfaf1ef37f016df7]::iter::traits::iterator::Iterator>::try_fold::<(), core[dfaf1ef37f016df7]::iter::adapters::map::map_try_fold<rustc_span[ca1c0a0508e86155]::def_id::CrateNum, core[dfaf1ef37f016df7]::iter::adapters::copied::Copied<core[dfaf1ef37f016df7]::slice::iter::Iter<rustc_span[ca1c0a0508e86155]::def_id::DefId>>, (), core[dfaf1ef37f016df7]::ops::control_flow::ControlFlow<rustc_span[ca1c0a0508e86155]::def_id::DefId>, <rustc_middle[1bc382fc214918e1]::ty::context::TyCtxt>::all_traits::{closure#0}, <core[dfaf1ef37f016df7]::iter::adapters::flatten::FlattenCompat<_, _>>::iter_try_fold::flatten<core[dfaf1ef37f016df7]::iter::adapters::copied::Copied<core[dfaf1ef37f016df7]::slice::iter::Iter<rustc_span[ca1c0a0508e86155]::def_id::DefId>>, (), core[dfaf1ef37f016df7]::ops::control_flow::ControlFlow<rustc_span[ca1c0a0508e86155]::def_id::DefId>, <core[dfaf1ef37f016df7]::iter::adapters::flatten::FlattenCompat<_, _> as core[dfaf1ef37f016df7]::iter::traits::iterator::Iterator>::try_fold::flatten<core[dfaf1ef37f016df7]::iter::adapters::copied::Copied<core[dfaf1ef37f016df7]::slice::iter::Iter<rustc_span[ca1c0a0508e86155]::def_id::DefId>>, (), core[dfaf1ef37f016df7]::ops::control_flow::ControlFlow<rustc_span[ca1c0a0508e86155]::def_id::DefId>, core[dfaf1ef37f016df7]::iter::traits::iterator::Iterator::find::check<rustc_span[ca1c0a0508e86155]::def_id::DefId, &mut <dyn rustc_hir_analysis[58bd12f7f7a259]::astconv::AstConv>::probe_traits_that_match_assoc_ty::{closure#0}>::{closure#0}>::{closure#0}>::{closure#0}>::{closure#0}, core[dfaf1ef37f016df7]::ops::control_flow::ControlFlow<rustc_span[ca1c0a0508e86155]::def_id::DefId>>
  34:     0x7fa58d2b1249 - <core[dfaf1ef37f016df7]::iter::adapters::chain::Chain<core[dfaf1ef37f016df7]::iter::sources::once::Once<rustc_span[ca1c0a0508e86155]::def_id::CrateNum>, core[dfaf1ef37f016df7]::iter::adapters::copied::Copied<core[dfaf1ef37f016df7]::slice::iter::Iter<rustc_span[ca1c0a0508e86155]::def_id::CrateNum>>> as core[dfaf1ef37f016df7]::iter::traits::iterator::Iterator>::try_fold::<(), core[dfaf1ef37f016df7]::iter::adapters::map::map_try_fold<rustc_span[ca1c0a0508e86155]::def_id::CrateNum, core[dfaf1ef37f016df7]::iter::adapters::copied::Copied<core[dfaf1ef37f016df7]::slice::iter::Iter<rustc_span[ca1c0a0508e86155]::def_id::DefId>>, (), core[dfaf1ef37f016df7]::ops::control_flow::ControlFlow<rustc_span[ca1c0a0508e86155]::def_id::DefId>, <rustc_middle[1bc382fc214918e1]::ty::context::TyCtxt>::all_traits::{closure#0}, <core[dfaf1ef37f016df7]::iter::adapters::flatten::FlattenCompat<_, _>>::iter_try_fold::flatten<core[dfaf1ef37f016df7]::iter::adapters::copied::Copied<core[dfaf1ef37f016df7]::slice::iter::Iter<rustc_span[ca1c0a0508e86155]::def_id::DefId>>, (), core[dfaf1ef37f016df7]::ops::control_flow::ControlFlow<rustc_span[ca1c0a0508e86155]::def_id::DefId>, <core[dfaf1ef37f016df7]::iter::adapters::flatten::FlattenCompat<_, _> as core[dfaf1ef37f016df7]::iter::traits::iterator::Iterator>::try_fold::flatten<core[dfaf1ef37f016df7]::iter::adapters::copied::Copied<core[dfaf1ef37f016df7]::slice::iter::Iter<rustc_span[ca1c0a0508e86155]::def_id::DefId>>, (), core[dfaf1ef37f016df7]::ops::control_flow::ControlFlow<rustc_span[ca1c0a0508e86155]::def_id::DefId>, core[dfaf1ef37f016df7]::iter::traits::iterator::Iterator::find::check<rustc_span[ca1c0a0508e86155]::def_id::DefId, &mut <dyn rustc_hir_analysis[58bd12f7f7a259]::astconv::AstConv>::probe_traits_that_match_assoc_ty::{closure#0}>::{closure#0}>::{closure#0}>::{closure#0}>::{closure#0}, core[dfaf1ef37f016df7]::ops::control_flow::ControlFlow<rustc_span[ca1c0a0508e86155]::def_id::DefId>>
  35:     0x7fa58d29f58e - <core[dfaf1ef37f016df7]::iter::adapters::map::Map<core[dfaf1ef37f016df7]::iter::adapters::chain::Chain<core[dfaf1ef37f016df7]::iter::sources::once::Once<rustc_span[ca1c0a0508e86155]::def_id::CrateNum>, core[dfaf1ef37f016df7]::iter::adapters::copied::Copied<core[dfaf1ef37f016df7]::slice::iter::Iter<rustc_span[ca1c0a0508e86155]::def_id::CrateNum>>>, <rustc_middle[1bc382fc214918e1]::ty::context::TyCtxt>::all_traits::{closure#0}> as core[dfaf1ef37f016df7]::iter::traits::iterator::Iterator>::try_fold::<(), <core[dfaf1ef37f016df7]::iter::adapters::flatten::FlattenCompat<_, _>>::iter_try_fold::flatten<core[dfaf1ef37f016df7]::iter::adapters::copied::Copied<core[dfaf1ef37f016df7]::slice::iter::Iter<rustc_span[ca1c0a0508e86155]::def_id::DefId>>, (), core[dfaf1ef37f016df7]::ops::control_flow::ControlFlow<rustc_span[ca1c0a0508e86155]::def_id::DefId>, <core[dfaf1ef37f016df7]::iter::adapters::flatten::FlattenCompat<_, _> as core[dfaf1ef37f016df7]::iter::traits::iterator::Iterator>::try_fold::flatten<core[dfaf1ef37f016df7]::iter::adapters::copied::Copied<core[dfaf1ef37f016df7]::slice::iter::Iter<rustc_span[ca1c0a0508e86155]::def_id::DefId>>, (), core[dfaf1ef37f016df7]::ops::control_flow::ControlFlow<rustc_span[ca1c0a0508e86155]::def_id::DefId>, core[dfaf1ef37f016df7]::iter::traits::iterator::Iterator::find::check<rustc_span[ca1c0a0508e86155]::def_id::DefId, &mut <dyn rustc_hir_analysis[58bd12f7f7a259]::astconv::AstConv>::probe_traits_that_match_assoc_ty::{closure#0}>::{closure#0}>::{closure#0}>::{closure#0}, core[dfaf1ef37f016df7]::ops::control_flow::ControlFlow<rustc_span[ca1c0a0508e86155]::def_id::DefId>>
  36:     0x7fa58d28c400 - <alloc[24dd174104beeac0]::vec::Vec<alloc[24dd174104beeac0]::string::String> as alloc[24dd174104beeac0]::vec::spec_from_iter::SpecFromIter<alloc[24dd174104beeac0]::string::String, core[dfaf1ef37f016df7]::iter::adapters::map::Map<core[dfaf1ef37f016df7]::iter::adapters::filter::Filter<core[dfaf1ef37f016df7]::iter::adapters::flatten::FlatMap<core[dfaf1ef37f016df7]::iter::adapters::chain::Chain<core[dfaf1ef37f016df7]::iter::sources::once::Once<rustc_span[ca1c0a0508e86155]::def_id::CrateNum>, core[dfaf1ef37f016df7]::iter::adapters::copied::Copied<core[dfaf1ef37f016df7]::slice::iter::Iter<rustc_span[ca1c0a0508e86155]::def_id::CrateNum>>>, core[dfaf1ef37f016df7]::iter::adapters::copied::Copied<core[dfaf1ef37f016df7]::slice::iter::Iter<rustc_span[ca1c0a0508e86155]::def_id::DefId>>, <rustc_middle[1bc382fc214918e1]::ty::context::TyCtxt>::all_traits::{closure#0}>, <dyn rustc_hir_analysis[58bd12f7f7a259]::astconv::AstConv>::probe_traits_that_match_assoc_ty::{closure#0}>, <dyn rustc_hir_analysis[58bd12f7f7a259]::astconv::AstConv>::probe_traits_that_match_assoc_ty::{closure#1}>>>::from_iter
  37:     0x7fa58d24ffc5 - <dyn rustc_hir_analysis[58bd12f7f7a259]::astconv::AstConv>::probe_traits_that_match_assoc_ty
  38:     0x7fa58bdd5bc0 - <dyn rustc_hir_analysis[58bd12f7f7a259]::astconv::AstConv>::associated_path_to_ty::{closure#0}
  39:     0x7fa58bdbc3f1 - <dyn rustc_hir_analysis[58bd12f7f7a259]::astconv::AstConv>::ast_ty_to_ty_inner::{closure#0}
  40:     0x7fa58b911e5d - rustc_hir_analysis[58bd12f7f7a259]::collect::predicates_of::gather_explicit_predicates_of
  41:     0x7fa58b90f813 - rustc_hir_analysis[58bd12f7f7a259]::collect::predicates_of::explicit_predicates_of
  42:     0x7fa58b90b7f9 - rustc_query_system[90808657c38d1bea]::query::plumbing::try_execute_query::<rustc_query_impl[b7eb43ed52c37c26]::queries::explicit_predicates_of, rustc_query_impl[b7eb43ed52c37c26]::plumbing::QueryCtxt>
  43:     0x7fa58b902e65 - rustc_query_system[90808657c38d1bea]::query::plumbing::try_execute_query::<rustc_query_impl[b7eb43ed52c37c26]::queries::predicates_defined_on, rustc_query_impl[b7eb43ed52c37c26]::plumbing::QueryCtxt>
  44:     0x7fa58bd9d905 - rustc_query_system[90808657c38d1bea]::query::plumbing::try_execute_query::<rustc_query_impl[b7eb43ed52c37c26]::queries::predicates_of, rustc_query_impl[b7eb43ed52c37c26]::plumbing::QueryCtxt>
  45:     0x7fa58bd9c8f3 - <rustc_query_impl[b7eb43ed52c37c26]::Queries as rustc_middle[1bc382fc214918e1]::ty::query::QueryEngine>::predicates_of
  46:     0x7fa58b948ca3 - <rustc_hir_analysis[58bd12f7f7a259]::collect::CollectItemTypesVisitor as rustc_hir[37358d514e413a25]::intravisit::Visitor>::visit_item
  47:     0x7fa58b9479e6 - <rustc_middle[1bc382fc214918e1]::hir::map::Map>::visit_item_likes_in_module::<rustc_hir_analysis[58bd12f7f7a259]::collect::CollectItemTypesVisitor>
  48:     0x7fa58b9478fc - rustc_hir_analysis[58bd12f7f7a259]::collect::collect_mod_item_types
  49:     0x7fa58c797181 - rustc_query_system[90808657c38d1bea]::query::plumbing::try_execute_query::<rustc_query_impl[b7eb43ed52c37c26]::queries::collect_mod_item_types, rustc_query_impl[b7eb43ed52c37c26]::plumbing::QueryCtxt>
  50:     0x7fa58c796d2a - <rustc_query_impl[b7eb43ed52c37c26]::Queries as rustc_middle[1bc382fc214918e1]::ty::query::QueryEngine>::collect_mod_item_types
  51:     0x7fa58b57c916 - <rustc_session[b38dad6cf268045a]::session::Session>::track_errors::<rustc_hir_analysis[58bd12f7f7a259]::check_crate::{closure#0}, ()>
  52:     0x7fa58b5794f2 - rustc_hir_analysis[58bd12f7f7a259]::check_crate
  53:     0x7fa58b56f472 - rustc_interface[e667fd6539aa89ef]::passes::analysis
  54:     0x7fa58c979f6d - rustc_query_system[90808657c38d1bea]::query::plumbing::try_execute_query::<rustc_query_impl[b7eb43ed52c37c26]::queries::analysis, rustc_query_impl[b7eb43ed52c37c26]::plumbing::QueryCtxt>
  55:     0x7fa58c979c6f - <rustc_query_impl[b7eb43ed52c37c26]::Queries as rustc_middle[1bc382fc214918e1]::ty::query::QueryEngine>::analysis
  56:     0x7fa58c79ff06 - <rustc_middle[1bc382fc214918e1]::ty::context::GlobalCtxt>::enter::<rustc_driver_impl[1328d09be3dc1a8e]::run_compiler::{closure#1}::{closure#2}::{closure#4}, core[dfaf1ef37f016df7]::result::Result<(), rustc_span[ca1c0a0508e86155]::ErrorGuaranteed>>
  57:     0x7fa58c3818d8 - rustc_span[ca1c0a0508e86155]::with_source_map::<core[dfaf1ef37f016df7]::result::Result<(), rustc_span[ca1c0a0508e86155]::ErrorGuaranteed>, rustc_interface[e667fd6539aa89ef]::interface::run_compiler<core[dfaf1ef37f016df7]::result::Result<(), rustc_span[ca1c0a0508e86155]::ErrorGuaranteed>, rustc_driver_impl[1328d09be3dc1a8e]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  58:     0x7fa58c378fbc - std[d01210ab3b315fe2]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[e667fd6539aa89ef]::util::run_in_thread_pool_with_globals<rustc_interface[e667fd6539aa89ef]::interface::run_compiler<core[dfaf1ef37f016df7]::result::Result<(), rustc_span[ca1c0a0508e86155]::ErrorGuaranteed>, rustc_driver_impl[1328d09be3dc1a8e]::run_compiler::{closure#1}>::{closure#0}, core[dfaf1ef37f016df7]::result::Result<(), rustc_span[ca1c0a0508e86155]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[dfaf1ef37f016df7]::result::Result<(), rustc_span[ca1c0a0508e86155]::ErrorGuaranteed>>
  59:     0x7fa58c3789ea - <<std[d01210ab3b315fe2]::thread::Builder>::spawn_unchecked_<rustc_interface[e667fd6539aa89ef]::util::run_in_thread_pool_with_globals<rustc_interface[e667fd6539aa89ef]::interface::run_compiler<core[dfaf1ef37f016df7]::result::Result<(), rustc_span[ca1c0a0508e86155]::ErrorGuaranteed>, rustc_driver_impl[1328d09be3dc1a8e]::run_compiler::{closure#1}>::{closure#0}, core[dfaf1ef37f016df7]::result::Result<(), rustc_span[ca1c0a0508e86155]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[dfaf1ef37f016df7]::result::Result<(), rustc_span[ca1c0a0508e86155]::ErrorGuaranteed>>::{closure#1} as core[dfaf1ef37f016df7]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  60:     0x7fa589ec4d63 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h23732028e1dd2dcf
                               at /rustc/7281249a19a9755e9d889ee251ec323629caadab/library/alloc/src/boxed.rs:1988:9
  61:     0x7fa589ec4d63 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h10e7b0e430440157
                               at /rustc/7281249a19a9755e9d889ee251ec323629caadab/library/alloc/src/boxed.rs:1988:9
  62:     0x7fa589ec4d63 - std::sys::unix::thread::Thread::new::thread_start::hf1c234831da9bd27
                               at /rustc/7281249a19a9755e9d889ee251ec323629caadab/library/std/src/sys/unix/thread.rs:108:17
  63:     0x7fa589d8e609 - start_thread
  64:     0x7fa589cb1133 - clone
  65:                0x0 - <unknown>

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.69.0-nightly (7281249a1 2023-02-27) running on x86_64-unknown-linux-gnu

note: compiler flags: -C debuginfo=1 -C llvm-args=--x86-asm-syntax=intel --crate-type rlib

query stack during panic:
#0 [explicit_predicates_of] computing explicit predicates of `<impl at <source>:8:1: 8:23>`
#1 [predicates_defined_on] computing predicates of `<impl at <source>:8:1: 8:23>`
#2 [predicates_of] computing predicates of `<impl at <source>:8:1: 8:23>`
#3 [collect_mod_item_types] collecting item types in top-level module
#4 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to previous error

@bugadani bugadani 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 28, 2023
@bugadani
Copy link
Contributor Author

Forgot to say that the above example is a conventional compile error on 1.67 that hints at why the code is incorrect. The following, fixed version is accepted by both 1.67 and nightly:

pub struct Bar<S>(S);

pub trait Foo {}

impl<S> Foo for Bar<S>
where
    for<'a> &'a S: IntoIterator,
    for<'a> <&'a S as IntoIterator>::Item: Foo,
{
}

@clubby789
Copy link
Contributor

Regression in rust-lang-ci@8f80c53 -> #106585

searched nightlies: from nightly-2023-01-01 to nightly-2023-02-28
regressed nightly: nightly-2023-01-15
searched commit range: 0b90256...afaf3e0
regressed commit: a11eb4f

bisected with cargo-bisect-rustc v0.6.5

Host triple: x86_64-unknown-linux-gnu
Reproduce with:

cargo bisect-rustc 2023-01-01 --regress=ice --preserve -v 

cc @estebank

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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants