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 on recursive fn which returns impl T #103599

Closed
jruderman opened this issue Oct 26, 2022 · 1 comment · Fixed by #103601
Closed

ICE on recursive fn which returns impl T #103599

jruderman opened this issue Oct 26, 2022 · 1 comment · Fixed by #103601
Assignees
Labels
A-impl-trait Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch. C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@jruderman
Copy link
Contributor

Valid according to stable (1.64.0), but ICEs beta (1.65.0-beta.4) and ICEs nightly:

trait T {}

fn wrap(x: impl T) -> impl T {
    wrap(wrap(x))
}

fn main() {}

Reduced from a fuzzer mutation of src/test/ui/impl-trait/issue-87450.rs

Error output

Two ICEs:

thread 'rustc' panicked at 'assertion failed: !infcx.is_in_snapshot() || self.usable_in_snapshot', compiler/rustc_trait_selection/src/traits/fulfill.rs:177:9

error: internal compiler error: no errors encountered even though `delay_span_bug` issued

error: internal compiler error: VecMap([(OpaqueTypeKey { def_id: DefId(0:7 ~ main[d88a]::wrap::{opaque#1}), substs: [impl T] }, OpaqueTypeDecl { hidden_type: OpaqueHiddenType { span: cyz/src/main.rs:7:5: 7:18 (#0), ty: impl T }, origin: FnReturn(DefId(0:4 ~ main[d88a]::wrap)) })])
  |
  = note: delayed at compiler/rustc_infer/src/infer/opaque_types/table.rs:50:26
Full output with both backtraces

thread 'rustc' panicked at 'assertion failed: !infcx.is_in_snapshot() || self.usable_in_snapshot', compiler/rustc_trait_selection/src/traits/fulfill.rs:177:9
stack backtrace:
   0:        0x105c92882 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h25d806a113d8ecc4
   1:        0x105cea72a - core::fmt::write::h27951ddb40e14403
   2:        0x105c8484c - std::io::Write::write_fmt::h7266f2429fcf12b5
   3:        0x105c9264a - std::sys_common::backtrace::print::h73136d09f0ffc17b
   4:        0x105c95a56 - std::panicking::default_hook::{{closure}}::h914a4530f160715f
   5:        0x105c957a7 - std::panicking::default_hook::h66c12acf767bf01f
   6:        0x114bcbbfd - rustc_driver[8de3e851f3511a86]::DEFAULT_HOOK::{closure#0}::{closure#0}
   7:        0x105c96251 - std::panicking::rust_panic_with_hook::h54847cdb3a29a411
   8:        0x105c95fa2 - std::panicking::begin_panic_handler::{{closure}}::h2f6619e41c119eb6
   9:        0x105c92d18 - std::sys_common::backtrace::__rust_end_short_backtrace::hbf07852adff27aef
  10:        0x105c95cad - _rust_begin_unwind
  11:        0x105d17193 - core::panicking::panic_fmt::h4ef0f61efac12a83
  12:        0x105d17267 - core::panicking::panic::h2dceeeaec9419bf8
  13:        0x11910fe16 - <rustc_trait_selection[a15beaa728f912ec]::traits::fulfill::FulfillmentContext as rustc_infer[6fee85a783c5345a]::traits::engine::TraitEngine>::register_predicate_obligation
  14:        0x117e9611f - rustc_trait_selection[a15beaa728f912ec]::traits::fully_solve_obligations::<alloc[30a41e7aafccdad0]::vec::Vec<rustc_infer[6fee85a783c5345a]::traits::Obligation<rustc_middle[c9d78f14285fe0f2]::ty::Predicate>>>
  15:        0x117ee3f7e - rustc_trait_selection[a15beaa728f912ec]::traits::query::type_op::custom::scrape_region_constraints::<rustc_borrowck[91564686624f537b]::type_check::InstantiateOpaqueType, (), <rustc_borrowck[91564686624f537b]::type_check::InstantiateOpaqueType as rustc_trait_selection[a15beaa728f912ec]::traits::query::type_op::TypeOp>::fully_perform::{closure#0}>
  16:        0x117ec4b54 - <rustc_borrowck[91564686624f537b]::type_check::InstantiateOpaqueType as rustc_trait_selection[a15beaa728f912ec]::traits::query::type_op::TypeOp>::fully_perform
  17:        0x117ec5cd8 - <rustc_borrowck[91564686624f537b]::type_check::TypeChecker>::fully_perform_op::<(), rustc_borrowck[91564686624f537b]::type_check::InstantiateOpaqueType>
  18:        0x117fb9c3b - <rustc_borrowck[91564686624f537b]::type_check::relate_tys::NllTypeRelatingDelegate as rustc_infer[6fee85a783c5345a]::infer::nll_relate::TypeRelatingDelegate>::register_opaque_type
  19:        0x117eb7d19 - <rustc_infer[6fee85a783c5345a]::infer::nll_relate::TypeRelating<rustc_borrowck[91564686624f537b]::type_check::relate_tys::NllTypeRelatingDelegate>>::relate_opaques
  20:        0x117eb6f89 - <rustc_infer[6fee85a783c5345a]::infer::nll_relate::TypeRelating<rustc_borrowck[91564686624f537b]::type_check::relate_tys::NllTypeRelatingDelegate> as rustc_middle[c9d78f14285fe0f2]::ty::relate::TypeRelation>::relate::<rustc_middle[c9d78f14285fe0f2]::ty::Ty>
  21:        0x117e992dc - <rustc_middle[c9d78f14285fe0f2]::ty::subst::GenericArg as rustc_middle[c9d78f14285fe0f2]::ty::relate::Relate>::relate::<rustc_infer[6fee85a783c5345a]::infer::nll_relate::TypeRelating<rustc_borrowck[91564686624f537b]::type_check::relate_tys::NllTypeRelatingDelegate>>
  22:        0x117e556ec - <core[2c87c43c7709eb65]::result::Result<rustc_middle[c9d78f14285fe0f2]::ty::subst::GenericArg, rustc_middle[c9d78f14285fe0f2]::ty::error::TypeError> as rustc_type_ir[92625cb12ceab9e2]::InternIteratorElement<rustc_middle[c9d78f14285fe0f2]::ty::subst::GenericArg, &rustc_middle[c9d78f14285fe0f2]::ty::list::List<rustc_middle[c9d78f14285fe0f2]::ty::subst::GenericArg>>>::intern_with::<core[2c87c43c7709eb65]::iter::adapters::map::Map<core[2c87c43c7709eb65]::iter::adapters::zip::Zip<core[2c87c43c7709eb65]::iter::adapters::copied::Copied<core[2c87c43c7709eb65]::slice::iter::Iter<rustc_middle[c9d78f14285fe0f2]::ty::subst::GenericArg>>, core[2c87c43c7709eb65]::iter::adapters::copied::Copied<core[2c87c43c7709eb65]::slice::iter::Iter<rustc_middle[c9d78f14285fe0f2]::ty::subst::GenericArg>>>, rustc_middle[c9d78f14285fe0f2]::ty::relate::relate_substs<rustc_infer[6fee85a783c5345a]::infer::nll_relate::TypeRelating<rustc_borrowck[91564686624f537b]::type_check::relate_tys::NllTypeRelatingDelegate>>::{closure#0}>, <rustc_middle[c9d78f14285fe0f2]::ty::context::TyCtxt>::mk_substs<core[2c87c43c7709eb65]::iter::adapters::map::Map<core[2c87c43c7709eb65]::iter::adapters::zip::Zip<core[2c87c43c7709eb65]::iter::adapters::copied::Copied<core[2c87c43c7709eb65]::slice::iter::Iter<rustc_middle[c9d78f14285fe0f2]::ty::subst::GenericArg>>, core[2c87c43c7709eb65]::iter::adapters::copied::Copied<core[2c87c43c7709eb65]::slice::iter::Iter<rustc_middle[c9d78f14285fe0f2]::ty::subst::GenericArg>>>, rustc_middle[c9d78f14285fe0f2]::ty::relate::relate_substs<rustc_infer[6fee85a783c5345a]::infer::nll_relate::TypeRelating<rustc_borrowck[91564686624f537b]::type_check::relate_tys::NllTypeRelatingDelegate>>::{closure#0}>>::{closure#0}>
  23:        0x117f9c182 - rustc_middle[c9d78f14285fe0f2]::ty::relate::relate_substs::<rustc_infer[6fee85a783c5345a]::infer::nll_relate::TypeRelating<rustc_borrowck[91564686624f537b]::type_check::relate_tys::NllTypeRelatingDelegate>>
  24:        0x117f9d3bb - rustc_middle[c9d78f14285fe0f2]::ty::relate::super_relate_tys::<rustc_infer[6fee85a783c5345a]::infer::nll_relate::TypeRelating<rustc_borrowck[91564686624f537b]::type_check::relate_tys::NllTypeRelatingDelegate>>
  25:        0x117df2b42 - <rustc_infer[6fee85a783c5345a]::infer::InferCtxt>::super_combine_tys::<rustc_infer[6fee85a783c5345a]::infer::nll_relate::TypeRelating<rustc_borrowck[91564686624f537b]::type_check::relate_tys::NllTypeRelatingDelegate>>
  26:        0x117eb6f32 - <rustc_infer[6fee85a783c5345a]::infer::nll_relate::TypeRelating<rustc_borrowck[91564686624f537b]::type_check::relate_tys::NllTypeRelatingDelegate> as rustc_middle[c9d78f14285fe0f2]::ty::relate::TypeRelation>::relate::<rustc_middle[c9d78f14285fe0f2]::ty::Ty>
  27:        0x117ec76e4 - <rustc_borrowck[91564686624f537b]::type_check::TypeChecker>::relate_types
  28:        0x117ecfe43 - <rustc_borrowck[91564686624f537b]::type_check::TypeChecker>::typeck_mir
  29:        0x117ebbfcb - rustc_borrowck[91564686624f537b]::type_check::type_check
  30:        0x117e0e962 - rustc_borrowck[91564686624f537b]::nll::compute_regions
  31:        0x117f31f90 - rustc_borrowck[91564686624f537b]::do_mir_borrowck
  32:        0x117f23b9f - rustc_borrowck[91564686624f537b]::mir_borrowck
  33:        0x117f04425 - <rustc_borrowck[91564686624f537b]::provide::{closure#0} as core[2c87c43c7709eb65]::ops::function::FnOnce<(rustc_middle[c9d78f14285fe0f2]::ty::context::TyCtxt, rustc_span[81b003e947b8ff3]::def_id::LocalDefId)>>::call_once
  34:        0x1183a38f9 - rustc_query_system[6dacc3bd586c32a5]::query::plumbing::try_execute_query::<rustc_query_impl[8431c9b77d4d37fe]::plumbing::QueryCtxt, rustc_query_system[6dacc3bd586c32a5]::query::caches::DefaultCache<rustc_span[81b003e947b8ff3]::def_id::LocalDefId, &rustc_middle[c9d78f14285fe0f2]::mir::query::BorrowCheckResult>>
  35:        0x118494be3 - rustc_query_system[6dacc3bd586c32a5]::query::plumbing::get_query::<rustc_query_impl[8431c9b77d4d37fe]::queries::mir_borrowck, rustc_query_impl[8431c9b77d4d37fe]::plumbing::QueryCtxt>
  36:        0x11765de7a - rustc_hir_analysis[30e39910cbeda8e1]::collect::type_of::find_opaque_ty_constraints_for_rpit
  37:        0x11765cfc6 - rustc_hir_analysis[30e39910cbeda8e1]::collect::type_of::type_of
  38:        0x1183c4215 - rustc_query_system[6dacc3bd586c32a5]::query::plumbing::try_execute_query::<rustc_query_impl[8431c9b77d4d37fe]::plumbing::QueryCtxt, rustc_query_system[6dacc3bd586c32a5]::query::caches::DefaultCache<rustc_span[81b003e947b8ff3]::def_id::DefId, rustc_middle[c9d78f14285fe0f2]::ty::Ty>>
  39:        0x1184a8174 - rustc_query_system[6dacc3bd586c32a5]::query::plumbing::get_query::<rustc_query_impl[8431c9b77d4d37fe]::queries::type_of, rustc_query_impl[8431c9b77d4d37fe]::plumbing::QueryCtxt>
  40:        0x1176113cc - rustc_hir_analysis[30e39910cbeda8e1]::check::check::check_item_type
  41:        0x11761ad5e - rustc_hir_analysis[30e39910cbeda8e1]::check::check::check_mod_item_types
  42:        0x1183a6f75 - rustc_query_system[6dacc3bd586c32a5]::query::plumbing::try_execute_query::<rustc_query_impl[8431c9b77d4d37fe]::plumbing::QueryCtxt, rustc_query_system[6dacc3bd586c32a5]::query::caches::DefaultCache<rustc_span[81b003e947b8ff3]::def_id::LocalDefId, ()>>
  43:        0x11849e2b5 - rustc_query_system[6dacc3bd586c32a5]::query::plumbing::get_query::<rustc_query_impl[8431c9b77d4d37fe]::queries::check_mod_item_types, rustc_query_impl[8431c9b77d4d37fe]::plumbing::QueryCtxt>
  44:        0x11763f898 - <rustc_middle[c9d78f14285fe0f2]::hir::map::Map>::for_each_module::<rustc_hir_analysis[30e39910cbeda8e1]::check_crate::{closure#6}::{closure#0}>
  45:        0x11762fcc9 - <rustc_session[82219efc93061be6]::session::Session>::time::<(), rustc_hir_analysis[30e39910cbeda8e1]::check_crate::{closure#6}>
  46:        0x1175e434f - rustc_hir_analysis[30e39910cbeda8e1]::check_crate
  47:        0x114c98d4a - rustc_interface[7f8f58d06d0d17dc]::passes::analysis
  48:        0x11842e0fc - rustc_query_system[6dacc3bd586c32a5]::query::plumbing::try_execute_query::<rustc_query_impl[8431c9b77d4d37fe]::plumbing::QueryCtxt, rustc_query_system[6dacc3bd586c32a5]::query::caches::DefaultCache<(), core[2c87c43c7709eb65]::result::Result<(), rustc_errors[daa152a9571d4543]::ErrorGuaranteed>>>
  49:        0x1184a8289 - rustc_query_system[6dacc3bd586c32a5]::query::plumbing::get_query::<rustc_query_impl[8431c9b77d4d37fe]::queries::analysis, rustc_query_impl[8431c9b77d4d37fe]::plumbing::QueryCtxt>
  50:        0x114b5aeb6 - <rustc_interface[7f8f58d06d0d17dc]::passes::QueryContext>::enter::<rustc_driver[8de3e851f3511a86]::run_compiler::{closure#1}::{closure#2}::{closure#3}, core[2c87c43c7709eb65]::result::Result<(), rustc_errors[daa152a9571d4543]::ErrorGuaranteed>>
  51:        0x114b9f71d - rustc_span[81b003e947b8ff3]::with_source_map::<core[2c87c43c7709eb65]::result::Result<(), rustc_errors[daa152a9571d4543]::ErrorGuaranteed>, rustc_interface[7f8f58d06d0d17dc]::interface::run_compiler<core[2c87c43c7709eb65]::result::Result<(), rustc_errors[daa152a9571d4543]::ErrorGuaranteed>, rustc_driver[8de3e851f3511a86]::run_compiler::{closure#1}>::{closure#0}::{closure#1}>
  52:        0x114b8ee1c - <scoped_tls[ea35ba321eba8f32]::ScopedKey<rustc_span[81b003e947b8ff3]::SessionGlobals>>::set::<rustc_interface[7f8f58d06d0d17dc]::interface::run_compiler<core[2c87c43c7709eb65]::result::Result<(), rustc_errors[daa152a9571d4543]::ErrorGuaranteed>, rustc_driver[8de3e851f3511a86]::run_compiler::{closure#1}>::{closure#0}, core[2c87c43c7709eb65]::result::Result<(), rustc_errors[daa152a9571d4543]::ErrorGuaranteed>>
  53:        0x114b5ea3a - std[4f43db94453d85b3]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[7f8f58d06d0d17dc]::util::run_in_thread_pool_with_globals<rustc_interface[7f8f58d06d0d17dc]::interface::run_compiler<core[2c87c43c7709eb65]::result::Result<(), rustc_errors[daa152a9571d4543]::ErrorGuaranteed>, rustc_driver[8de3e851f3511a86]::run_compiler::{closure#1}>::{closure#0}, core[2c87c43c7709eb65]::result::Result<(), rustc_errors[daa152a9571d4543]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[2c87c43c7709eb65]::result::Result<(), rustc_errors[daa152a9571d4543]::ErrorGuaranteed>>
  54:        0x114b4462b - <<std[4f43db94453d85b3]::thread::Builder>::spawn_unchecked_<rustc_interface[7f8f58d06d0d17dc]::util::run_in_thread_pool_with_globals<rustc_interface[7f8f58d06d0d17dc]::interface::run_compiler<core[2c87c43c7709eb65]::result::Result<(), rustc_errors[daa152a9571d4543]::ErrorGuaranteed>, rustc_driver[8de3e851f3511a86]::run_compiler::{closure#1}>::{closure#0}, core[2c87c43c7709eb65]::result::Result<(), rustc_errors[daa152a9571d4543]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[2c87c43c7709eb65]::result::Result<(), rustc_errors[daa152a9571d4543]::ErrorGuaranteed>>::{closure#1} as core[2c87c43c7709eb65]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  55:        0x105c9f367 - std::sys::unix::thread::Thread::new::thread_start::h87910746f103bc71
  56:     0x7ff81000f4e1 - __pthread_start

error: internal compiler error: unexpected panic

note: 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.66.0-nightly (bed4ad65b 2022-10-25) running on x86_64-apple-darwin

query stack during panic:
#0 [mir_borrowck] borrow-checking `wrap`
#1 [type_of] computing type of `wrap::{opaque#1}`
#2 [check_mod_item_types] checking item types in top-level module
#3 [analysis] running analysis passes on this crate
end of query stack
error: internal compiler error: no errors encountered even though `delay_span_bug` issued

error: internal compiler error: VecMap([(OpaqueTypeKey { def_id: DefId(0:7 ~ main[d88a]::wrap::{opaque#1}), substs: [impl T] }, OpaqueTypeDecl { hidden_type: OpaqueHiddenType { span: cyz/src/main.rs:7:5: 7:18 (#0), ty: impl T }, origin: FnReturn(DefId(0:4 ~ main[d88a]::wrap)) })])
  |
  = note: delayed at compiler/rustc_infer/src/infer/opaque_types/table.rs:50:26

thread 'rustc' panicked at 'Box<dyn Any>', compiler/rustc_errors/src/lib.rs:1553:13
stack backtrace:
   0:        0x105c92882 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h25d806a113d8ecc4
   1:        0x105cea72a - core::fmt::write::h27951ddb40e14403
   2:        0x105c8484c - std::io::Write::write_fmt::h7266f2429fcf12b5
   3:        0x105c9264a - std::sys_common::backtrace::print::h73136d09f0ffc17b
   4:        0x105c95a56 - std::panicking::default_hook::{{closure}}::h914a4530f160715f
   5:        0x105c957a7 - std::panicking::default_hook::h66c12acf767bf01f
   6:        0x114bcbbfd - rustc_driver[8de3e851f3511a86]::DEFAULT_HOOK::{closure#0}::{closure#0}
   7:        0x105c96251 - std::panicking::rust_panic_with_hook::h54847cdb3a29a411
   8:        0x11959cb87 - std[4f43db94453d85b3]::panicking::begin_panic::<rustc_errors[daa152a9571d4543]::ExplicitBug>::{closure#0}
   9:        0x11959abb9 - std[4f43db94453d85b3]::sys_common::backtrace::__rust_end_short_backtrace::<std[4f43db94453d85b3]::panicking::begin_panic<rustc_errors[daa152a9571d4543]::ExplicitBug>::{closure#0}, !>
  10:        0x119961e69 - std[4f43db94453d85b3]::panicking::begin_panic::<rustc_errors[daa152a9571d4543]::ExplicitBug>
  11:        0x11958cd19 - std[4f43db94453d85b3]::panic::panic_any::<rustc_errors[daa152a9571d4543]::ExplicitBug>
  12:        0x119593e3e - <rustc_errors[daa152a9571d4543]::HandlerInner>::flush_delayed::<alloc[30a41e7aafccdad0]::vec::Vec<rustc_errors[daa152a9571d4543]::diagnostic::Diagnostic>, &str>
  13:        0x11958fca9 - <rustc_errors[daa152a9571d4543]::HandlerInner as core[2c87c43c7709eb65]::ops::drop::Drop>::drop
  14:        0x114b4dd5a - core[2c87c43c7709eb65]::ptr::drop_in_place::<rustc_session[82219efc93061be6]::parse::ParseSess>
  15:        0x114b4f4db - core[2c87c43c7709eb65]::ptr::drop_in_place::<rustc_session[82219efc93061be6]::session::Session>
  16:        0x114bb4e1e - core[2c87c43c7709eb65]::ptr::drop_in_place::<rustc_interface[7f8f58d06d0d17dc]::interface::Compiler>
  17:        0x114b9fc0f - rustc_span[81b003e947b8ff3]::with_source_map::<core[2c87c43c7709eb65]::result::Result<(), rustc_errors[daa152a9571d4543]::ErrorGuaranteed>, rustc_interface[7f8f58d06d0d17dc]::interface::run_compiler<core[2c87c43c7709eb65]::result::Result<(), rustc_errors[daa152a9571d4543]::ErrorGuaranteed>, rustc_driver[8de3e851f3511a86]::run_compiler::{closure#1}>::{closure#0}::{closure#1}>
  18:        0x114b8ee1c - <scoped_tls[ea35ba321eba8f32]::ScopedKey<rustc_span[81b003e947b8ff3]::SessionGlobals>>::set::<rustc_interface[7f8f58d06d0d17dc]::interface::run_compiler<core[2c87c43c7709eb65]::result::Result<(), rustc_errors[daa152a9571d4543]::ErrorGuaranteed>, rustc_driver[8de3e851f3511a86]::run_compiler::{closure#1}>::{closure#0}, core[2c87c43c7709eb65]::result::Result<(), rustc_errors[daa152a9571d4543]::ErrorGuaranteed>>
  19:        0x114b5ea3a - std[4f43db94453d85b3]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[7f8f58d06d0d17dc]::util::run_in_thread_pool_with_globals<rustc_interface[7f8f58d06d0d17dc]::interface::run_compiler<core[2c87c43c7709eb65]::result::Result<(), rustc_errors[daa152a9571d4543]::ErrorGuaranteed>, rustc_driver[8de3e851f3511a86]::run_compiler::{closure#1}>::{closure#0}, core[2c87c43c7709eb65]::result::Result<(), rustc_errors[daa152a9571d4543]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[2c87c43c7709eb65]::result::Result<(), rustc_errors[daa152a9571d4543]::ErrorGuaranteed>>
  20:        0x114b4462b - <<std[4f43db94453d85b3]::thread::Builder>::spawn_unchecked_<rustc_interface[7f8f58d06d0d17dc]::util::run_in_thread_pool_with_globals<rustc_interface[7f8f58d06d0d17dc]::interface::run_compiler<core[2c87c43c7709eb65]::result::Result<(), rustc_errors[daa152a9571d4543]::ErrorGuaranteed>, rustc_driver[8de3e851f3511a86]::run_compiler::{closure#1}>::{closure#0}, core[2c87c43c7709eb65]::result::Result<(), rustc_errors[daa152a9571d4543]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[2c87c43c7709eb65]::result::Result<(), rustc_errors[daa152a9571d4543]::ErrorGuaranteed>>::{closure#1} as core[2c87c43c7709eb65]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  21:        0x105c9f367 - std::sys::unix::thread::Thread::new::thread_start::h87910746f103bc71
  22:     0x7ff81000f4e1 - __pthread_start

note: 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.66.0-nightly (bed4ad65b 2022-10-25) running on x86_64-apple-darwin

query stack during panic:
end of query stack
thread panicked while panicking. aborting.
Abort trap: 6

Version

rustc --version --verbose:

rustc 1.66.0-nightly (bed4ad65b 2022-10-25)
binary: rustc
commit-hash: bed4ad65bf7a1cef39e3d66b3670189581b3b073
commit-date: 2022-10-25
host: x86_64-apple-darwin
release: 1.66.0-nightly
LLVM version: 15.0.2

Regression

Bisected with cargo-bisect-rustc on x86_64-apple-darwin:

searched nightlies: from nightly-2022-08-23 to nightly-2022-10-26
regressed nightly: nightly-2022-08-31
searched commit range: bc4b39c...02654a0
regressed commit: 0631ea5 (rollup)

Among the commits in the rollup, my guess is #100092 (CC @compiler-errors):

  • It added the function relate_opaques (frame 19 on the first stack).
  • It added a regression test with some similarities: an unconditionally recursive function with impl in return position.

@rustbot label +regression-from-stable-to-beta +A-impl-trait

@jruderman jruderman 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 Oct 26, 2022
@rustbot rustbot added A-impl-trait Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch. regression-from-stable-to-beta Performance or correctness regression from stable to beta. I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Oct 26, 2022
@compiler-errors
Copy link
Member

yup, ez fix incoming

@compiler-errors compiler-errors self-assigned this Oct 26, 2022
@bors bors closed this as completed in 9dd3d29 Oct 27, 2022
@apiraino apiraino removed the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Nov 15, 2022
Aaron1011 pushed a commit to Aaron1011/rust that referenced this issue Jan 6, 2023
…ll-relate, r=oli-obk

Remove `commit_if_ok` probe from NLL type relation

It was not really necessary to add the `commit_if_ok` in rust-lang#100092 -- I added it to protect us against weird inference error messages due to recursive RPIT calls, but we are always on the error path when this happens anyways, and I can't come up with an example that makes this manifest.

Fixes rust-lang#103599

r? `@oli-obk` since you reviewed rust-lang#100092, feel free to re-roll.

:b: :loudspeaker:  beta-nominating this since it's on beta (which forks in ~a week~ two days :fearful:) -- worst case we could revert the original PR on beta and land this on nightly, to give it some extra soak time...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-impl-trait Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch. C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ regression-from-stable-to-beta Performance or correctness regression from stable to beta. 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.

4 participants