Skip to content

ice: cannot relate bound region #109603

Closed as not planned
Closed as not planned

Description

Code

use std::marker::PhantomData;

pub struct S<'a> {_p: PhantomData<&'a ()>}

trait Trait {}

impl<F> Trait for F
where
    F: FnMut(&S<'_>) -> bool,
{}

/// Matches all events _after_ start and _before_ end. (Excluding start and end.)
struct Container<A>
where
    A: Trait,
{
    inner: A,
}

impl<A> Container<A>
where
    A: Trait,
{
    fn new(inner: A) -> Self {
        Self { inner }
    }
}

fn main () {
    let closure = |ev: S<'_>| false;

    let mut btw = Container::new(closure);
}

Meta

rustc --version --verbose:

rustc 1.68.1 (8460ca823 2023-03-20)
binary: rustc
commit-hash: 8460ca823e8367a30dda430efda790588b8c84d3
commit-date: 2023-03-20
host: x86_64-unknown-linux-gnu
release: 1.68.1
LLVM version: 15.0.6

The bug does not exist in the nightly version:

rustc 1.70.0-nightly (8be3c2bda 2023-03-24)
binary: rustc
commit-hash: 8be3c2bda6b683f87b24714ba595e8b04faef54c
commit-date: 2023-03-24
host: x86_64-unknown-linux-gnu
release: 1.70.0-nightly
LLVM version: 15.0.7

Error output

    Checking test-ra v0.1.0 (/home/desmond-lin-7/rust/test-ra)
error: internal compiler error: compiler/rustc_infer/src/infer/region_constraints/mod.rs:568:17: cannot relate bound region: ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:20 ~ test_ra[0afa]::main::'_), '_) }) <= ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed(DefId(0:19 ~ test_ra[0afa]::{impl#0}::'_#1), '_) })

thread 'rustc' panicked at 'Box<dyn Any>', /rustc/8460ca823e8367a30dda430efda790588b8c84d3/compiler/rustc_errors/src/lib.rs:987:33
stack backtrace:
   0:     0x7f10ba7c359a - std::backtrace_rs::backtrace::libunwind::trace::hba70c054c9cdbd74
                               at /rustc/8460ca823e8367a30dda430efda790588b8c84d3/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f10ba7c359a - std::backtrace_rs::backtrace::trace_unsynchronized::hfff24a4d77b00fef
                               at /rustc/8460ca823e8367a30dda430efda790588b8c84d3/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f10ba7c359a - std::sys_common::backtrace::_print_fmt::h6fb3e9652d3b4f4e
                               at /rustc/8460ca823e8367a30dda430efda790588b8c84d3/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7f10ba7c359a - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h254ba81a1e20fed0
                               at /rustc/8460ca823e8367a30dda430efda790588b8c84d3/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f10ba82539e - core::fmt::write::h232ccd94259bfe24
                               at /rustc/8460ca823e8367a30dda430efda790588b8c84d3/library/core/src/fmt/mod.rs:1213:17
   5:     0x7f10ba7b3ce5 - std::io::Write::write_fmt::h963cfaecfdd596f7
                               at /rustc/8460ca823e8367a30dda430efda790588b8c84d3/library/std/src/io/mod.rs:1682:15
   6:     0x7f10ba7c3365 - std::sys_common::backtrace::_print::h6fbc4343523214ce
                               at /rustc/8460ca823e8367a30dda430efda790588b8c84d3/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x7f10ba7c3365 - std::sys_common::backtrace::print::h55ab07cec21aacd5
                               at /rustc/8460ca823e8367a30dda430efda790588b8c84d3/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x7f10ba7c612f - std::panicking::default_hook::{{closure}}::hc10df65206eee69e
                               at /rustc/8460ca823e8367a30dda430efda790588b8c84d3/library/std/src/panicking.rs:267:22
   9:     0x7f10ba7c5e6b - std::panicking::default_hook::hdd684731d8d78925
                               at /rustc/8460ca823e8367a30dda430efda790588b8c84d3/library/std/src/panicking.rs:286:9
  10:     0x7f10bdb206c4 - <rustc_driver[e9760e9ac6ccf54d]::DEFAULT_HOOK::{closure#0}::{closure#0} as core[77bef6d69d927b7]::ops::function::FnOnce<(&core[77bef6d69d927b7]::panic::panic_info::PanicInfo,)>>::call_once::{shim:vtable#0}
  11:     0x7f10ba7c696a - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::he42fab2119ecbaf0
                               at /rustc/8460ca823e8367a30dda430efda790588b8c84d3/library/alloc/src/boxed.rs:2002:9
  12:     0x7f10ba7c696a - std::panicking::rust_panic_with_hook::h58681788b2d08dc0
                               at /rustc/8460ca823e8367a30dda430efda790588b8c84d3/library/std/src/panicking.rs:692:13
  13:     0x7f10bdddc681 - std[be43af764720b20]::panicking::begin_panic::<rustc_errors[698eb27c3a994f58]::ExplicitBug>::{closure#0}
  14:     0x7f10bddd4fd6 - std[be43af764720b20]::sys_common::backtrace::__rust_end_short_backtrace::<std[be43af764720b20]::panicking::begin_panic<rustc_errors[698eb27c3a994f58]::ExplicitBug>::{closure#0}, !>
  15:     0x7f10bde64e26 - std[be43af764720b20]::panicking::begin_panic::<rustc_errors[698eb27c3a994f58]::ExplicitBug>
  16:     0x7f10bde64e16 - std[be43af764720b20]::panic::panic_any::<rustc_errors[698eb27c3a994f58]::ExplicitBug>
  17:     0x7f10bde63c92 - <rustc_errors[698eb27c3a994f58]::HandlerInner>::span_bug::<rustc_span[64b0522548f33ee1]::span_encoding::Span, &alloc[bd0f9414e0d9e44e]::string::String>
  18:     0x7f10bde63b37 - <rustc_errors[698eb27c3a994f58]::Handler>::span_bug::<rustc_span[64b0522548f33ee1]::span_encoding::Span, &alloc[bd0f9414e0d9e44e]::string::String>
  19:     0x7f10bde1913b - rustc_middle[cb60ee63c17a43c3]::util::bug::opt_span_bug_fmt::<rustc_span[64b0522548f33ee1]::span_encoding::Span>::{closure#0}
  20:     0x7f10bde1918a - rustc_middle[cb60ee63c17a43c3]::ty::context::tls::with_opt::<rustc_middle[cb60ee63c17a43c3]::util::bug::opt_span_bug_fmt<rustc_span[64b0522548f33ee1]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  21:     0x7f10bde1824a - rustc_middle[cb60ee63c17a43c3]::ty::context::tls::with_context_opt::<rustc_middle[cb60ee63c17a43c3]::ty::context::tls::with_opt<rustc_middle[cb60ee63c17a43c3]::util::bug::opt_span_bug_fmt<rustc_span[64b0522548f33ee1]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  22:     0x7f10bde18176 - rustc_middle[cb60ee63c17a43c3]::util::bug::opt_span_bug_fmt::<rustc_span[64b0522548f33ee1]::span_encoding::Span>
  23:     0x7f10bde18134 - rustc_middle[cb60ee63c17a43c3]::util::bug::span_bug_fmt::<rustc_span[64b0522548f33ee1]::span_encoding::Span>
  24:     0x7f10bba9f964 - <rustc_middle[cb60ee63c17a43c3]::ty::sty::Region as rustc_middle[cb60ee63c17a43c3]::ty::relate::Relate>::relate::<rustc_infer[99c2bcef2aa6f09]::infer::equate::Equate>
  25:     0x7f10bba9ac1f - rustc_middle[cb60ee63c17a43c3]::ty::relate::super_relate_tys::<rustc_infer[99c2bcef2aa6f09]::infer::equate::Equate>
  26:     0x7f10bba97c1e - <rustc_infer[99c2bcef2aa6f09]::infer::equate::Equate as rustc_middle[cb60ee63c17a43c3]::ty::relate::TypeRelation>::tys
  27:     0x7f10bc3e3263 - <rustc_infer[99c2bcef2aa6f09]::infer::InferCtxt>::commit_if_ok::<rustc_infer[99c2bcef2aa6f09]::infer::InferOk<()>, rustc_middle[cb60ee63c17a43c3]::ty::error::TypeError, <rustc_infer[99c2bcef2aa6f09]::infer::at::Trace>::eq<rustc_middle[cb60ee63c17a43c3]::ty::Ty>::{closure#0}>
  28:     0x7f10bc3e3156 - <rustc_infer[99c2bcef2aa6f09]::infer::at::At>::eq::<rustc_middle[cb60ee63c17a43c3]::ty::Ty>
  29:     0x7f10be6feb2e - <rustc_infer[99c2bcef2aa6f09]::infer::InferCtxt>::can_eq::<rustc_middle[cb60ee63c17a43c3]::ty::Ty>
  30:     0x7f10be6e1a82 - rustc_trait_selection[52a9c14cdc821adb]::traits::error_reporting::suggestions::hint_missing_borrow
  31:     0x7f10be784ad4 - <rustc_infer[99c2bcef2aa6f09]::infer::error_reporting::TypeErrCtxt as rustc_trait_selection[52a9c14cdc821adb]::traits::error_reporting::suggestions::TypeErrCtxtExt>::report_closure_arg_mismatch
  32:     0x7f10be794928 - <rustc_infer[99c2bcef2aa6f09]::infer::error_reporting::TypeErrCtxt as rustc_trait_selection[52a9c14cdc821adb]::traits::error_reporting::TypeErrCtxtExt>::report_selection_error
  33:     0x7f10be79e307 - <rustc_infer[99c2bcef2aa6f09]::infer::error_reporting::TypeErrCtxt as rustc_trait_selection[52a9c14cdc821adb]::traits::error_reporting::InferCtxtPrivExt>::report_fulfillment_error
  34:     0x7f10be79196f - <rustc_infer[99c2bcef2aa6f09]::infer::error_reporting::TypeErrCtxt as rustc_trait_selection[52a9c14cdc821adb]::traits::error_reporting::TypeErrCtxtExt>::report_fulfillment_errors
  35:     0x7f10bbd1c115 - <rustc_hir_typeck[ae1c700836d8ac2c]::fn_ctxt::FnCtxt>::check_argument_types
  36:     0x7f10bce2b52e - <rustc_hir_typeck[ae1c700836d8ac2c]::fn_ctxt::FnCtxt>::check_call
  37:     0x7f10bbca1432 - <rustc_hir_typeck[ae1c700836d8ac2c]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  38:     0x7f10bbcda20e - <rustc_hir_typeck[ae1c700836d8ac2c]::fn_ctxt::FnCtxt>::check_decl
  39:     0x7f10bbcd7313 - <rustc_hir_typeck[ae1c700836d8ac2c]::fn_ctxt::FnCtxt>::check_block_with_expected
  40:     0x7f10bbca18bc - <rustc_hir_typeck[ae1c700836d8ac2c]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  41:     0x7f10bbc3c2b1 - <rustc_hir_typeck[ae1c700836d8ac2c]::fn_ctxt::FnCtxt>::check_return_expr
  42:     0x7f10bbc331e2 - rustc_hir_typeck[ae1c700836d8ac2c]::check::check_fn
  43:     0x7f10bbc1ba9e - rustc_hir_typeck[ae1c700836d8ac2c]::typeck
  44:     0x7f10bbc0d077 - <rustc_query_system[290e1790c5c3341d]::dep_graph::graph::DepGraph<rustc_middle[cb60ee63c17a43c3]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[cb60ee63c17a43c3]::ty::context::TyCtxt, rustc_span[64b0522548f33ee1]::def_id::LocalDefId, &rustc_middle[cb60ee63c17a43c3]::ty::typeck_results::TypeckResults>
  45:     0x7f10bbc04bdb - rustc_query_system[290e1790c5c3341d]::query::plumbing::try_execute_query::<rustc_query_impl[b58743651d9ff834]::queries::typeck, rustc_query_impl[b58743651d9ff834]::plumbing::QueryCtxt>
  46:     0x7f10bd27734d - rustc_data_structures[31a149139c39594b]::sync::par_for_each_in::<&[rustc_span[64b0522548f33ee1]::def_id::LocalDefId], <rustc_middle[cb60ee63c17a43c3]::hir::map::Map>::par_body_owners<rustc_hir_typeck[ae1c700836d8ac2c]::typeck_item_bodies::{closure#0}>::{closure#0}>
  47:     0x7f10bd2770f3 - rustc_hir_typeck[ae1c700836d8ac2c]::typeck_item_bodies
  48:     0x7f10bd291187 - <rustc_query_system[290e1790c5c3341d]::dep_graph::graph::DepGraph<rustc_middle[cb60ee63c17a43c3]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[cb60ee63c17a43c3]::ty::context::TyCtxt, (), ()>
  49:     0x7f10bd0a0356 - rustc_query_system[290e1790c5c3341d]::query::plumbing::try_execute_query::<rustc_query_impl[b58743651d9ff834]::queries::typeck_item_bodies, rustc_query_impl[b58743651d9ff834]::plumbing::QueryCtxt>
  50:     0x7f10bd4d8e4b - <rustc_query_impl[b58743651d9ff834]::Queries as rustc_middle[cb60ee63c17a43c3]::ty::query::QueryEngine>::typeck_item_bodies
  51:     0x7f10bbfa9192 - <rustc_session[64f4b5251236b9c8]::session::Session>::time::<(), rustc_hir_analysis[f9b821eb24fbe472]::check_crate::{closure#7}>
  52:     0x7f10bbfa8602 - rustc_hir_analysis[f9b821eb24fbe472]::check_crate
  53:     0x7f10bbfa825b - rustc_interface[7daf05dd7f817685]::passes::analysis
  54:     0x7f10bd245ce6 - <rustc_query_system[290e1790c5c3341d]::dep_graph::graph::DepGraph<rustc_middle[cb60ee63c17a43c3]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[cb60ee63c17a43c3]::ty::context::TyCtxt, (), core[77bef6d69d927b7]::result::Result<(), rustc_errors[698eb27c3a994f58]::ErrorGuaranteed>>
  55:     0x7f10bd244ea1 - rustc_query_system[290e1790c5c3341d]::query::plumbing::try_execute_query::<rustc_query_impl[b58743651d9ff834]::queries::analysis, rustc_query_impl[b58743651d9ff834]::plumbing::QueryCtxt>
  56:     0x7f10bd4d56fa - <rustc_query_impl[b58743651d9ff834]::Queries as rustc_middle[cb60ee63c17a43c3]::ty::query::QueryEngine>::analysis
  57:     0x7f10bccfe960 - <rustc_interface[7daf05dd7f817685]::passes::QueryContext>::enter::<rustc_driver[e9760e9ac6ccf54d]::run_compiler::{closure#1}::{closure#2}::{closure#2}, core[77bef6d69d927b7]::result::Result<(), rustc_errors[698eb27c3a994f58]::ErrorGuaranteed>>
  58:     0x7f10bccfc3d4 - rustc_span[64b0522548f33ee1]::with_source_map::<core[77bef6d69d927b7]::result::Result<(), rustc_errors[698eb27c3a994f58]::ErrorGuaranteed>, rustc_interface[7daf05dd7f817685]::interface::run_compiler<core[77bef6d69d927b7]::result::Result<(), rustc_errors[698eb27c3a994f58]::ErrorGuaranteed>, rustc_driver[e9760e9ac6ccf54d]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  59:     0x7f10bccf4df4 - <scoped_tls[d9056ea81e40aa6e]::ScopedKey<rustc_span[64b0522548f33ee1]::SessionGlobals>>::set::<rustc_interface[7daf05dd7f817685]::interface::run_compiler<core[77bef6d69d927b7]::result::Result<(), rustc_errors[698eb27c3a994f58]::ErrorGuaranteed>, rustc_driver[e9760e9ac6ccf54d]::run_compiler::{closure#1}>::{closure#0}, core[77bef6d69d927b7]::result::Result<(), rustc_errors[698eb27c3a994f58]::ErrorGuaranteed>>
  60:     0x7f10bccf44f2 - std[be43af764720b20]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[7daf05dd7f817685]::util::run_in_thread_pool_with_globals<rustc_interface[7daf05dd7f817685]::interface::run_compiler<core[77bef6d69d927b7]::result::Result<(), rustc_errors[698eb27c3a994f58]::ErrorGuaranteed>, rustc_driver[e9760e9ac6ccf54d]::run_compiler::{closure#1}>::{closure#0}, core[77bef6d69d927b7]::result::Result<(), rustc_errors[698eb27c3a994f58]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[77bef6d69d927b7]::result::Result<(), rustc_errors[698eb27c3a994f58]::ErrorGuaranteed>>
  61:     0x7f10bccf429a - <<std[be43af764720b20]::thread::Builder>::spawn_unchecked_<rustc_interface[7daf05dd7f817685]::util::run_in_thread_pool_with_globals<rustc_interface[7daf05dd7f817685]::interface::run_compiler<core[77bef6d69d927b7]::result::Result<(), rustc_errors[698eb27c3a994f58]::ErrorGuaranteed>, rustc_driver[e9760e9ac6ccf54d]::run_compiler::{closure#1}>::{closure#0}, core[77bef6d69d927b7]::result::Result<(), rustc_errors[698eb27c3a994f58]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[77bef6d69d927b7]::result::Result<(), rustc_errors[698eb27c3a994f58]::ErrorGuaranteed>>::{closure#1} as core[77bef6d69d927b7]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  62:     0x7f10ba7d0823 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h697797cc46768ced
                               at /rustc/8460ca823e8367a30dda430efda790588b8c84d3/library/alloc/src/boxed.rs:1988:9
  63:     0x7f10ba7d0823 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hbf3642b6d75543dc
                               at /rustc/8460ca823e8367a30dda430efda790588b8c84d3/library/alloc/src/boxed.rs:1988:9
  64:     0x7f10ba7d0823 - std::sys::unix::thread::Thread::new::thread_start::ha35bd9f58a7022de
                               at /rustc/8460ca823e8367a30dda430efda790588b8c84d3/library/std/src/sys/unix/thread.rs:108:17
  65:     0x7f10ba510b43 - start_thread
                               at ./nptl/./nptl/pthread_create.c:442:8
  66:     0x7f10ba5a2a00 - clone3
                               at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
  67:                0x0 - <unknown>

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.68.1 (8460ca823 2023-03-20) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type bin -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 `main`
#1 [typeck_item_bodies] type-checking all item bodies
#2 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `test-ra`
Backtrace

    Checking test-ra v0.1.0 (/home/desmond-lin-7/rust/test-ra)
error: internal compiler error: compiler/rustc_infer/src/infer/region_constraints/mod.rs:568:17: cannot relate bound region: ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:20 ~ test_ra[0afa]::main::'_), '_) }) <= ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed(DefId(0:19 ~ test_ra[0afa]::{impl#0}::'_#1), '_) })

thread 'rustc' panicked at 'Box<dyn Any>', /rustc/8460ca823e8367a30dda430efda790588b8c84d3/compiler/rustc_errors/src/lib.rs:987:33
stack backtrace:
   0: std::panicking::begin_panic::<rustc_errors::ExplicitBug>
   1: std::panic::panic_any::<rustc_errors::ExplicitBug>
   2: <rustc_errors::HandlerInner>::span_bug::<rustc_span::span_encoding::Span, &alloc::string::String>
   3: <rustc_errors::Handler>::span_bug::<rustc_span::span_encoding::Span, &alloc::string::String>
   4: rustc_middle::util::bug::opt_span_bug_fmt::<rustc_span::span_encoding::Span>::{closure#0}
   5: rustc_middle::ty::context::tls::with_opt::<rustc_middle::util::bug::opt_span_bug_fmt<rustc_span::span_encoding::Span>::{closure#0}, !>::{closure#0}
   6: rustc_middle::ty::context::tls::with_context_opt::<rustc_middle::ty::context::tls::with_opt<rustc_middle::util::bug::opt_span_bug_fmt<rustc_span::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
   7: rustc_middle::util::bug::opt_span_bug_fmt::<rustc_span::span_encoding::Span>
   8: rustc_middle::util::bug::span_bug_fmt::<rustc_span::span_encoding::Span>
   9: <rustc_middle::ty::sty::Region as rustc_middle::ty::relate::Relate>::relate::<rustc_infer::infer::equate::Equate>
  10: rustc_middle::ty::relate::super_relate_tys::<rustc_infer::infer::equate::Equate>
  11: <rustc_infer::infer::equate::Equate as rustc_middle::ty::relate::TypeRelation>::tys
  12: <rustc_infer::infer::InferCtxt>::commit_if_ok::<rustc_infer::infer::InferOk<()>, rustc_middle::ty::error::TypeError, <rustc_infer::infer::at::Trace>::eq<rustc_middle::ty::Ty>::{closure#0}>
  13: <rustc_infer::infer::at::At>::eq::<rustc_middle::ty::Ty>
  14: <rustc_infer::infer::InferCtxt>::can_eq::<rustc_middle::ty::Ty>
  15: rustc_trait_selection::traits::error_reporting::suggestions::hint_missing_borrow
  16: <rustc_infer::infer::error_reporting::TypeErrCtxt as rustc_trait_selection::traits::error_reporting::suggestions::TypeErrCtxtExt>::report_closure_arg_mismatch
  17: <rustc_infer::infer::error_reporting::TypeErrCtxt as rustc_trait_selection::traits::error_reporting::TypeErrCtxtExt>::report_selection_error
  18: <rustc_infer::infer::error_reporting::TypeErrCtxt as rustc_trait_selection::traits::error_reporting::InferCtxtPrivExt>::report_fulfillment_error
  19: <rustc_infer::infer::error_reporting::TypeErrCtxt as rustc_trait_selection::traits::error_reporting::TypeErrCtxtExt>::report_fulfillment_errors
  20: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_argument_types
  21: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_call
  22: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  23: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_decl
  24: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_block_with_expected
  25: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  26: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_return_expr
  27: rustc_hir_typeck::check::check_fn
  28: rustc_hir_typeck::typeck
  29: <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::typeck_results::TypeckResults>
  30: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::typeck, rustc_query_impl::plumbing::QueryCtxt>
  31: rustc_data_structures::sync::par_for_each_in::<&[rustc_span::def_id::LocalDefId], <rustc_middle::hir::map::Map>::par_body_owners<rustc_hir_typeck::typeck_item_bodies::{closure#0}>::{closure#0}>
  32: rustc_hir_typeck::typeck_item_bodies
  33: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle::ty::context::TyCtxt, (), ()>
  34: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::typeck_item_bodies, rustc_query_impl::plumbing::QueryCtxt>
  35: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::typeck_item_bodies
  36: <rustc_session::session::Session>::time::<(), rustc_hir_analysis::check_crate::{closure#7}>
  37: rustc_hir_analysis::check_crate
  38: rustc_interface::passes::analysis
  39: <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>>
  40: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::analysis, rustc_query_impl::plumbing::QueryCtxt>
  41: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis
  42: <rustc_interface::passes::QueryContext>::enter::<rustc_driver::run_compiler::{closure#1}::{closure#2}::{closure#2}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>
  43: rustc_span::with_source_map::<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_interface::interface::run_compiler<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  44: <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>>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

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.68.1 (8460ca823 2023-03-20) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type bin -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 `main`
#1 [typeck_item_bodies] type-checking all item bodies
#2 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `test-ra`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions