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

assertion failed: !value.has_escaping_bound_vars() #101984

Closed
norman784 opened this issue Sep 18, 2022 · 2 comments · Fixed by #102059
Closed

assertion failed: !value.has_escaping_bound_vars() #101984

norman784 opened this issue Sep 18, 2022 · 2 comments · Fixed by #102059
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

@norman784
Copy link

I'm working in a project using Trunk + Dioxus, so this happens when running trunk serve with the following code, it seems that somehow the Dioxus Component has something to to with it, if I change the Component type with a String rustc does not panic.

Code

use dioxus::prelude::*;

struct Wrapper {
  router: matchit::Router<(Component, Box<Self>)>,
}

impl Wrapper {
  fn at(&self, path: &str) -> Result<(Component, Box<Self>), matchit::MatchError> {
    // This code is clearly wrong, but the compiler crash
    let (cmp, router) = self.router.at("/")?;
    // If I write it correctly it does not crash
    // > let (cmp, router) = self.router.at("/")?.value;
    todo!()
  }
}

Meta

rustc --version --verbose:

rustc 1.65.0-nightly (95a992a68 2022-09-16)
binary: rustc
commit-hash: 95a992a68694d8bf3959bd2c0ac27ce9e9208b59
commit-date: 2022-09-16
host: aarch64-apple-darwin
release: 1.65.0-nightly
LLVM version: 15.0.0

Error output

thread 'rustc' panicked at 'assertion failed: !value.has_escaping_bound_vars()', /rustc/95a992a68694d8bf3959bd2c0ac27ce9e9208b59/compiler/rustc_middle/src/ty/sty.rs:1038:9
Backtrace

stack backtrace:
   0:        0x102ba7654 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hed176e37741ed2cd
   1:        0x102bf1c90 - core::fmt::write::h38e6ba8af005765a
   2:        0x102b9a4fc - std::io::Write::write_fmt::h33736c81cdd6b5e7
   3:        0x102ba9ed0 - std::panicking::default_hook::{{closure}}::h8057b647a94361e2
   4:        0x102ba9bf4 - std::panicking::default_hook::hc4236e4126557a5d
   5:        0x10aa25194 - rustc_driver[716cccace25fd8b7]::DEFAULT_HOOK::{closure#0}::{closure#0}
   6:        0x102baa594 - std::panicking::rust_panic_with_hook::h24e9acf31facfee4
   7:        0x102baa404 - std::panicking::begin_panic_handler::{{closure}}::hf15849bcc44d8dee
   8:        0x102ba7abc - std::sys_common::backtrace::__rust_end_short_backtrace::h08db66451e46cd41
   9:        0x102baa194 - _rust_begin_unwind
  10:        0x102c1b744 - core::panicking::panic_fmt::hfca6ebc60afffc55
  11:        0x102c1b664 - core::panicking::panic::hdd1c3d25ff82807a
  12:        0x10e661018 - <rustc_infer[240c37e08d933396]::infer::error_reporting::SameTypeModuloInfer as rustc_middle[beb64dbccabf2a1e]::ty::relate::TypeRelation>::binders::<rustc_middle[beb64dbccabf2a1e]::ty::sty::FnSig>
  13:        0x10e647758 - rustc_middle[beb64dbccabf2a1e]::ty::relate::super_relate_tys::<rustc_infer[240c37e08d933396]::infer::error_reporting::SameTypeModuloInfer>
  14:        0x10e5cef2c - <core[6e33037ab5fb7a5d]::result::Result<rustc_middle[beb64dbccabf2a1e]::ty::Ty, rustc_middle[beb64dbccabf2a1e]::ty::error::TypeError> as rustc_type_ir[6e2c1665a41f335e]::InternIteratorElement<rustc_middle[beb64dbccabf2a1e]::ty::Ty, rustc_middle[beb64dbccabf2a1e]::ty::Ty>>::intern_with::<core[6e33037ab5fb7a5d]::iter::adapters::map::Map<core[6e33037ab5fb7a5d]::iter::adapters::zip::Zip<core[6e33037ab5fb7a5d]::iter::adapters::copied::Copied<core[6e33037ab5fb7a5d]::slice::iter::Iter<rustc_middle[beb64dbccabf2a1e]::ty::Ty>>, core[6e33037ab5fb7a5d]::iter::adapters::copied::Copied<core[6e33037ab5fb7a5d]::slice::iter::Iter<rustc_middle[beb64dbccabf2a1e]::ty::Ty>>>, rustc_middle[beb64dbccabf2a1e]::ty::relate::super_relate_tys<rustc_infer[240c37e08d933396]::infer::error_reporting::SameTypeModuloInfer>::{closure#2}>, <rustc_middle[beb64dbccabf2a1e]::ty::context::TyCtxt>::mk_tup<core[6e33037ab5fb7a5d]::iter::adapters::map::Map<core[6e33037ab5fb7a5d]::iter::adapters::zip::Zip<core[6e33037ab5fb7a5d]::iter::adapters::copied::Copied<core[6e33037ab5fb7a5d]::slice::iter::Iter<rustc_middle[beb64dbccabf2a1e]::ty::Ty>>, core[6e33037ab5fb7a5d]::iter::adapters::copied::Copied<core[6e33037ab5fb7a5d]::slice::iter::Iter<rustc_middle[beb64dbccabf2a1e]::ty::Ty>>>, rustc_middle[beb64dbccabf2a1e]::ty::relate::super_relate_tys<rustc_infer[240c37e08d933396]::infer::error_reporting::SameTypeModuloInfer>::{closure#2}>>::{closure#0}>
  15:        0x10e6475f0 - rustc_middle[beb64dbccabf2a1e]::ty::relate::super_relate_tys::<rustc_infer[240c37e08d933396]::infer::error_reporting::SameTypeModuloInfer>
  16:        0x10e647a00 - rustc_middle[beb64dbccabf2a1e]::ty::relate::super_relate_tys::<rustc_infer[240c37e08d933396]::infer::error_reporting::SameTypeModuloInfer>
  17:        0x10e60f758 - <rustc_middle[beb64dbccabf2a1e]::ty::subst::GenericArg as rustc_middle[beb64dbccabf2a1e]::ty::relate::Relate>::relate::<rustc_infer[240c37e08d933396]::infer::error_reporting::SameTypeModuloInfer>
  18:        0x10e63a6c8 - <core[6e33037ab5fb7a5d]::iter::adapters::map::Map<core[6e33037ab5fb7a5d]::iter::adapters::enumerate::Enumerate<core[6e33037ab5fb7a5d]::iter::adapters::zip::Zip<core[6e33037ab5fb7a5d]::iter::adapters::copied::Copied<core[6e33037ab5fb7a5d]::slice::iter::Iter<rustc_middle[beb64dbccabf2a1e]::ty::subst::GenericArg>>, core[6e33037ab5fb7a5d]::iter::adapters::copied::Copied<core[6e33037ab5fb7a5d]::slice::iter::Iter<rustc_middle[beb64dbccabf2a1e]::ty::subst::GenericArg>>>>, rustc_middle[beb64dbccabf2a1e]::ty::relate::relate_substs_with_variances<rustc_infer[240c37e08d933396]::infer::error_reporting::SameTypeModuloInfer>::{closure#0}> as core[6e33037ab5fb7a5d]::iter::traits::iterator::Iterator>::try_fold::<(), <core[6e33037ab5fb7a5d]::iter::adapters::GenericShunt<core[6e33037ab5fb7a5d]::iter::adapters::map::Map<core[6e33037ab5fb7a5d]::iter::adapters::enumerate::Enumerate<core[6e33037ab5fb7a5d]::iter::adapters::zip::Zip<core[6e33037ab5fb7a5d]::iter::adapters::copied::Copied<core[6e33037ab5fb7a5d]::slice::iter::Iter<rustc_middle[beb64dbccabf2a1e]::ty::subst::GenericArg>>, core[6e33037ab5fb7a5d]::iter::adapters::copied::Copied<core[6e33037ab5fb7a5d]::slice::iter::Iter<rustc_middle[beb64dbccabf2a1e]::ty::subst::GenericArg>>>>, rustc_middle[beb64dbccabf2a1e]::ty::relate::relate_substs_with_variances<rustc_infer[240c37e08d933396]::infer::error_reporting::SameTypeModuloInfer>::{closure#0}>, core[6e33037ab5fb7a5d]::result::Result<core[6e33037ab5fb7a5d]::convert::Infallible, rustc_middle[beb64dbccabf2a1e]::ty::error::TypeError>> as core[6e33037ab5fb7a5d]::iter::traits::iterator::Iterator>::try_fold<(), core[6e33037ab5fb7a5d]::iter::traits::iterator::Iterator::try_for_each::call<rustc_middle[beb64dbccabf2a1e]::ty::subst::GenericArg, core[6e33037ab5fb7a5d]::ops::control_flow::ControlFlow<rustc_middle[beb64dbccabf2a1e]::ty::subst::GenericArg>, core[6e33037ab5fb7a5d]::ops::control_flow::ControlFlow<rustc_middle[beb64dbccabf2a1e]::ty::subst::GenericArg>::Break>::{closure#0}, core[6e33037ab5fb7a5d]::ops::control_flow::ControlFlow<rustc_middle[beb64dbccabf2a1e]::ty::subst::GenericArg>>::{closure#0}, core[6e33037ab5fb7a5d]::ops::control_flow::ControlFlow<core[6e33037ab5fb7a5d]::ops::control_flow::ControlFlow<rustc_middle[beb64dbccabf2a1e]::ty::subst::GenericArg>>>
  19:        0x10e658788 - <smallvec[4a001cf8776ee13a]::SmallVec<[rustc_middle[beb64dbccabf2a1e]::ty::subst::GenericArg; 8usize]> as core[6e33037ab5fb7a5d]::iter::traits::collect::Extend<rustc_middle[beb64dbccabf2a1e]::ty::subst::GenericArg>>::extend::<core[6e33037ab5fb7a5d]::iter::adapters::GenericShunt<core[6e33037ab5fb7a5d]::iter::adapters::map::Map<core[6e33037ab5fb7a5d]::iter::adapters::enumerate::Enumerate<core[6e33037ab5fb7a5d]::iter::adapters::zip::Zip<core[6e33037ab5fb7a5d]::iter::adapters::copied::Copied<core[6e33037ab5fb7a5d]::slice::iter::Iter<rustc_middle[beb64dbccabf2a1e]::ty::subst::GenericArg>>, core[6e33037ab5fb7a5d]::iter::adapters::copied::Copied<core[6e33037ab5fb7a5d]::slice::iter::Iter<rustc_middle[beb64dbccabf2a1e]::ty::subst::GenericArg>>>>, rustc_middle[beb64dbccabf2a1e]::ty::relate::relate_substs_with_variances<rustc_infer[240c37e08d933396]::infer::error_reporting::SameTypeModuloInfer>::{closure#0}>, core[6e33037ab5fb7a5d]::result::Result<core[6e33037ab5fb7a5d]::convert::Infallible, rustc_middle[beb64dbccabf2a1e]::ty::error::TypeError>>>
  20:        0x10e5d9700 - <core[6e33037ab5fb7a5d]::result::Result<rustc_middle[beb64dbccabf2a1e]::ty::subst::GenericArg, rustc_middle[beb64dbccabf2a1e]::ty::error::TypeError> as rustc_type_ir[6e2c1665a41f335e]::InternIteratorElement<rustc_middle[beb64dbccabf2a1e]::ty::subst::GenericArg, &rustc_middle[beb64dbccabf2a1e]::ty::list::List<rustc_middle[beb64dbccabf2a1e]::ty::subst::GenericArg>>>::intern_with::<core[6e33037ab5fb7a5d]::iter::adapters::map::Map<core[6e33037ab5fb7a5d]::iter::adapters::enumerate::Enumerate<core[6e33037ab5fb7a5d]::iter::adapters::zip::Zip<core[6e33037ab5fb7a5d]::iter::adapters::copied::Copied<core[6e33037ab5fb7a5d]::slice::iter::Iter<rustc_middle[beb64dbccabf2a1e]::ty::subst::GenericArg>>, core[6e33037ab5fb7a5d]::iter::adapters::copied::Copied<core[6e33037ab5fb7a5d]::slice::iter::Iter<rustc_middle[beb64dbccabf2a1e]::ty::subst::GenericArg>>>>, rustc_middle[beb64dbccabf2a1e]::ty::relate::relate_substs_with_variances<rustc_infer[240c37e08d933396]::infer::error_reporting::SameTypeModuloInfer>::{closure#0}>, <rustc_middle[beb64dbccabf2a1e]::ty::context::TyCtxt>::mk_substs<core[6e33037ab5fb7a5d]::iter::adapters::map::Map<core[6e33037ab5fb7a5d]::iter::adapters::enumerate::Enumerate<core[6e33037ab5fb7a5d]::iter::adapters::zip::Zip<core[6e33037ab5fb7a5d]::iter::adapters::copied::Copied<core[6e33037ab5fb7a5d]::slice::iter::Iter<rustc_middle[beb64dbccabf2a1e]::ty::subst::GenericArg>>, core[6e33037ab5fb7a5d]::iter::adapters::copied::Copied<core[6e33037ab5fb7a5d]::slice::iter::Iter<rustc_middle[beb64dbccabf2a1e]::ty::subst::GenericArg>>>>, rustc_middle[beb64dbccabf2a1e]::ty::relate::relate_substs_with_variances<rustc_infer[240c37e08d933396]::infer::error_reporting::SameTypeModuloInfer>::{closure#0}>>::{closure#0}>
  21:        0x10e65d918 - <rustc_infer[240c37e08d933396]::infer::error_reporting::SameTypeModuloInfer as rustc_middle[beb64dbccabf2a1e]::ty::relate::TypeRelation>::relate_item_substs
  22:        0x10e6473e4 - rustc_middle[beb64dbccabf2a1e]::ty::relate::super_relate_tys::<rustc_infer[240c37e08d933396]::infer::error_reporting::SameTypeModuloInfer>
  23:        0x10e59f3c4 - <rustc_infer[240c37e08d933396]::infer::InferCtxt>::note_type_err
  24:        0x10e594a80 - <rustc_infer[240c37e08d933396]::infer::InferCtxt>::report_and_explain_type_error
  25:        0x10e59cc14 - <rustc_infer[240c37e08d933396]::infer::InferCtxt>::report_mismatched_types
  26:        0x10d008bd0 - <rustc_typeck[7246040baf288399]::check::fn_ctxt::FnCtxt>::demand_eqtype_with_origin
  27:        0x10d059c84 - <rustc_typeck[7246040baf288399]::check::fn_ctxt::FnCtxt>::check_pat
  28:        0x10d01d3a4 - <rustc_typeck[7246040baf288399]::check::fn_ctxt::FnCtxt>::check_decl
  29:        0x10d01d654 - <rustc_typeck[7246040baf288399]::check::fn_ctxt::FnCtxt>::check_stmt
  30:        0x10d01ddf4 - <rustc_typeck[7246040baf288399]::check::fn_ctxt::FnCtxt>::check_block_with_expected
  31:        0x10d04b71c - <rustc_typeck[7246040baf288399]::check::fn_ctxt::FnCtxt>::check_expr_kind
  32:        0x10d00cf50 - <rustc_typeck[7246040baf288399]::check::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  33:        0x10d00dc20 - <rustc_typeck[7246040baf288399]::check::fn_ctxt::FnCtxt>::check_return_expr
  34:        0x10d1869b4 - rustc_typeck[7246040baf288399]::check::check::check_fn
  35:        0x10d1fcc40 - <rustc_infer[240c37e08d933396]::infer::InferCtxtBuilder>::enter::<&rustc_middle[beb64dbccabf2a1e]::ty::context::TypeckResults, <rustc_typeck[7246040baf288399]::check::inherited::InheritedBuilder>::enter<rustc_typeck[7246040baf288399]::check::typeck_with_fallback<rustc_typeck[7246040baf288399]::check::typeck::{closure#0}>::{closure#1}, &rustc_middle[beb64dbccabf2a1e]::ty::context::TypeckResults>::{closure#0}>
  36:        0x10d0faf34 - rustc_typeck[7246040baf288399]::check::typeck
  37:        0x10dc16a70 - <rustc_query_system[997652f36acd976b]::dep_graph::graph::DepGraph<rustc_middle[beb64dbccabf2a1e]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[beb64dbccabf2a1e]::ty::context::TyCtxt, rustc_span[73ad1af552d8b2f2]::def_id::LocalDefId, &rustc_middle[beb64dbccabf2a1e]::ty::context::TypeckResults>
  38:        0x10d9ecaa8 - rustc_query_system[997652f36acd976b]::query::plumbing::try_execute_query::<rustc_query_impl[151c023b99578808]::plumbing::QueryCtxt, rustc_query_system[997652f36acd976b]::query::caches::DefaultCache<rustc_span[73ad1af552d8b2f2]::def_id::LocalDefId, &rustc_middle[beb64dbccabf2a1e]::ty::context::TypeckResults>>
  39:        0x10d988f60 - rustc_query_system[997652f36acd976b]::query::plumbing::force_query::<rustc_query_impl[151c023b99578808]::queries::typeck, rustc_query_impl[151c023b99578808]::plumbing::QueryCtxt>
  40:        0x10dcaf9bc - rustc_query_impl[151c023b99578808]::plumbing::force_from_dep_node::<rustc_query_impl[151c023b99578808]::queries::typeck>
  41:        0x10e747518 - <rustc_middle[beb64dbccabf2a1e]::ty::context::TyCtxt as rustc_query_system[997652f36acd976b]::dep_graph::DepContext>::try_force_from_dep_node
  42:        0x10dc045f0 - <rustc_query_system[997652f36acd976b]::dep_graph::graph::DepGraph<rustc_middle[beb64dbccabf2a1e]::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl[151c023b99578808]::plumbing::QueryCtxt>
  43:        0x10dbd4ab4 - <rustc_query_system[997652f36acd976b]::dep_graph::graph::DepGraph<rustc_middle[beb64dbccabf2a1e]::dep_graph::dep_node::DepKind>>::try_mark_green::<rustc_query_impl[151c023b99578808]::plumbing::QueryCtxt>
  44:        0x10da93720 - rustc_query_system[997652f36acd976b]::query::plumbing::try_load_from_disk_and_cache_in_memory::<rustc_query_impl[151c023b99578808]::plumbing::QueryCtxt, (), ()>
  45:        0x10da52258 - rustc_query_system[997652f36acd976b]::query::plumbing::try_execute_query::<rustc_query_impl[151c023b99578808]::plumbing::QueryCtxt, rustc_query_system[997652f36acd976b]::query::caches::DefaultCache<(), ()>>
  46:        0x10da9dc70 - rustc_query_system[997652f36acd976b]::query::plumbing::get_query::<rustc_query_impl[151c023b99578808]::queries::typeck_item_bodies, rustc_query_impl[151c023b99578808]::plumbing::QueryCtxt>
  47:        0x10d108180 - <rustc_session[dacf65a084a0f59c]::session::Session>::time::<(), rustc_typeck[7246040baf288399]::check_crate::{closure#7}>
  48:        0x10d259bf4 - rustc_typeck[7246040baf288399]::check_crate
  49:        0x10ab35c30 - rustc_interface[35d946fbdec3a294]::passes::analysis
  50:        0x10dc3ae84 - <rustc_query_system[997652f36acd976b]::dep_graph::graph::DepGraph<rustc_middle[beb64dbccabf2a1e]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[beb64dbccabf2a1e]::ty::context::TyCtxt, (), core[6e33037ab5fb7a5d]::result::Result<(), rustc_errors[1ff40973d6a72917]::ErrorGuaranteed>>
  51:        0x10da47648 - rustc_query_system[997652f36acd976b]::query::plumbing::try_execute_query::<rustc_query_impl[151c023b99578808]::plumbing::QueryCtxt, rustc_query_system[997652f36acd976b]::query::caches::DefaultCache<(), core[6e33037ab5fb7a5d]::result::Result<(), rustc_errors[1ff40973d6a72917]::ErrorGuaranteed>>>
  52:        0x10daaeca4 - rustc_query_system[997652f36acd976b]::query::plumbing::get_query::<rustc_query_impl[151c023b99578808]::queries::analysis, rustc_query_impl[151c023b99578808]::plumbing::QueryCtxt>
  53:        0x10aa55c20 - <rustc_interface[35d946fbdec3a294]::passes::QueryContext>::enter::<rustc_driver[716cccace25fd8b7]::run_compiler::{closure#1}::{closure#2}::{closure#3}, core[6e33037ab5fb7a5d]::result::Result<(), rustc_errors[1ff40973d6a72917]::ErrorGuaranteed>>
  54:        0x10aa2ac30 - rustc_interface[35d946fbdec3a294]::interface::create_compiler_and_run::<core[6e33037ab5fb7a5d]::result::Result<(), rustc_errors[1ff40973d6a72917]::ErrorGuaranteed>, rustc_driver[716cccace25fd8b7]::run_compiler::{closure#1}>
  55:        0x10aa8fc6c - <scoped_tls[df90f66c05e7dd57]::ScopedKey<rustc_span[73ad1af552d8b2f2]::SessionGlobals>>::set::<rustc_interface[35d946fbdec3a294]::interface::run_compiler<core[6e33037ab5fb7a5d]::result::Result<(), rustc_errors[1ff40973d6a72917]::ErrorGuaranteed>, rustc_driver[716cccace25fd8b7]::run_compiler::{closure#1}>::{closure#0}, core[6e33037ab5fb7a5d]::result::Result<(), rustc_errors[1ff40973d6a72917]::ErrorGuaranteed>>
  56:        0x10aa59994 - std[12fd4fbe774fe0f1]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[35d946fbdec3a294]::util::run_in_thread_pool_with_globals<rustc_interface[35d946fbdec3a294]::interface::run_compiler<core[6e33037ab5fb7a5d]::result::Result<(), rustc_errors[1ff40973d6a72917]::ErrorGuaranteed>, rustc_driver[716cccace25fd8b7]::run_compiler::{closure#1}>::{closure#0}, core[6e33037ab5fb7a5d]::result::Result<(), rustc_errors[1ff40973d6a72917]::ErrorGuaranteed>>::{closure#0}, core[6e33037ab5fb7a5d]::result::Result<(), rustc_errors[1ff40973d6a72917]::ErrorGuaranteed>>
  57:        0x10aa5c818 - <<std[12fd4fbe774fe0f1]::thread::Builder>::spawn_unchecked_<rustc_interface[35d946fbdec3a294]::util::run_in_thread_pool_with_globals<rustc_interface[35d946fbdec3a294]::interface::run_compiler<core[6e33037ab5fb7a5d]::result::Result<(), rustc_errors[1ff40973d6a72917]::ErrorGuaranteed>, rustc_driver[716cccace25fd8b7]::run_compiler::{closure#1}>::{closure#0}, core[6e33037ab5fb7a5d]::result::Result<(), rustc_errors[1ff40973d6a72917]::ErrorGuaranteed>>::{closure#0}, core[6e33037ab5fb7a5d]::result::Result<(), rustc_errors[1ff40973d6a72917]::ErrorGuaranteed>>::{closure#1} as core[6e33037ab5fb7a5d]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  58:        0x102bb2430 - std::sys::unix::thread::Thread::new::thread_start::hbcfe4a3752445b8a
  59:        0x19f57426c - __pthread_deallocate

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.65.0-nightly (95a992a68 2022-09-16) running on aarch64-apple-darwin

note: compiler flags: --crate-type lib -C embed-bitcode=no -C debuginfo=2 -C incremental=[REDACTED]

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [typeck] type-checking `rust_error::<impl at ./src/rust_error.rs:7:1: 7:13>::at`
#1 [typeck_item_bodies] type-checking all item bodies
#2 [analysis] running analysis passes on this crate
end of query stack
error: internal compiler error: no warnings or errors encountered even though `delayed_good_path_bugs` issued

error: internal compiler error: trimmed_def_paths constructed
  |
  = note: delayed at    0: std::backtrace::Backtrace::create
             1: <rustc_errors::Handler>::delay_good_path_bug::<&str>
             2: rustc_middle::ty::print::pretty::trimmed_def_paths
             3: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle::ty::context::TyCtxt, (), std::collections::hash::map::HashMap<rustc_span::def_id::DefId, rustc_span::symbol::Symbol, core::hash::BuildHasherDefault<rustc_hash::FxHasher>>>
             4: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::plumbing::QueryCtxt, rustc_query_system::query::caches::ArenaCache<(), std::collections::hash::map::HashMap<rustc_span::def_id::DefId, rustc_span::symbol::Symbol, core::hash::BuildHasherDefault<rustc_hash::FxHasher>>>>
             5: rustc_query_system::query::plumbing::get_query::<rustc_query_impl::queries::trimmed_def_paths, rustc_query_impl::plumbing::QueryCtxt>
             6: <rustc_middle::ty::print::pretty::FmtPrinter as rustc_middle::ty::print::Printer>::print_def_path
             7: <rustc_middle::ty::print::pretty::FmtPrinter as rustc_middle::ty::print::Printer>::path_generic_args::<<rustc_middle::ty::print::pretty::FmtPrinter as rustc_middle::ty::print::Printer>::default_print_def_path::{closure#2}>
             8: <rustc_middle::ty::print::pretty::FmtPrinter as rustc_middle::ty::print::Printer>::print_def_path
             9: <rustc_middle::ty::print::pretty::FmtPrinter as rustc_middle::ty::print::Printer>::print_type
            10: <rustc_middle::ty::Ty as core::fmt::Display>::fmt
            11: <rustc_infer::infer::InferCtxt>::cmp
            12: <rustc_infer::infer::InferCtxt>::values_str
            13: <rustc_infer::infer::InferCtxt>::note_type_err
            14: <rustc_infer::infer::InferCtxt>::report_and_explain_type_error
            15: <rustc_infer::infer::InferCtxt>::report_mismatched_types
            16: <rustc_typeck::check::fn_ctxt::FnCtxt>::demand_eqtype_with_origin
            17: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_pat
            18: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_decl
            19: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_stmt
            20: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_block_with_expected
            21: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_kind
            22: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
            23: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_return_expr
            24: rustc_typeck::check::check::check_fn
            25: <rustc_infer::infer::InferCtxtBuilder>::enter::<&rustc_middle::ty::context::TypeckResults, <rustc_typeck::check::inherited::InheritedBuilder>::enter<rustc_typeck::check::typeck_with_fallback<rustc_typeck::check::typeck::{closure#0}>::{closure#1}, &rustc_middle::ty::context::TypeckResults>::{closure#0}>
            26: rustc_typeck::check::typeck
            27: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle::ty::context::TyCtxt, rustc_span::def_id::LocalDefId, &rustc_middle::ty::context::TypeckResults>
            28: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::plumbing::QueryCtxt, rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::LocalDefId, &rustc_middle::ty::context::TypeckResults>>
            29: rustc_query_system::query::plumbing::force_query::<rustc_query_impl::queries::typeck, rustc_query_impl::plumbing::QueryCtxt>
            30: rustc_query_impl::plumbing::force_from_dep_node::<rustc_query_impl::queries::typeck>
            31: <rustc_middle::ty::context::TyCtxt as rustc_query_system::dep_graph::DepContext>::try_force_from_dep_node
            32: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
            33: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::try_mark_green::<rustc_query_impl::plumbing::QueryCtxt>
            34: rustc_query_system::query::plumbing::try_load_from_disk_and_cache_in_memory::<rustc_query_impl::plumbing::QueryCtxt, (), ()>
            35: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::plumbing::QueryCtxt, rustc_query_system::query::caches::DefaultCache<(), ()>>
            36: rustc_query_system::query::plumbing::get_query::<rustc_query_impl::queries::typeck_item_bodies, rustc_query_impl::plumbing::QueryCtxt>
            37: <rustc_session::session::Session>::time::<(), rustc_typeck::check_crate::{closure#7}>
            38: rustc_typeck::check_crate
            39: rustc_interface::passes::analysis
            40: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle::ty::context::TyCtxt, (), core::result::Result<(), rustc_errors::ErrorGuaranteed>>
            41: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::plumbing::QueryCtxt, rustc_query_system::query::caches::DefaultCache<(), core::result::Result<(), rustc_errors::ErrorGuaranteed>>>
            42: rustc_query_system::query::plumbing::get_query::<rustc_query_impl::queries::analysis, rustc_query_impl::plumbing::QueryCtxt>
            43: <rustc_interface::passes::QueryContext>::enter::<rustc_driver::run_compiler::{closure#1}::{closure#2}::{closure#3}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>
            44: rustc_interface::interface::create_compiler_and_run::<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>
            45: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>
            46: std::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>
            47: <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
            48: std::sys::unix::thread::Thread::new::thread_start
            49: __pthread_deallocate


thread 'rustc' panicked at 'Box<dyn Any>', compiler/rustc_errors/src/lib.rs:1492:13
stack backtrace:
   0:        0x102ba7654 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hed176e37741ed2cd
   1:        0x102bf1c90 - core::fmt::write::h38e6ba8af005765a
   2:        0x102b9a4fc - std::io::Write::write_fmt::h33736c81cdd6b5e7
   3:        0x102ba9ed0 - std::panicking::default_hook::{{closure}}::h8057b647a94361e2
   4:        0x102ba9bf4 - std::panicking::default_hook::hc4236e4126557a5d
   5:        0x10aa25194 - rustc_driver[716cccace25fd8b7]::DEFAULT_HOOK::{closure#0}::{closure#0}
   6:        0x102baa594 - std::panicking::rust_panic_with_hook::h24e9acf31facfee4
   7:        0x10e957e84 - std[12fd4fbe774fe0f1]::panicking::begin_panic::<rustc_errors[1ff40973d6a72917]::ExplicitBug>::{closure#0}
   8:        0x10e9576d0 - std[12fd4fbe774fe0f1]::sys_common::backtrace::__rust_end_short_backtrace::<std[12fd4fbe774fe0f1]::panicking::begin_panic<rustc_errors[1ff40973d6a72917]::ExplicitBug>::{closure#0}, !>
   9:        0x10ec4598c - std[12fd4fbe774fe0f1]::panicking::begin_panic::<rustc_errors[1ff40973d6a72917]::ExplicitBug>
  10:        0x10e94e1cc - std[12fd4fbe774fe0f1]::panic::panic_any::<rustc_errors[1ff40973d6a72917]::ExplicitBug>
  11:        0x10e95233c - <rustc_errors[1ff40973d6a72917]::HandlerInner as core[6e33037ab5fb7a5d]::ops::drop::Drop>::drop
  12:        0x10aa50d3c - core[6e33037ab5fb7a5d]::ptr::drop_in_place::<rustc_session[dacf65a084a0f59c]::parse::ParseSess>
  13:        0x10aa53f8c - <alloc[216ef607c57f0648]::rc::Rc<rustc_session[dacf65a084a0f59c]::session::Session> as core[6e33037ab5fb7a5d]::ops::drop::Drop>::drop
  14:        0x10aa3d470 - core[6e33037ab5fb7a5d]::ptr::drop_in_place::<rustc_interface[35d946fbdec3a294]::interface::Compiler>
  15:        0x10aa2b164 - rustc_interface[35d946fbdec3a294]::interface::create_compiler_and_run::<core[6e33037ab5fb7a5d]::result::Result<(), rustc_errors[1ff40973d6a72917]::ErrorGuaranteed>, rustc_driver[716cccace25fd8b7]::run_compiler::{closure#1}>
  16:        0x10aa8fc6c - <scoped_tls[df90f66c05e7dd57]::ScopedKey<rustc_span[73ad1af552d8b2f2]::SessionGlobals>>::set::<rustc_interface[35d946fbdec3a294]::interface::run_compiler<core[6e33037ab5fb7a5d]::result::Result<(), rustc_errors[1ff40973d6a72917]::ErrorGuaranteed>, rustc_driver[716cccace25fd8b7]::run_compiler::{closure#1}>::{closure#0}, core[6e33037ab5fb7a5d]::result::Result<(), rustc_errors[1ff40973d6a72917]::ErrorGuaranteed>>
  17:        0x10aa59994 - std[12fd4fbe774fe0f1]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[35d946fbdec3a294]::util::run_in_thread_pool_with_globals<rustc_interface[35d946fbdec3a294]::interface::run_compiler<core[6e33037ab5fb7a5d]::result::Result<(), rustc_errors[1ff40973d6a72917]::ErrorGuaranteed>, rustc_driver[716cccace25fd8b7]::run_compiler::{closure#1}>::{closure#0}, core[6e33037ab5fb7a5d]::result::Result<(), rustc_errors[1ff40973d6a72917]::ErrorGuaranteed>>::{closure#0}, core[6e33037ab5fb7a5d]::result::Result<(), rustc_errors[1ff40973d6a72917]::ErrorGuaranteed>>
  18:        0x10aa5c818 - <<std[12fd4fbe774fe0f1]::thread::Builder>::spawn_unchecked_<rustc_interface[35d946fbdec3a294]::util::run_in_thread_pool_with_globals<rustc_interface[35d946fbdec3a294]::interface::run_compiler<core[6e33037ab5fb7a5d]::result::Result<(), rustc_errors[1ff40973d6a72917]::ErrorGuaranteed>, rustc_driver[716cccace25fd8b7]::run_compiler::{closure#1}>::{closure#0}, core[6e33037ab5fb7a5d]::result::Result<(), rustc_errors[1ff40973d6a72917]::ErrorGuaranteed>>::{closure#0}, core[6e33037ab5fb7a5d]::result::Result<(), rustc_errors[1ff40973d6a72917]::ErrorGuaranteed>>::{closure#1} as core[6e33037ab5fb7a5d]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  19:        0x102bb2430 - std::sys::unix::thread::Thread::new::thread_start::hbcfe4a3752445b8a
  20:        0x19f57426c - __pthread_deallocate

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.65.0-nightly (95a992a68 2022-09-16) running on aarch64-apple-darwin

note: compiler flags: --crate-type lib -C embed-bitcode=no -C debuginfo=2 -C incremental=[REDACTED]

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
end of query stack
thread panicked while panicking. aborting.
error: could not compile `mylib`

Caused by:
  process didn't exit successfully: `rustc --crate-name mylib --edition=2021 ./src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 -C metadata=a78be57d9ea01d50 -C extra-filename=-a78be57d9ea01d50 --out-dir ./target/wasm32-unknown-unknown/debug/deps --target wasm32-unknown-unknown -C incremental=./target/wasm32-unknown-unknown/debug/incremental -L dependency=./target/wasm32-unknown-unknown/debug/deps -L dependency=./target/debug/deps --extern mylib_macros=./target/debug/deps/libmylib_macros-4cd2d816acc9eea9.dylib --extern dioxus=./target/wasm32-unknown-unknown/debug/deps/libdioxus-f3e3017306e1eefe.rmeta --extern dioxus_web=./target/wasm32-unknown-unknown/debug/deps/libdioxus_web-a6c0857fa5cec363.rmeta --extern gloo=./target/wasm32-unknown-unknown/debug/deps/libgloo-c9e19c5780d4226f.rmeta --extern hex=./target/wasm32-unknown-unknown/debug/deps/libhex-0aa0bd47873ee34f.rmeta --extern matchit=./target/wasm32-unknown-unknown/debug/deps/libmatchit-90fe648f1a4aff54.rmeta --extern sha2=./target/wasm32-unknown-unknown/debug/deps/libsha2-484bbbd8f4da2614.rmeta --extern tracing=./target/wasm32-unknown-unknown/debug/deps/libtracing-94d706777db341d0.rmeta --extern wasm_bindgen=./target/wasm32-unknown-unknown/debug/deps/libwasm_bindgen-4dfb8ab153cbf1a8.rmeta --extern web_sys=./target/wasm32-unknown-unknown/debug/deps/libweb_sys-9fa0589b17e50be3.rmeta` (signal: 6, SIGABRT: process abort signal)

@norman784 norman784 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 Sep 18, 2022
@compiler-errors compiler-errors self-assigned this Sep 18, 2022
@matthiaskrgr
Copy link
Member

#99647 for same ice msg but without external dependency

@compiler-errors
Copy link
Member

Probably a different root cause, even if they have the same message.

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Sep 21, 2022
…ckh726

Use rebind instead of dummy binder in `SameTypeModuloInfer` relation

Lazy binder usage (sorry, my fault) + assertion in `Binder::dummy`

Fixes rust-lang#101984
@bors bors closed this as completed in 39bb2a7 Sep 21, 2022
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