Closed
Description
Code
// Reduced from: https://github.com/SeaQL/sea-orm/blob/1a8d22d918e3d8ca461caf54839259ed9b72de3e/src/executor/select.rs#L272-L281
pub trait Foo {}
impl Foo for () {}
pub async fn bar<'a: 'b, 'b>() -> impl Foo + 'b {
todo!()
}
Meta
rustc --version --verbose
:
rustc 1.64.0-beta.1 (56714e533 2022-08-09)
binary: rustc
commit-hash: 56714e5332f5f21c39d710cc4a6dd279132dedd6
commit-date: 2022-08-09
host: aarch64-apple-darwin
release: 1.64.0-beta.1
LLVM version: 14.0.6
Error output
(omitted backtrace as the full backtrace is below)
error: internal compiler error: compiler/rustc_middle/src/ty/subst.rs:554:13: Region parameter out of range when substituting in region 'b (index=3)
thread 'rustc' panicked at 'Box<dyn Any>', /rustc/56714e5332f5f21c39d710cc4a6dd279132dedd6/compiler/rustc_errors/src/lib.rs:1392:9
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.64.0-beta.1 (56714e533 2022-08-09) running on aarch64-apple-darwin
note: compiler flags: --crate-type lib -C opt-level=3 -C embed-bitcode=no
note: some of the compiler flags provided by cargo are hidden
query stack during panic:
#0 [typeck] type-checking `bar`
#1 [mir_built] building MIR for `bar`
#2 [unsafety_check_result] unsafety-checking `bar`
#3 [mir_const] processing MIR for `bar`
#4 [mir_promoted] processing `bar`
#5 [mir_borrowck] borrow-checking `bar`
#6 [type_of] computing type of `bar::{opaque#0}`
#7 [check_mod_item_types] checking item types in top-level module
#8 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `etcaton`
Backtrace
error: internal compiler error: compiler/rustc_middle/src/ty/subst.rs:554:13: Region parameter out of range when substituting in region 'b (index=3)
thread 'rustc' panicked at 'Box<dyn Any>', /rustc/56714e5332f5f21c39d710cc4a6dd279132dedd6/compiler/rustc_errors/src/lib.rs:1392:9
stack backtrace:
0: 0x100e72f24 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h9e253e8bfd0bd445
1: 0x100ec01ec - core::fmt::write::h170b384e36e58da9
2: 0x100e65df0 - std::io::Write::write_fmt::he5685bc095ff9c33
3: 0x100e75a34 - std::panicking::default_hook::{{closure}}::h36bb536bc8ecb089
4: 0x100e75754 - std::panicking::default_hook::h9fa506012ac971b8
5: 0x1086f2a9c - rustc_driver[18596eb462993f47]::DEFAULT_HOOK::{closure#0}::{closure#0}
6: 0x100e760f8 - std::panicking::rust_panic_with_hook::h7ef5e8552af363cf
7: 0x10c3b2cf8 - std[f978d67385de1fbe]::panicking::begin_panic::<rustc_errors[bcf41bbe0b2c89d4]::ExplicitBug>::{closure#0}
8: 0x10c3b14b0 - std[f978d67385de1fbe]::sys_common::backtrace::__rust_end_short_backtrace::<std[f978d67385de1fbe]::panicking::begin_panic<rustc_errors[bcf41bbe0b2c89d4]::ExplicitBug>::{closure#0}, !>
9: 0x10c8a57a4 - std[f978d67385de1fbe]::panicking::begin_panic::<rustc_errors[bcf41bbe0b2c89d4]::ExplicitBug>
10: 0x10c406908 - std[f978d67385de1fbe]::panic::panic_any::<rustc_errors[bcf41bbe0b2c89d4]::ExplicitBug>
11: 0x10c403fe4 - <rustc_errors[bcf41bbe0b2c89d4]::HandlerInner>::bug::<&alloc[23bd3d266e9910b9]::string::String>
12: 0x10c403bb0 - <rustc_errors[bcf41bbe0b2c89d4]::Handler>::bug::<&alloc[23bd3d266e9910b9]::string::String>
13: 0x10c43e9c8 - rustc_middle[ae8652d5e274b38e]::ty::context::tls::with_context_opt::<rustc_middle[ae8652d5e274b38e]::ty::context::tls::with_opt<rustc_middle[ae8652d5e274b38e]::util::bug::opt_span_bug_fmt<rustc_span[ac37a41155aa3224]::span_encoding::Span>::{closure#0}, ()>::{closure#0}, ()>
14: 0x10c43f8e4 - rustc_middle[ae8652d5e274b38e]::util::bug::opt_span_bug_fmt::<rustc_span[ac37a41155aa3224]::span_encoding::Span>
15: 0x10c8aa1a0 - rustc_middle[ae8652d5e274b38e]::util::bug::bug_fmt
16: 0x10c8aa574 - <rustc_middle[ae8652d5e274b38e]::ty::subst::SubstFolder as rustc_middle[ae8652d5e274b38e]::ty::fold::TypeFolder>::fold_region::region_param_out_of_range
17: 0x10c46fde4 - <rustc_middle[ae8652d5e274b38e]::ty::subst::SubstFolder as rustc_middle[ae8652d5e274b38e]::ty::fold::TypeFolder>::fold_region
18: 0x10c2416bc - <rustc_middle[ae8652d5e274b38e]::ty::PredicateKind as rustc_middle[ae8652d5e274b38e]::ty::fold::TypeFoldable>::try_fold_with::<rustc_middle[ae8652d5e274b38e]::ty::subst::SubstFolder>
19: 0x10c2a1204 - <rustc_middle[ae8652d5e274b38e]::ty::subst::SubstFolder as rustc_middle[ae8652d5e274b38e]::ty::fold::FallibleTypeFolder>::try_fold_binder::<rustc_middle[ae8652d5e274b38e]::ty::PredicateKind>
20: 0x10c21a928 - <rustc_infer[16aeeeb96dac5022]::infer::InferCtxt>::register_hidden_type
21: 0x10c21011c - <rustc_infer[16aeeeb96dac5022]::infer::InferCtxt>::handle_opaque_type::{closure#0}
22: 0x10c20fba0 - <rustc_infer[16aeeeb96dac5022]::infer::InferCtxt>::handle_opaque_type
23: 0x10c27afa8 - <rustc_middle[ae8652d5e274b38e]::ty::fold::BottomUpFolder<<rustc_infer[16aeeeb96dac5022]::infer::InferCtxt>::replace_opaque_types_with_inference_vars::{closure#3}, <rustc_infer[16aeeeb96dac5022]::infer::InferCtxt>::replace_opaque_types_with_inference_vars::{closure#1}, <rustc_infer[16aeeeb96dac5022]::infer::InferCtxt>::replace_opaque_types_with_inference_vars::{closure#2}> as rustc_middle[ae8652d5e274b38e]::ty::fold::FallibleTypeFolder>::try_fold_ty
24: 0x10c20fb04 - <rustc_infer[16aeeeb96dac5022]::infer::InferCtxt>::replace_opaque_types_with_inference_vars
25: 0x10abcfa68 - <rustc_typeck[76df9d047b9e63d0]::check::fn_ctxt::FnCtxt>::supplied_sig_of_closure
26: 0x10abcdb3c - <rustc_typeck[76df9d047b9e63d0]::check::fn_ctxt::FnCtxt>::check_expr_closure
27: 0x10abd0818 - <rustc_typeck[76df9d047b9e63d0]::check::fn_ctxt::FnCtxt>::check_expr_kind
28: 0x10ab95804 - <rustc_typeck[76df9d047b9e63d0]::check::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
29: 0x10ab9fcfc - <rustc_typeck[76df9d047b9e63d0]::check::fn_ctxt::FnCtxt>::check_argument_types
30: 0x10ab894cc - <rustc_typeck[76df9d047b9e63d0]::check::fn_ctxt::FnCtxt>::confirm_builtin_call
31: 0x10ab8756c - <rustc_typeck[76df9d047b9e63d0]::check::fn_ctxt::FnCtxt>::check_call
32: 0x10abd0e40 - <rustc_typeck[76df9d047b9e63d0]::check::fn_ctxt::FnCtxt>::check_expr_kind
33: 0x10ab95804 - <rustc_typeck[76df9d047b9e63d0]::check::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
34: 0x10ab96514 - <rustc_typeck[76df9d047b9e63d0]::check::fn_ctxt::FnCtxt>::check_return_expr
35: 0x10acfd9fc - rustc_typeck[76df9d047b9e63d0]::check::check::check_fn
36: 0x10ad42848 - <rustc_infer[16aeeeb96dac5022]::infer::InferCtxtBuilder>::enter::<&rustc_middle[ae8652d5e274b38e]::ty::context::TypeckResults, <rustc_typeck[76df9d047b9e63d0]::check::inherited::InheritedBuilder>::enter<rustc_typeck[76df9d047b9e63d0]::check::typeck_with_fallback<rustc_typeck[76df9d047b9e63d0]::check::typeck::{closure#0}>::{closure#1}, &rustc_middle[ae8652d5e274b38e]::ty::context::TypeckResults>::{closure#0}>
37: 0x10ac47e80 - rustc_typeck[76df9d047b9e63d0]::check::typeck
38: 0x10b5f02cc - rustc_query_system[fb9d59d1cbbc6b4]::query::plumbing::try_execute_query::<rustc_query_impl[4bd6f15526759191]::plumbing::QueryCtxt, rustc_query_system[fb9d59d1cbbc6b4]::query::caches::DefaultCache<rustc_span[ac37a41155aa3224]::def_id::LocalDefId, &rustc_middle[ae8652d5e274b38e]::ty::context::TypeckResults>>
39: 0x10b6bf568 - rustc_query_system[fb9d59d1cbbc6b4]::query::plumbing::get_query::<rustc_query_impl[4bd6f15526759191]::queries::typeck, rustc_query_impl[4bd6f15526759191]::plumbing::QueryCtxt>
40: 0x10c3e991c - <rustc_middle[ae8652d5e274b38e]::ty::context::TyCtxt>::typeck_opt_const_arg
41: 0x10b046450 - rustc_mir_build[83a7e14575f0c7e1]::build::mir_built
42: 0x10b5e09dc - rustc_query_system[fb9d59d1cbbc6b4]::query::plumbing::try_execute_query::<rustc_query_impl[4bd6f15526759191]::plumbing::QueryCtxt, rustc_query_system[fb9d59d1cbbc6b4]::query::caches::DefaultCache<rustc_middle[ae8652d5e274b38e]::ty::WithOptConstParam<rustc_span[ac37a41155aa3224]::def_id::LocalDefId>, &rustc_data_structures[172e5cadde0c8e5d]::steal::Steal<rustc_middle[ae8652d5e274b38e]::mir::Body>>>
43: 0x10b6c192c - rustc_query_system[fb9d59d1cbbc6b4]::query::plumbing::get_query::<rustc_query_impl[4bd6f15526759191]::queries::mir_built, rustc_query_impl[4bd6f15526759191]::plumbing::QueryCtxt>
44: 0x10b93bd48 - <rustc_query_impl[4bd6f15526759191]::Queries as rustc_middle[ae8652d5e274b38e]::ty::query::QueryEngine>::mir_built
45: 0x10a9af9f4 - rustc_mir_transform[3f937cc5270e075a]::check_unsafety::unsafety_check_result
46: 0x10a9ac90c - <rustc_mir_transform[3f937cc5270e075a]::check_unsafety::provide::{closure#0} as core[55bf22af6429b8f1]::ops::function::FnOnce<(rustc_middle[ae8652d5e274b38e]::ty::context::TyCtxt, rustc_span[ac37a41155aa3224]::def_id::LocalDefId)>>::call_once
47: 0x10b5f1cfc - rustc_query_system[fb9d59d1cbbc6b4]::query::plumbing::try_execute_query::<rustc_query_impl[4bd6f15526759191]::plumbing::QueryCtxt, rustc_query_system[fb9d59d1cbbc6b4]::query::caches::DefaultCache<rustc_span[ac37a41155aa3224]::def_id::LocalDefId, &rustc_middle[ae8652d5e274b38e]::mir::query::UnsafetyCheckResult>>
48: 0x10b69ace0 - rustc_query_system[fb9d59d1cbbc6b4]::query::plumbing::get_query::<rustc_query_impl[4bd6f15526759191]::queries::unsafety_check_result, rustc_query_impl[4bd6f15526759191]::plumbing::QueryCtxt>
49: 0x10a962940 - rustc_mir_transform[3f937cc5270e075a]::mir_const
50: 0x10b5e09dc - rustc_query_system[fb9d59d1cbbc6b4]::query::plumbing::try_execute_query::<rustc_query_impl[4bd6f15526759191]::plumbing::QueryCtxt, rustc_query_system[fb9d59d1cbbc6b4]::query::caches::DefaultCache<rustc_middle[ae8652d5e274b38e]::ty::WithOptConstParam<rustc_span[ac37a41155aa3224]::def_id::LocalDefId>, &rustc_data_structures[172e5cadde0c8e5d]::steal::Steal<rustc_middle[ae8652d5e274b38e]::mir::Body>>>
51: 0x10b6c1a94 - rustc_query_system[fb9d59d1cbbc6b4]::query::plumbing::get_query::<rustc_query_impl[4bd6f15526759191]::queries::mir_const, rustc_query_impl[4bd6f15526759191]::plumbing::QueryCtxt>
52: 0x10b93bd84 - <rustc_query_impl[4bd6f15526759191]::Queries as rustc_middle[ae8652d5e274b38e]::ty::query::QueryEngine>::mir_const
53: 0x10a96347c - rustc_mir_transform[3f937cc5270e075a]::mir_promoted
54: 0x10b67c374 - rustc_query_system[fb9d59d1cbbc6b4]::query::plumbing::get_query::<rustc_query_impl[4bd6f15526759191]::queries::mir_promoted, rustc_query_impl[4bd6f15526759191]::plumbing::QueryCtxt>
55: 0x10b93bedc - <rustc_query_impl[4bd6f15526759191]::Queries as rustc_middle[ae8652d5e274b38e]::ty::query::QueryEngine>::mir_promoted
56: 0x10b25d630 - rustc_borrowck[abc1349eb59c77c9]::mir_borrowck
57: 0x10b23fbb4 - <rustc_borrowck[abc1349eb59c77c9]::provide::{closure#0} as core[55bf22af6429b8f1]::ops::function::FnOnce<(rustc_middle[ae8652d5e274b38e]::ty::context::TyCtxt, rustc_span[ac37a41155aa3224]::def_id::LocalDefId)>>::call_once
58: 0x10b5f0fe4 - rustc_query_system[fb9d59d1cbbc6b4]::query::plumbing::try_execute_query::<rustc_query_impl[4bd6f15526759191]::plumbing::QueryCtxt, rustc_query_system[fb9d59d1cbbc6b4]::query::caches::DefaultCache<rustc_span[ac37a41155aa3224]::def_id::LocalDefId, &rustc_middle[ae8652d5e274b38e]::mir::query::BorrowCheckResult>>
59: 0x10b67bc80 - rustc_query_system[fb9d59d1cbbc6b4]::query::plumbing::get_query::<rustc_query_impl[4bd6f15526759191]::queries::mir_borrowck, rustc_query_impl[4bd6f15526759191]::plumbing::QueryCtxt>
60: 0x10ac8c630 - rustc_typeck[76df9d047b9e63d0]::collect::type_of::find_opaque_ty_constraints_for_rpit
61: 0x10ac8b668 - rustc_typeck[76df9d047b9e63d0]::collect::type_of::type_of
62: 0x10b60884c - rustc_query_system[fb9d59d1cbbc6b4]::query::plumbing::try_execute_query::<rustc_query_impl[4bd6f15526759191]::plumbing::QueryCtxt, rustc_query_system[fb9d59d1cbbc6b4]::query::caches::DefaultCache<rustc_span[ac37a41155aa3224]::def_id::DefId, rustc_middle[ae8652d5e274b38e]::ty::Ty>>
63: 0x10b6bf884 - rustc_query_system[fb9d59d1cbbc6b4]::query::plumbing::get_query::<rustc_query_impl[4bd6f15526759191]::queries::type_of, rustc_query_impl[4bd6f15526759191]::plumbing::QueryCtxt>
64: 0x10ace3cd4 - rustc_typeck[76df9d047b9e63d0]::check::check::check_opaque
65: 0x10ace4e84 - rustc_typeck[76df9d047b9e63d0]::check::check::check_item_type
66: 0x10aceb928 - rustc_typeck[76df9d047b9e63d0]::check::check::check_mod_item_types
67: 0x10b5f36f0 - rustc_query_system[fb9d59d1cbbc6b4]::query::plumbing::try_execute_query::<rustc_query_impl[4bd6f15526759191]::plumbing::QueryCtxt, rustc_query_system[fb9d59d1cbbc6b4]::query::caches::DefaultCache<rustc_span[ac37a41155aa3224]::def_id::LocalDefId, ()>>
68: 0x10b694fc8 - rustc_query_system[fb9d59d1cbbc6b4]::query::plumbing::get_query::<rustc_query_impl[4bd6f15526759191]::queries::check_mod_item_types, rustc_query_impl[4bd6f15526759191]::plumbing::QueryCtxt>
69: 0x10ad0125c - <rustc_middle[ae8652d5e274b38e]::hir::map::Map>::for_each_module::<rustc_typeck[76df9d047b9e63d0]::check_crate::{closure#6}::{closure#0}>
70: 0x10ac77a8c - <rustc_session[8f52ed710a0a8230]::session::Session>::time::<(), rustc_typeck[76df9d047b9e63d0]::check_crate::{closure#6}>
71: 0x10ad8ed9c - rustc_typeck[76df9d047b9e63d0]::check_crate
72: 0x10879b508 - rustc_interface[af5f3681247a90d7]::passes::analysis
73: 0x10b628920 - rustc_query_system[fb9d59d1cbbc6b4]::query::plumbing::try_execute_query::<rustc_query_impl[4bd6f15526759191]::plumbing::QueryCtxt, rustc_query_system[fb9d59d1cbbc6b4]::query::caches::DefaultCache<(), core[55bf22af6429b8f1]::result::Result<(), rustc_errors[bcf41bbe0b2c89d4]::ErrorGuaranteed>>>
74: 0x10b6bf9cc - rustc_query_system[fb9d59d1cbbc6b4]::query::plumbing::get_query::<rustc_query_impl[4bd6f15526759191]::queries::analysis, rustc_query_impl[4bd6f15526759191]::plumbing::QueryCtxt>
75: 0x1086a51ec - <rustc_interface[af5f3681247a90d7]::passes::QueryContext>::enter::<rustc_driver[18596eb462993f47]::run_compiler::{closure#1}::{closure#2}::{closure#3}, core[55bf22af6429b8f1]::result::Result<(), rustc_errors[bcf41bbe0b2c89d4]::ErrorGuaranteed>>
76: 0x108677388 - <rustc_interface[af5f3681247a90d7]::interface::Compiler>::enter::<rustc_driver[18596eb462993f47]::run_compiler::{closure#1}::{closure#2}, core[55bf22af6429b8f1]::result::Result<core[55bf22af6429b8f1]::option::Option<rustc_interface[af5f3681247a90d7]::queries::Linker>, rustc_errors[bcf41bbe0b2c89d4]::ErrorGuaranteed>>
77: 0x10866db5c - rustc_span[ac37a41155aa3224]::with_source_map::<core[55bf22af6429b8f1]::result::Result<(), rustc_errors[bcf41bbe0b2c89d4]::ErrorGuaranteed>, rustc_interface[af5f3681247a90d7]::interface::create_compiler_and_run<core[55bf22af6429b8f1]::result::Result<(), rustc_errors[bcf41bbe0b2c89d4]::ErrorGuaranteed>, rustc_driver[18596eb462993f47]::run_compiler::{closure#1}>::{closure#1}>
78: 0x108694948 - rustc_interface[af5f3681247a90d7]::interface::create_compiler_and_run::<core[55bf22af6429b8f1]::result::Result<(), rustc_errors[bcf41bbe0b2c89d4]::ErrorGuaranteed>, rustc_driver[18596eb462993f47]::run_compiler::{closure#1}>
79: 0x1086df7d4 - <scoped_tls[fb85e7293028960e]::ScopedKey<rustc_span[ac37a41155aa3224]::SessionGlobals>>::set::<rustc_interface[af5f3681247a90d7]::interface::run_compiler<core[55bf22af6429b8f1]::result::Result<(), rustc_errors[bcf41bbe0b2c89d4]::ErrorGuaranteed>, rustc_driver[18596eb462993f47]::run_compiler::{closure#1}>::{closure#0}, core[55bf22af6429b8f1]::result::Result<(), rustc_errors[bcf41bbe0b2c89d4]::ErrorGuaranteed>>
80: 0x10867390c - std[f978d67385de1fbe]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[af5f3681247a90d7]::util::run_in_thread_pool_with_globals<rustc_interface[af5f3681247a90d7]::interface::run_compiler<core[55bf22af6429b8f1]::result::Result<(), rustc_errors[bcf41bbe0b2c89d4]::ErrorGuaranteed>, rustc_driver[18596eb462993f47]::run_compiler::{closure#1}>::{closure#0}, core[55bf22af6429b8f1]::result::Result<(), rustc_errors[bcf41bbe0b2c89d4]::ErrorGuaranteed>>::{closure#0}, core[55bf22af6429b8f1]::result::Result<(), rustc_errors[bcf41bbe0b2c89d4]::ErrorGuaranteed>>
81: 0x108695218 - <<std[f978d67385de1fbe]::thread::Builder>::spawn_unchecked_<rustc_interface[af5f3681247a90d7]::util::run_in_thread_pool_with_globals<rustc_interface[af5f3681247a90d7]::interface::run_compiler<core[55bf22af6429b8f1]::result::Result<(), rustc_errors[bcf41bbe0b2c89d4]::ErrorGuaranteed>, rustc_driver[18596eb462993f47]::run_compiler::{closure#1}>::{closure#0}, core[55bf22af6429b8f1]::result::Result<(), rustc_errors[bcf41bbe0b2c89d4]::ErrorGuaranteed>>::{closure#0}, core[55bf22af6429b8f1]::result::Result<(), rustc_errors[bcf41bbe0b2c89d4]::ErrorGuaranteed>>::{closure#1} as core[55bf22af6429b8f1]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
82: 0x100e7e7a8 - std::sys::unix::thread::Thread::new::thread_start::h7b984fe6b5676017
83: 0x194fe426c - __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.64.0-beta.1 (56714e533 2022-08-09) running on aarch64-apple-darwin
note: compiler flags: --crate-type lib -C opt-level=3 -C embed-bitcode=no
note: some of the compiler flags provided by cargo are hidden
query stack during panic:
#0 [typeck] type-checking `bar`
#1 [mir_built] building MIR for `bar`
#2 [unsafety_check_result] unsafety-checking `bar`
#3 [mir_const] processing MIR for `bar`
#4 [mir_promoted] processing `bar`
#5 [mir_borrowck] borrow-checking `bar`
#6 [type_of] computing type of `bar::{opaque#0}`
#7 [check_mod_item_types] checking item types in top-level module
#8 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `etcaton`