rust-lang / rustc_codegen_cranelift

Cranelift based backend for rustc
Apache License 2.0
1.62k stars 101 forks source link

ICE: Region parameter out of range when substituting in region 'b (index=5) #1263

Closed Jupp56 closed 2 years ago

Jupp56 commented 2 years ago

When I try to compile the sea-orm crate (alone or as a dependency), it fails because of an ICE. It does not fail on stable or nightly using regular cargo/rustc - which is why I am asking that here instead of in the rustc repo.

The error persists on two different machines, an Intel Macbook Air from 2011 (OS: Windows + WSL, cranelift runs in wsl) and a 1st generation AMD Threadripper equipped machine (Linux Mint VM on Proxmox).

The build command's output:

savb@savb-DVM2:~/Projects/sea-orm$ ../rustc_codegen_cranelift/build/cargo-clif build
   Compiling proc-macro2 v1.0.43
   Compiling unicode-ident v1.0.3
   Compiling quote v1.0.21
   Compiling syn v1.0.99
   Compiling autocfg v1.1.0
   Compiling version_check v0.9.4
   Compiling libc v0.2.131
   Compiling serde_derive v1.0.143
   Compiling unicode-segmentation v1.9.0
   Compiling futures-core v0.3.21
   Compiling serde v1.0.143
   Compiling futures-task v0.3.21
   Compiling memchr v2.5.0
   Compiling futures-channel v0.3.21
   Compiling cfg-if v1.0.0
   Compiling rustversion v1.0.9
   Compiling futures-sink v0.3.21
   Compiling futures-util v0.3.21
   Compiling pin-project-lite v0.2.9
   Compiling tinyvec_macros v0.1.0
   Compiling matches v0.1.9
   Compiling log v0.4.17
   Compiling itoa v1.0.3
   Compiling futures-io v0.3.21
   Compiling serde_json v1.0.83
   Compiling pin-utils v0.1.0
   Compiling rust_decimal v1.26.1
   Compiling async-trait v0.1.57
   Compiling once_cell v1.13.0
   Compiling Inflector v0.11.4
   Compiling percent-encoding v2.1.0
   Compiling ryu v1.0.11
   Compiling num_threads v0.1.6
   Compiling arrayvec v0.7.2
   Compiling iana-time-zone v0.1.44
   Compiling unicode-bidi v0.3.8
   Compiling time-macros v0.2.4
   Compiling aliasable v0.1.3
   Compiling tinyvec v1.6.0
   Compiling proc-macro-error-attr v1.0.4
   Compiling proc-macro-error v1.0.4
   Compiling num-traits v0.2.15
   Compiling slab v0.4.7
   Compiling num-integer v0.1.45
   Compiling heck v0.3.3
   Compiling form_urlencoded v1.0.1
   Compiling tracing-core v0.1.29
   Compiling time v0.1.44
   Compiling getrandom v0.2.7
   Compiling unicode-normalization v0.1.21
   Compiling idna v0.2.3
   Compiling time v0.3.13
   Compiling url v2.2.2
   Compiling thiserror-impl v1.0.32
   Compiling futures-macro v0.3.21
   Compiling sea-strum_macros v0.23.0
   Compiling async-stream-impl v0.3.3
   Compiling ouroboros_macro v0.15.2
   Compiling tracing-attributes v0.1.22
   Compiling bae v0.1.7
   Compiling async-stream v0.3.3
   Compiling sea-orm-macros v0.9.1 (/home/savb/Projects/sea-orm/sea-orm-macros)
   Compiling thiserror v1.0.32
   Compiling sea-query-derive v0.2.0
   Compiling tracing v0.1.36
   Compiling sea-strum v0.23.0
   Compiling ouroboros v0.15.2
   Compiling futures-executor v0.3.21
   Compiling futures v0.3.21
   Compiling uuid v1.1.2
   Compiling chrono v0.4.21
   Compiling sea-query v0.26.2
   Compiling sea-orm v0.9.1 (/home/savb/Projects/sea-orm)
error: internal compiler error: compiler/rustc_middle/src/ty/subst.rs:554:13: Region parameter out of range when substituting in region 'b (index=5)

thread 'rustc' panicked at 'Box<dyn Any>', /rustc/d394408fb38c4de61f765a3ed5189d2731a1da91/compiler/rustc_errors/src/lib.rs:1392:9
stack backtrace:
   0:     0x7fb289558c60 - std::backtrace_rs::backtrace::libunwind::trace::h60bf900414c5dcf2
                               at /rustc/d394408fb38c4de61f765a3ed5189d2731a1da91/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   1:     0x7fb289558c60 - std::backtrace_rs::backtrace::trace_unsynchronized::habfc3ef92583c158
                               at /rustc/d394408fb38c4de61f765a3ed5189d2731a1da91/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7fb289558c60 - std::sys_common::backtrace::_print_fmt::hae196fe4153d0b63
                               at /rustc/d394408fb38c4de61f765a3ed5189d2731a1da91/library/std/src/sys_common/backtrace.rs:66:5
   3:     0x7fb289558c60 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h08f9c50f850514f5
                               at /rustc/d394408fb38c4de61f765a3ed5189d2731a1da91/library/std/src/sys_common/backtrace.rs:45:22
   4:     0x7fb2895b462c - core::fmt::write::hcd15d2c673b5a9c1
                               at /rustc/d394408fb38c4de61f765a3ed5189d2731a1da91/library/core/src/fmt/mod.rs:1198:17
   5:     0x7fb289549ca5 - std::io::Write::write_fmt::h417be4d25b915a22
                               at /rustc/d394408fb38c4de61f765a3ed5189d2731a1da91/library/std/src/io/mod.rs:1672:15
   6:     0x7fb28955b941 - std::sys_common::backtrace::_print::h95ab226f37d571aa
                               at /rustc/d394408fb38c4de61f765a3ed5189d2731a1da91/library/std/src/sys_common/backtrace.rs:48:5
   7:     0x7fb28955b941 - std::sys_common::backtrace::print::hc77fb9ed6b2eeb3d
                               at /rustc/d394408fb38c4de61f765a3ed5189d2731a1da91/library/std/src/sys_common/backtrace.rs:35:9
   8:     0x7fb28955b941 - std::panicking::default_hook::{{closure}}::hca418bd67097eb22
                               at /rustc/d394408fb38c4de61f765a3ed5189d2731a1da91/library/std/src/panicking.rs:295:22
   9:     0x7fb28955b60e - std::panicking::default_hook::h1df4f10c6ed28c53
                               at /rustc/d394408fb38c4de61f765a3ed5189d2731a1da91/library/std/src/panicking.rs:314:9
  10:     0x7fb28bddc7a4 - rustc_driver[6a784e82872844b3]::DEFAULT_HOOK::{closure#0}::{closure#0}
  11:     0x7fb28955c176 - std::panicking::rust_panic_with_hook::hf1e7a1cb721a9823
                               at /rustc/d394408fb38c4de61f765a3ed5189d2731a1da91/library/std/src/panicking.rs:702:17
  12:     0x7fb28cd7aea1 - std[c5ae6ddbbc7a9ee8]::panicking::begin_panic::<rustc_errors[a2987978d4b02d94]::ExplicitBug>::{closure#0}
  13:     0x7fb28cd7a826 - std[c5ae6ddbbc7a9ee8]::sys_common::backtrace::__rust_end_short_backtrace::<std[c5ae6ddbbc7a9ee8]::panicking::begin_panic<rustc_errors[a2987978d4b02d94]::ExplicitBug>::{closure#0}, !>
  14:     0x7fb28cd5cec6 - std[c5ae6ddbbc7a9ee8]::panicking::begin_panic::<rustc_errors[a2987978d4b02d94]::ExplicitBug>
  15:     0x7fb28cda0b86 - std[c5ae6ddbbc7a9ee8]::panic::panic_any::<rustc_errors[a2987978d4b02d94]::ExplicitBug>
  16:     0x7fb28cda0245 - <rustc_errors[a2987978d4b02d94]::HandlerInner>::bug::<&alloc[37570755f066325e]::string::String>
  17:     0x7fb28cd9ffa0 - <rustc_errors[a2987978d4b02d94]::Handler>::bug::<&alloc[37570755f066325e]::string::String>
  18:     0x7fb28cdc521d - rustc_middle[75c4c128b8233a9c]::ty::context::tls::with_context_opt::<rustc_middle[75c4c128b8233a9c]::ty::context::tls::with_opt<rustc_middle[75c4c128b8233a9c]::util::bug::opt_span_bug_fmt<rustc_span[50cf38d84baf6853]::span_encoding::Span>::{closure#0}, ()>::{closure#0}, ()>
  19:     0x7fb28cdc82d6 - rustc_middle[75c4c128b8233a9c]::util::bug::opt_span_bug_fmt::<rustc_span[50cf38d84baf6853]::span_encoding::Span>
  20:     0x7fb28a82c973 - rustc_middle[75c4c128b8233a9c]::util::bug::bug_fmt
  21:     0x7fb28cdeed36 - <rustc_middle[75c4c128b8233a9c]::ty::subst::SubstFolder as rustc_middle[75c4c128b8233a9c]::ty::fold::TypeFolder>::fold_region::region_param_out_of_range
  22:     0x7fb28a7ed8e3 - <rustc_middle[75c4c128b8233a9c]::ty::subst::SubstFolder as rustc_middle[75c4c128b8233a9c]::ty::fold::TypeFolder>::fold_region
  23:     0x7fb28b8e54f9 - <rustc_middle[75c4c128b8233a9c]::ty::PredicateKind as rustc_middle[75c4c128b8233a9c]::ty::fold::TypeFoldable>::try_fold_with::<rustc_middle[75c4c128b8233a9c]::ty::subst::SubstFolder>
  24:     0x7fb28b9a94b1 - <rustc_middle[75c4c128b8233a9c]::ty::subst::SubstFolder as rustc_middle[75c4c128b8233a9c]::ty::fold::FallibleTypeFolder>::try_fold_binder::<rustc_middle[75c4c128b8233a9c]::ty::PredicateKind>
  25:     0x7fb28b9a8e66 - <rustc_infer[4fdf331db6582e15]::infer::InferCtxt>::register_hidden_type
  26:     0x7fb28b9a8517 - <rustc_infer[4fdf331db6582e15]::infer::InferCtxt>::handle_opaque_type::{closure#0}
  27:     0x7fb28b9a7e35 - <rustc_infer[4fdf331db6582e15]::infer::InferCtxt>::handle_opaque_type
  28:     0x7fb28b9a7a69 - <rustc_middle[75c4c128b8233a9c]::ty::fold::BottomUpFolder<<rustc_infer[4fdf331db6582e15]::infer::InferCtxt>::replace_opaque_types_with_inference_vars::{closure#3}, <rustc_infer[4fdf331db6582e15]::infer::InferCtxt>::replace_opaque_types_with_inference_vars::{closure#1}, <rustc_infer[4fdf331db6582e15]::infer::InferCtxt>::replace_opaque_types_with_inference_vars::{closure#2}> as rustc_middle[75c4c128b8233a9c]::ty::fold::FallibleTypeFolder>::try_fold_ty
  29:     0x7fb28b9a82af - <&rustc_middle[75c4c128b8233a9c]::ty::list::List<rustc_middle[75c4c128b8233a9c]::ty::subst::GenericArg> as rustc_middle[75c4c128b8233a9c]::ty::fold::TypeFoldable>::try_fold_with::<rustc_middle[75c4c128b8233a9c]::ty::fold::BottomUpFolder<<rustc_infer[4fdf331db6582e15]::infer::InferCtxt>::replace_opaque_types_with_inference_vars::{closure#3}, <rustc_infer[4fdf331db6582e15]::infer::InferCtxt>::replace_opaque_types_with_inference_vars::{closure#1}, <rustc_infer[4fdf331db6582e15]::infer::InferCtxt>::replace_opaque_types_with_inference_vars::{closure#2}>>
  30:     0x7fb28b9a8064 - <rustc_middle[75c4c128b8233a9c]::ty::Ty as rustc_middle[75c4c128b8233a9c]::ty::fold::TypeSuperFoldable>::super_fold_with::<rustc_middle[75c4c128b8233a9c]::ty::fold::BottomUpFolder<<rustc_infer[4fdf331db6582e15]::infer::InferCtxt>::replace_opaque_types_with_inference_vars::{closure#3}, <rustc_infer[4fdf331db6582e15]::infer::InferCtxt>::replace_opaque_types_with_inference_vars::{closure#1}, <rustc_infer[4fdf331db6582e15]::infer::InferCtxt>::replace_opaque_types_with_inference_vars::{closure#2}>>
  31:     0x7fb28b9a784f - <rustc_middle[75c4c128b8233a9c]::ty::fold::BottomUpFolder<<rustc_infer[4fdf331db6582e15]::infer::InferCtxt>::replace_opaque_types_with_inference_vars::{closure#3}, <rustc_infer[4fdf331db6582e15]::infer::InferCtxt>::replace_opaque_types_with_inference_vars::{closure#1}, <rustc_infer[4fdf331db6582e15]::infer::InferCtxt>::replace_opaque_types_with_inference_vars::{closure#2}> as rustc_middle[75c4c128b8233a9c]::ty::fold::FallibleTypeFolder>::try_fold_ty
  32:     0x7fb28b2fe4b1 - <rustc_infer[4fdf331db6582e15]::infer::InferCtxt>::replace_opaque_types_with_inference_vars
  33:     0x7fb28a8c7645 - <rustc_typeck[b8834cb362e3ce96]::check::fn_ctxt::FnCtxt>::supplied_sig_of_closure
  34:     0x7fb28a8c428e - <rustc_typeck[b8834cb362e3ce96]::check::fn_ctxt::FnCtxt>::check_expr_closure
  35:     0x7fb28a842f21 - <rustc_typeck[b8834cb362e3ce96]::check::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  36:     0x7fb28a83a518 - <rustc_typeck[b8834cb362e3ce96]::check::fn_ctxt::FnCtxt>::check_argument_types
  37:     0x7fb28a7f25e7 - <rustc_typeck[b8834cb362e3ce96]::check::fn_ctxt::FnCtxt>::check_call
  38:     0x7fb28a840036 - <rustc_typeck[b8834cb362e3ce96]::check::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  39:     0x7fb28b2fb3ed - rustc_typeck[b8834cb362e3ce96]::check::check::check_fn
  40:     0x7fb28b2ed59e - <rustc_infer[4fdf331db6582e15]::infer::InferCtxtBuilder>::enter::<&rustc_middle[75c4c128b8233a9c]::ty::context::TypeckResults, <rustc_typeck[b8834cb362e3ce96]::check::inherited::InheritedBuilder>::enter<rustc_typeck[b8834cb362e3ce96]::check::typeck_with_fallback<rustc_typeck[b8834cb362e3ce96]::check::typeck::{closure#0}>::{closure#1}, &rustc_middle[75c4c128b8233a9c]::ty::context::TypeckResults>::{closure#0}>
  41:     0x7fb28b2eae74 - rustc_typeck[b8834cb362e3ce96]::check::typeck
  42:     0x7fb28b45ebaf - <rustc_query_system[5fe617a65500e195]::dep_graph::graph::DepGraph<rustc_middle[75c4c128b8233a9c]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[75c4c128b8233a9c]::ty::context::TyCtxt, rustc_span[50cf38d84baf6853]::def_id::LocalDefId, &rustc_middle[75c4c128b8233a9c]::ty::context::TypeckResults>
  43:     0x7fb28b4571aa - rustc_query_system[5fe617a65500e195]::query::plumbing::try_execute_query::<rustc_query_impl[52bd71d0e9f17ddb]::plumbing::QueryCtxt, rustc_query_system[5fe617a65500e195]::query::caches::DefaultCache<rustc_span[50cf38d84baf6853]::def_id::LocalDefId, &rustc_middle[75c4c128b8233a9c]::ty::context::TypeckResults>>
  44:     0x7fb28bce0868 - <rustc_query_impl[52bd71d0e9f17ddb]::Queries as rustc_middle[75c4c128b8233a9c]::ty::query::QueryEngine>::typeck
  45:     0x7fb28b3ceb15 - <rustc_middle[75c4c128b8233a9c]::ty::context::TyCtxt>::typeck_opt_const_arg
  46:     0x7fb28b3cd5c5 - rustc_mir_build[50775eeb2e1edd5]::build::mir_built
  47:     0x7fb28b1eb99c - <rustc_query_system[5fe617a65500e195]::dep_graph::graph::DepGraph<rustc_middle[75c4c128b8233a9c]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[75c4c128b8233a9c]::ty::context::TyCtxt, rustc_middle[75c4c128b8233a9c]::ty::WithOptConstParam<rustc_span[50cf38d84baf6853]::def_id::LocalDefId>, &rustc_data_structures[300a5bbbb6993449]::steal::Steal<rustc_middle[75c4c128b8233a9c]::mir::Body>>
  48:     0x7fb28b1ea84e - rustc_query_system[5fe617a65500e195]::query::plumbing::try_execute_query::<rustc_query_impl[52bd71d0e9f17ddb]::plumbing::QueryCtxt, rustc_query_system[5fe617a65500e195]::query::caches::DefaultCache<rustc_middle[75c4c128b8233a9c]::ty::WithOptConstParam<rustc_span[50cf38d84baf6853]::def_id::LocalDefId>, &rustc_data_structures[300a5bbbb6993449]::steal::Steal<rustc_middle[75c4c128b8233a9c]::mir::Body>>>
  49:     0x7fb28bcdf0f5 - <rustc_query_impl[52bd71d0e9f17ddb]::Queries as rustc_middle[75c4c128b8233a9c]::ty::query::QueryEngine>::mir_built
  50:     0x7fb28ae997e7 - rustc_mir_transform[7f3ce148503ab959]::check_unsafety::unsafety_check_result
  51:     0x7fb28ae9927e - <rustc_mir_transform[7f3ce148503ab959]::check_unsafety::provide::{closure#0} as core[480a4b334008baa8]::ops::function::FnOnce<(rustc_middle[75c4c128b8233a9c]::ty::context::TyCtxt, rustc_span[50cf38d84baf6853]::def_id::LocalDefId)>>::call_once
  52:     0x7fb28b316ccf - <rustc_query_system[5fe617a65500e195]::dep_graph::graph::DepGraph<rustc_middle[75c4c128b8233a9c]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[75c4c128b8233a9c]::ty::context::TyCtxt, rustc_span[50cf38d84baf6853]::def_id::LocalDefId, &rustc_middle[75c4c128b8233a9c]::mir::query::UnsafetyCheckResult>
  53:     0x7fb28b31543a - rustc_query_system[5fe617a65500e195]::query::plumbing::try_execute_query::<rustc_query_impl[52bd71d0e9f17ddb]::plumbing::QueryCtxt, rustc_query_system[5fe617a65500e195]::query::caches::DefaultCache<rustc_span[50cf38d84baf6853]::def_id::LocalDefId, &rustc_middle[75c4c128b8233a9c]::mir::query::UnsafetyCheckResult>>
  54:     0x7fb28bce046e - <rustc_query_impl[52bd71d0e9f17ddb]::Queries as rustc_middle[75c4c128b8233a9c]::ty::query::QueryEngine>::unsafety_check_result
  55:     0x7fb28a760340 - rustc_mir_transform[7f3ce148503ab959]::mir_const
  56:     0x7fb28b1eb99c - <rustc_query_system[5fe617a65500e195]::dep_graph::graph::DepGraph<rustc_middle[75c4c128b8233a9c]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[75c4c128b8233a9c]::ty::context::TyCtxt, rustc_middle[75c4c128b8233a9c]::ty::WithOptConstParam<rustc_span[50cf38d84baf6853]::def_id::LocalDefId>, &rustc_data_structures[300a5bbbb6993449]::steal::Steal<rustc_middle[75c4c128b8233a9c]::mir::Body>>
  57:     0x7fb28b1ea84e - rustc_query_system[5fe617a65500e195]::query::plumbing::try_execute_query::<rustc_query_impl[52bd71d0e9f17ddb]::plumbing::QueryCtxt, rustc_query_system[5fe617a65500e195]::query::caches::DefaultCache<rustc_middle[75c4c128b8233a9c]::ty::WithOptConstParam<rustc_span[50cf38d84baf6853]::def_id::LocalDefId>, &rustc_data_structures[300a5bbbb6993449]::steal::Steal<rustc_middle[75c4c128b8233a9c]::mir::Body>>>
  58:     0x7fb28bcdf22c - <rustc_query_impl[52bd71d0e9f17ddb]::Queries as rustc_middle[75c4c128b8233a9c]::ty::query::QueryEngine>::mir_const
  59:     0x7fb28adc04c0 - rustc_mir_transform[7f3ce148503ab959]::mir_promoted
  60:     0x7fb28b79a17c - <rustc_query_system[5fe617a65500e195]::dep_graph::graph::DepGraph<rustc_middle[75c4c128b8233a9c]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[75c4c128b8233a9c]::ty::context::TyCtxt, rustc_middle[75c4c128b8233a9c]::ty::WithOptConstParam<rustc_span[50cf38d84baf6853]::def_id::LocalDefId>, (&rustc_data_structures[300a5bbbb6993449]::steal::Steal<rustc_middle[75c4c128b8233a9c]::mir::Body>, &rustc_data_structures[300a5bbbb6993449]::steal::Steal<rustc_index[6ae637c4ad27286d]::vec::IndexVec<rustc_middle[75c4c128b8233a9c]::mir::Promoted, rustc_middle[75c4c128b8233a9c]::mir::Body>>)>
  61:     0x7fb28b798f8d - rustc_query_system[5fe617a65500e195]::query::plumbing::get_query::<rustc_query_impl[52bd71d0e9f17ddb]::queries::mir_promoted, rustc_query_impl[52bd71d0e9f17ddb]::plumbing::QueryCtxt>
  62:     0x7fb28b798567 - <rustc_query_impl[52bd71d0e9f17ddb]::Queries as rustc_middle[75c4c128b8233a9c]::ty::query::QueryEngine>::mir_promoted
  63:     0x7fb28b73cdff - rustc_borrowck[56ad86738e18355a]::mir_borrowck
  64:     0x7fb28b73c91e - <rustc_borrowck[56ad86738e18355a]::provide::{closure#0} as core[480a4b334008baa8]::ops::function::FnOnce<(rustc_middle[75c4c128b8233a9c]::ty::context::TyCtxt, rustc_span[50cf38d84baf6853]::def_id::LocalDefId)>>::call_once
  65:     0x7fb28b14555f - <rustc_query_system[5fe617a65500e195]::dep_graph::graph::DepGraph<rustc_middle[75c4c128b8233a9c]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[75c4c128b8233a9c]::ty::context::TyCtxt, rustc_span[50cf38d84baf6853]::def_id::LocalDefId, &rustc_middle[75c4c128b8233a9c]::mir::query::BorrowCheckResult>
  66:     0x7fb28b144814 - rustc_query_system[5fe617a65500e195]::query::plumbing::try_execute_query::<rustc_query_impl[52bd71d0e9f17ddb]::plumbing::QueryCtxt, rustc_query_system[5fe617a65500e195]::query::caches::DefaultCache<rustc_span[50cf38d84baf6853]::def_id::LocalDefId, &rustc_middle[75c4c128b8233a9c]::mir::query::BorrowCheckResult>>
  67:     0x7fb28bce0ada - <rustc_query_impl[52bd71d0e9f17ddb]::Queries as rustc_middle[75c4c128b8233a9c]::ty::query::QueryEngine>::mir_borrowck
  68:     0x7fb28ba4803c - rustc_typeck[b8834cb362e3ce96]::collect::type_of::type_of
  69:     0x7fb28b1fb273 - <rustc_query_system[5fe617a65500e195]::dep_graph::graph::DepGraph<rustc_middle[75c4c128b8233a9c]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[75c4c128b8233a9c]::ty::context::TyCtxt, rustc_span[50cf38d84baf6853]::def_id::DefId, rustc_middle[75c4c128b8233a9c]::ty::Ty>
  70:     0x7fb28b1f927b - rustc_query_system[5fe617a65500e195]::query::plumbing::get_query::<rustc_query_impl[52bd71d0e9f17ddb]::queries::type_of, rustc_query_impl[52bd71d0e9f17ddb]::plumbing::QueryCtxt>
  71:     0x7fb28b5051c5 - rustc_typeck[b8834cb362e3ce96]::check::check::check_item_type
  72:     0x7fb28b5016ae - rustc_typeck[b8834cb362e3ce96]::check::check::check_mod_item_types
  73:     0x7fb28b0309c2 - <rustc_query_system[5fe617a65500e195]::dep_graph::graph::DepGraph<rustc_middle[75c4c128b8233a9c]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[75c4c128b8233a9c]::ty::context::TyCtxt, rustc_span[50cf38d84baf6853]::def_id::LocalDefId, ()>
  74:     0x7fb28b02fb4e - rustc_query_system[5fe617a65500e195]::query::plumbing::try_execute_query::<rustc_query_impl[52bd71d0e9f17ddb]::plumbing::QueryCtxt, rustc_query_system[5fe617a65500e195]::query::caches::DefaultCache<rustc_span[50cf38d84baf6853]::def_id::LocalDefId, ()>>
  75:     0x7fb28b82bf43 - rustc_query_system[5fe617a65500e195]::query::plumbing::get_query::<rustc_query_impl[52bd71d0e9f17ddb]::queries::check_mod_item_types, rustc_query_impl[52bd71d0e9f17ddb]::plumbing::QueryCtxt>
  76:     0x7fb28bace46f - <rustc_middle[75c4c128b8233a9c]::hir::map::Map>::for_each_module::<rustc_typeck[b8834cb362e3ce96]::check_crate::{closure#6}::{closure#0}>
  77:     0x7fb28b7b8545 - rustc_typeck[b8834cb362e3ce96]::check_crate
  78:     0x7fb28b7b7b77 - rustc_interface[b6374d447bec2332]::passes::analysis
  79:     0x7fb28bb7372c - <rustc_query_system[5fe617a65500e195]::dep_graph::graph::DepGraph<rustc_middle[75c4c128b8233a9c]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[75c4c128b8233a9c]::ty::context::TyCtxt, (), core[480a4b334008baa8]::result::Result<(), rustc_errors[a2987978d4b02d94]::ErrorGuaranteed>>
  80:     0x7fb28bb72eeb - rustc_query_system[5fe617a65500e195]::query::plumbing::try_execute_query::<rustc_query_impl[52bd71d0e9f17ddb]::plumbing::QueryCtxt, rustc_query_system[5fe617a65500e195]::query::caches::DefaultCache<(), core[480a4b334008baa8]::result::Result<(), rustc_errors[a2987978d4b02d94]::ErrorGuaranteed>>>
  81:     0x7fb28bb72a3e - rustc_query_system[5fe617a65500e195]::query::plumbing::get_query::<rustc_query_impl[52bd71d0e9f17ddb]::queries::analysis, rustc_query_impl[52bd71d0e9f17ddb]::plumbing::QueryCtxt>
  82:     0x7fb28b5bea5a - <rustc_interface[b6374d447bec2332]::interface::Compiler>::enter::<rustc_driver[6a784e82872844b3]::run_compiler::{closure#1}::{closure#2}, core[480a4b334008baa8]::result::Result<core[480a4b334008baa8]::option::Option<rustc_interface[b6374d447bec2332]::queries::Linker>, rustc_errors[a2987978d4b02d94]::ErrorGuaranteed>>
  83:     0x7fb28b5b246a - rustc_span[50cf38d84baf6853]::with_source_map::<core[480a4b334008baa8]::result::Result<(), rustc_errors[a2987978d4b02d94]::ErrorGuaranteed>, rustc_interface[b6374d447bec2332]::interface::create_compiler_and_run<core[480a4b334008baa8]::result::Result<(), rustc_errors[a2987978d4b02d94]::ErrorGuaranteed>, rustc_driver[6a784e82872844b3]::run_compiler::{closure#1}>::{closure#1}>
  84:     0x7fb28b5b1e40 - rustc_interface[b6374d447bec2332]::interface::create_compiler_and_run::<core[480a4b334008baa8]::result::Result<(), rustc_errors[a2987978d4b02d94]::ErrorGuaranteed>, rustc_driver[6a784e82872844b3]::run_compiler::{closure#1}>
  85:     0x7fb28b5b01b1 - <scoped_tls[3d37162c759ef368]::ScopedKey<rustc_span[50cf38d84baf6853]::SessionGlobals>>::set::<rustc_interface[b6374d447bec2332]::interface::run_compiler<core[480a4b334008baa8]::result::Result<(), rustc_errors[a2987978d4b02d94]::ErrorGuaranteed>, rustc_driver[6a784e82872844b3]::run_compiler::{closure#1}>::{closure#0}, core[480a4b334008baa8]::result::Result<(), rustc_errors[a2987978d4b02d94]::ErrorGuaranteed>>
  86:     0x7fb28b5afe9f - std[c5ae6ddbbc7a9ee8]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[b6374d447bec2332]::util::run_in_thread_pool_with_globals<rustc_interface[b6374d447bec2332]::interface::run_compiler<core[480a4b334008baa8]::result::Result<(), rustc_errors[a2987978d4b02d94]::ErrorGuaranteed>, rustc_driver[6a784e82872844b3]::run_compiler::{closure#1}>::{closure#0}, core[480a4b334008baa8]::result::Result<(), rustc_errors[a2987978d4b02d94]::ErrorGuaranteed>>::{closure#0}, core[480a4b334008baa8]::result::Result<(), rustc_errors[a2987978d4b02d94]::ErrorGuaranteed>>
  87:     0x7fb28bc04c29 - <<std[c5ae6ddbbc7a9ee8]::thread::Builder>::spawn_unchecked_<rustc_interface[b6374d447bec2332]::util::run_in_thread_pool_with_globals<rustc_interface[b6374d447bec2332]::interface::run_compiler<core[480a4b334008baa8]::result::Result<(), rustc_errors[a2987978d4b02d94]::ErrorGuaranteed>, rustc_driver[6a784e82872844b3]::run_compiler::{closure#1}>::{closure#0}, core[480a4b334008baa8]::result::Result<(), rustc_errors[a2987978d4b02d94]::ErrorGuaranteed>>::{closure#0}, core[480a4b334008baa8]::result::Result<(), rustc_errors[a2987978d4b02d94]::ErrorGuaranteed>>::{closure#1} as core[480a4b334008baa8]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  88:     0x7fb289566143 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hede4885ee64a1fac
                               at /rustc/d394408fb38c4de61f765a3ed5189d2731a1da91/library/alloc/src/boxed.rs:1935:9
  89:     0x7fb289566143 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h06c745de9f474954
                               at /rustc/d394408fb38c4de61f765a3ed5189d2731a1da91/library/alloc/src/boxed.rs:1935:9
  90:     0x7fb289566143 - std::sys::unix::thread::Thread::new::thread_start::h529a493f2fb191b6
                               at /rustc/d394408fb38c4de61f765a3ed5189d2731a1da91/library/std/src/sys/unix/thread.rs:108:17
  91:     0x7fb289427609 - start_thread
                               at /build/glibc-SzIz7B/glibc-2.31/nptl/pthread_create.c:477:8
  92:     0x7fb28934a133 - clone
                               at /build/glibc-SzIz7B/glibc-2.31/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:95
  93:                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.65.0-nightly (d394408fb 2022-08-07) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type lib -C embed-bitcode=no -C debuginfo=2 -C incremental -C panic=abort -Z panic-abort-tests -Z codegen-backend=/home/savb/Projects/rustc_codegen_cranelift/build/lib/librustc_codegen_cranelift.so

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

query stack during panic:
#0 [typeck] type-checking `executor::select::<impl at src/executor/select.rs:113:1: 113:18>::stream`
#1 [mir_built] building MIR for `executor::select::<impl at src/executor/select.rs:113:1: 113:18>::stream`
#2 [unsafety_check_result] unsafety-checking `executor::select::<impl at src/executor/select.rs:113:1: 113:18>::stream`
#3 [mir_const] processing MIR for `executor::select::<impl at src/executor/select.rs:113:1: 113:18>::stream`
#4 [mir_promoted] processing `executor::select::<impl at src/executor/select.rs:113:1: 113:18>::stream`
#5 [mir_borrowck] borrow-checking `executor::select::<impl at src/executor/select.rs:113:1: 113:18>::stream`
#6 [type_of] computing type of `executor::select::<impl at src/executor/select.rs:113:1: 113:18>::stream::{opaque#0}`
#7 [check_mod_item_types] checking item types in module `executor::select`
#8 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `sea-orm`
bjorn3 commented 2 years ago

This crash happens before cg_clif even gets a chance to run. That you don't see this on nightly is likely due to either the incremental cache not being in a state where it crashes (try cargo clean to see if it fixes this error) or cg_clif uses a nightly with this bug, but you use a different nightly without this issue. (cargo +nightly-2022-08-08 build will use the same nightly as cg_clif, except without cg_clif. please try that one to see if it that reproduces the issue.)

Jupp56 commented 2 years ago

I did use cargo clean, but specifying the cargo version indeed reproduced the error. It seems, 2022-08-12 has fixed it. Thank you for your quick help!

bjorn3 commented 2 years ago

I plan to update cg_clif to the latest nightly within the next couple of days. Right now I'm working on parallelizing codegen though, which should give a nice speed boost. (the llvm backend already has this, so sometimes wall time is better with cg_llvm than with cg_clif)

bjorn3 commented 2 years ago

Updated in https://github.com/bjorn3/rustc_codegen_cranelift/commit/1cac888e4361aea0abbaf8c0ee52509f1742bfe0.