Skip to content

ICE when migrating from diesel 1.4 to 2.0.0-rc.0 #96550

Closed as not planned
Closed as not planned
@nyvs

Description

@nyvs

Code

Was trying to migrate from diesel 1.4 to 2.0 ...
I don't have time to provide a minimal example now, but will try if it turns out that it'd be useful.

<code>

Meta

rustc --version --verbose:

rustc 1.60.0 (7737e0b5c 2022-04-04)
binary: rustc
commit-hash: 7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c
commit-date: 2022-04-04
host: x86_64-unknown-linux-gnu
release: 1.60.0
LLVM version: 14.0.0

Error output

error: internal compiler error: compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs:931:17: ErrorReporting Overflow should not reach `report_selection_err` call

thread 'rustc' panicked at 'Box<dyn Any>', compiler/rustc_errors/src/lib.rs:1160:9
stack backtrace:
   0:     0x7fa343e9786d - std::backtrace_rs::backtrace::libunwind::trace::hee598835bc88d35b
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7fa343e9786d - std::backtrace_rs::backtrace::trace_unsynchronized::h9cdc730ba5cf5d72
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7fa343e9786d - std::sys_common::backtrace::_print_fmt::h75aeaf7ed30e43fa
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/sys_common/backtrace.rs:66:5
   3:     0x7fa343e9786d - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h606862f787600875
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/sys_common/backtrace.rs:45:22
   4:     0x7fa343ef74ec - core::fmt::write::he803f0f418caf762
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/core/src/fmt/mod.rs:1190:17
   5:     0x7fa343e87a98 - std::io::Write::write_fmt::h70bc45872f37e7bb
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/io/mod.rs:1657:15
   6:     0x7fa343e9b847 - std::sys_common::backtrace::_print::h64d038cf8ac3e13e
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/sys_common/backtrace.rs:48:5
   7:     0x7fa343e9b847 - std::sys_common::backtrace::print::h359300b4a7fccf65
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/sys_common/backtrace.rs:35:9
   8:     0x7fa343e9b847 - std::panicking::default_hook::{{closure}}::hf51be35e2f510149
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/panicking.rs:295:22
   9:     0x7fa343e9b510 - std::panicking::default_hook::h03ca0f22e1d2d25e
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/panicking.rs:314:9
  10:     0x7fa3446b92c1 - rustc_driver[6eeb127b85fe99ac]::DEFAULT_HOOK::{closure#0}::{closure#0}
  11:     0x7fa32a122af9 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::hfeda50bbceaa8368
  12:     0x7fa32a18a744 - proc_macro::bridge::client::<impl proc_macro::bridge::Bridge>::enter::{{closure}}::{{closure}}::h4728d9074d3d7986
  13:     0x7fa32a0dc246 - std::panicking::update_hook::{{closure}}::hf916b833191ff270
  14:     0x7fa343e9c124 - std::panicking::rust_panic_with_hook::h3b7380e99b825b63
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/panicking.rs:702:17
  15:     0x7fa34578f301 - std[cd3cf6af28dff6de]::panicking::begin_panic::<rustc_errors[bd800fb2a5e0b9f5]::ExplicitBug>::{closure#0}
  16:     0x7fa34578f266 - std[cd3cf6af28dff6de]::sys_common::backtrace::__rust_end_short_backtrace::<std[cd3cf6af28dff6de]::panicking::begin_panic<rustc_errors[bd800fb2a5e0b9f5]::ExplicitBug>::{closure#0}, !>
  17:     0x7fa34579563f - std[cd3cf6af28dff6de]::panicking::begin_panic::<rustc_errors[bd800fb2a5e0b9f5]::ExplicitBug>
  18:     0x7fa3457a22ed - std[cd3cf6af28dff6de]::panic::panic_any::<rustc_errors[bd800fb2a5e0b9f5]::ExplicitBug>
  19:     0x7fa3457a15a7 - <rustc_errors[bd800fb2a5e0b9f5]::HandlerInner>::bug
  20:     0x7fa3457a10d0 - <rustc_errors[bd800fb2a5e0b9f5]::Handler>::bug
  21:     0x7fa345623609 - rustc_middle[c145adf1c4567bf]::ty::context::tls::with_opt::<rustc_middle[c145adf1c4567bf]::util::bug::opt_span_bug_fmt<rustc_span[4b4bb4534443c42f]::span_encoding::Span>::{closure#0}, ()>
  22:     0x7fa345623ff0 - rustc_middle[c145adf1c4567bf]::util::bug::opt_span_bug_fmt::<rustc_span[4b4bb4534443c42f]::span_encoding::Span>
  23:     0x7fa345623f66 - rustc_middle[c145adf1c4567bf]::util::bug::bug_fmt
  24:     0x7fa3454a226a - <rustc_infer[844122ed1ec4b57a]::infer::InferCtxt as rustc_trait_selection[1d7483382b445f9]::traits::error_reporting::InferCtxtExt>::report_selection_error
  25:     0x7fa3454aa553 - <rustc_infer[844122ed1ec4b57a]::infer::InferCtxt as rustc_trait_selection[1d7483382b445f9]::traits::error_reporting::InferCtxtPrivExt>::report_fulfillment_error
  26:     0x7fa34549dc36 - <rustc_infer[844122ed1ec4b57a]::infer::InferCtxt as rustc_trait_selection[1d7483382b445f9]::traits::error_reporting::InferCtxtExt>::report_fulfillment_errors
  27:     0x7fa345a6ce8d - <rustc_typeck[1c3c3b5b5d734e80]::check::fn_ctxt::FnCtxt>::check_argument_types
  28:     0x7fa345a82db1 - <rustc_typeck[1c3c3b5b5d734e80]::check::fn_ctxt::FnCtxt>::check_expr_kind
  29:     0x7fa345a48c1c - <rustc_typeck[1c3c3b5b5d734e80]::check::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  30:     0x7fa345a82715 - <rustc_typeck[1c3c3b5b5d734e80]::check::fn_ctxt::FnCtxt>::check_expr_kind
  31:     0x7fa345a48c1c - <rustc_typeck[1c3c3b5b5d734e80]::check::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  32:     0x7fa345a82715 - <rustc_typeck[1c3c3b5b5d734e80]::check::fn_ctxt::FnCtxt>::check_expr_kind
  33:     0x7fa345a48c1c - <rustc_typeck[1c3c3b5b5d734e80]::check::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  34:     0x7fa345a706a6 - <rustc_typeck[1c3c3b5b5d734e80]::check::fn_ctxt::FnCtxt>::check_stmt
  35:     0x7fa345a71689 - <rustc_typeck[1c3c3b5b5d734e80]::check::fn_ctxt::FnCtxt>::check_block_with_expected
  36:     0x7fa345a48c1c - <rustc_typeck[1c3c3b5b5d734e80]::check::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  37:     0x7fa345b84df9 - rustc_typeck[1c3c3b5b5d734e80]::check::check::check_fn
  38:     0x7fa345af8bc1 - <rustc_infer[844122ed1ec4b57a]::infer::InferCtxtBuilder>::enter::<&rustc_middle[c145adf1c4567bf]::ty::context::TypeckResults, <rustc_typeck[1c3c3b5b5d734e80]::check::inherited::InheritedBuilder>::enter<rustc_typeck[1c3c3b5b5d734e80]::check::typeck_with_fallback<rustc_typeck[1c3c3b5b5d734e80]::check::typeck::{closure#0}>::{closure#1}, &rustc_middle[c145adf1c4567bf]::ty::context::TypeckResults>::{closure#0}>
  39:     0x7fa345ad45c3 - rustc_typeck[1c3c3b5b5d734e80]::check::typeck
  40:     0x7fa345f71855 - rustc_query_system[cf3d2502706fe991]::query::plumbing::try_execute_query::<rustc_query_impl[8218de0923c6cd45]::plumbing::QueryCtxt, rustc_query_system[cf3d2502706fe991]::query::caches::DefaultCache<rustc_span[4b4bb4534443c42f]::def_id::LocalDefId, &rustc_middle[c145adf1c4567bf]::ty::context::TypeckResults>>
  41:     0x7fa345fd05fc - <rustc_query_impl[8218de0923c6cd45]::Queries as rustc_middle[c145adf1c4567bf]::ty::query::QueryEngine>::typeck
  42:     0x7fa345b35a7a - <rustc_middle[c145adf1c4567bf]::hir::map::Map>::par_body_owners::<rustc_typeck[1c3c3b5b5d734e80]::check::typeck_item_bodies::{closure#0}>
  43:     0x7fa3467a9e1c - rustc_typeck[1c3c3b5b5d734e80]::check::typeck_item_bodies
  44:     0x7fa3469def44 - rustc_query_system[cf3d2502706fe991]::query::plumbing::try_execute_query::<rustc_query_impl[8218de0923c6cd45]::plumbing::QueryCtxt, rustc_query_system[cf3d2502706fe991]::query::caches::DefaultCache<(), ()>>
  45:     0x7fa346a06bc8 - rustc_query_system[cf3d2502706fe991]::query::plumbing::get_query::<rustc_query_impl[8218de0923c6cd45]::queries::typeck_item_bodies, rustc_query_impl[8218de0923c6cd45]::plumbing::QueryCtxt>
  46:     0x7fa3467ae309 - <rustc_session[95a8f1c94d15e5dc]::session::Session>::time::<(), rustc_typeck[1c3c3b5b5d734e80]::check_crate::{closure#7}>
  47:     0x7fa3467a25e3 - rustc_typeck[1c3c3b5b5d734e80]::check_crate
  48:     0x7fa34653bed7 - rustc_interface[afc566840a941718]::passes::analysis
  49:     0x7fa3469d5973 - rustc_query_system[cf3d2502706fe991]::query::plumbing::try_execute_query::<rustc_query_impl[8218de0923c6cd45]::plumbing::QueryCtxt, rustc_query_system[cf3d2502706fe991]::query::caches::DefaultCache<(), core[2734bb1f7d9ec6a5]::result::Result<(), rustc_errors[bd800fb2a5e0b9f5]::ErrorReported>>>
  50:     0x7fa346a14c05 - rustc_query_system[cf3d2502706fe991]::query::plumbing::get_query::<rustc_query_impl[8218de0923c6cd45]::queries::analysis, rustc_query_impl[8218de0923c6cd45]::plumbing::QueryCtxt>
  51:     0x7fa34651a608 - <rustc_interface[afc566840a941718]::passes::QueryContext>::enter::<rustc_driver[6eeb127b85fe99ac]::run_compiler::{closure#1}::{closure#2}::{closure#3}, core[2734bb1f7d9ec6a5]::result::Result<(), rustc_errors[bd800fb2a5e0b9f5]::ErrorReported>>
  52:     0x7fa346508ac5 - rustc_interface[afc566840a941718]::interface::create_compiler_and_run::<core[2734bb1f7d9ec6a5]::result::Result<(), rustc_errors[bd800fb2a5e0b9f5]::ErrorReported>, rustc_driver[6eeb127b85fe99ac]::run_compiler::{closure#1}>
  53:     0x7fa3464ee134 - std[cd3cf6af28dff6de]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[afc566840a941718]::util::run_in_thread_pool_with_globals<rustc_interface[afc566840a941718]::interface::run_compiler<core[2734bb1f7d9ec6a5]::result::Result<(), rustc_errors[bd800fb2a5e0b9f5]::ErrorReported>, rustc_driver[6eeb127b85fe99ac]::run_compiler::{closure#1}>::{closure#0}, core[2734bb1f7d9ec6a5]::result::Result<(), rustc_errors[bd800fb2a5e0b9f5]::ErrorReported>>::{closure#0}, core[2734bb1f7d9ec6a5]::result::Result<(), rustc_errors[bd800fb2a5e0b9f5]::ErrorReported>>
  54:     0x7fa3465213e9 - <<std[cd3cf6af28dff6de]::thread::Builder>::spawn_unchecked_<rustc_interface[afc566840a941718]::util::run_in_thread_pool_with_globals<rustc_interface[afc566840a941718]::interface::run_compiler<core[2734bb1f7d9ec6a5]::result::Result<(), rustc_errors[bd800fb2a5e0b9f5]::ErrorReported>, rustc_driver[6eeb127b85fe99ac]::run_compiler::{closure#1}>::{closure#0}, core[2734bb1f7d9ec6a5]::result::Result<(), rustc_errors[bd800fb2a5e0b9f5]::ErrorReported>>::{closure#0}, core[2734bb1f7d9ec6a5]::result::Result<(), rustc_errors[bd800fb2a5e0b9f5]::ErrorReported>>::{closure#1} as core[2734bb1f7d9ec6a5]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  55:     0x7fa343ea7d03 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hf70ac038171e3e1a
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/alloc/src/boxed.rs:1853:9
  56:     0x7fa343ea7d03 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::he6690128792365ad
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/alloc/src/boxed.rs:1853:9
  57:     0x7fa343ea7d03 - std::sys::unix::thread::Thread::new::thread_start::ha07928d93d5a5ec9
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/sys/unix/thread.rs:108:17
  58:     0x7fa343c835c2 - start_thread
  59:     0x7fa343d08584 - __clone
  60:                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.60.0 (7737e0b5c 2022-04-04) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type bin -C opt-level=3 -C embed-bitcode=no
query stack during panic:
#0 [typeck] type-checking `api::internal::universe::create_moon`
#1 [typeck_item_bodies] type-checking all item bodies
#2 [analysis] running analysis passes on this crate
end of query stack
Backtrace

stack backtrace:
   0: std::panicking::begin_panic::<rustc_errors::ExplicitBug>
   1: std::panic::panic_any::<rustc_errors::ExplicitBug>
   2: <rustc_errors::HandlerInner>::bug
   3: <rustc_errors::Handler>::bug
   4: rustc_middle::ty::context::tls::with_opt::<rustc_middle::util::bug::opt_span_bug_fmt<rustc_span::span_encoding::Span>::{closure#0}, ()>
   5: rustc_middle::util::bug::opt_span_bug_fmt::<rustc_span::span_encoding::Span>
   6: rustc_middle::util::bug::bug_fmt
   7: <rustc_infer::infer::InferCtxt as rustc_trait_selection::traits::error_reporting::InferCtxtExt>::report_selection_error
   8: <rustc_infer::infer::InferCtxt as rustc_trait_selection::traits::error_reporting::InferCtxtPrivExt>::report_fulfillment_error
   9: <rustc_infer::infer::InferCtxt as rustc_trait_selection::traits::error_reporting::InferCtxtExt>::report_fulfillment_errors
  10: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_argument_types
  11: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_kind
  12: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  13: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_kind
  14: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  15: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_kind
  16: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  17: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_stmt
  18: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_block_with_expected
  19: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  20: rustc_typeck::check::check::check_fn
  21: <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}>
  22: rustc_typeck::check::typeck
  23: 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>>
  24: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::typeck
  25: <rustc_middle::hir::map::Map>::par_body_owners::<rustc_typeck::check::typeck_item_bodies::{closure#0}>
  26: rustc_typeck::check::typeck_item_bodies
  27: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::plumbing::QueryCtxt, rustc_query_system::query::caches::DefaultCache<(), ()>>
  28: rustc_query_system::query::plumbing::get_query::<rustc_query_impl::queries::typeck_item_bodies, rustc_query_impl::plumbing::QueryCtxt>
  29: <rustc_session::session::Session>::time::<(), rustc_typeck::check_crate::{closure#7}>
  30: rustc_typeck::check_crate
  31: rustc_interface::passes::analysis
  32: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::plumbing::QueryCtxt, rustc_query_system::query::caches::DefaultCache<(), core::result::Result<(), rustc_errors::ErrorReported>>>
  33: rustc_query_system::query::plumbing::get_query::<rustc_query_impl::queries::analysis, rustc_query_impl::plumbing::QueryCtxt>
  34: <rustc_interface::passes::QueryContext>::enter::<rustc_driver::run_compiler::{closure#1}::{closure#2}::{closure#3}, core::result::Result<(), rustc_errors::ErrorReported>>
  35: rustc_interface::interface::create_compiler_and_run::<core::result::Result<(), rustc_errors::ErrorReported>, rustc_driver::run_compiler::{closure#1}>
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.60.0 (7737e0b5c 2022-04-04) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type bin -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 `api::internal::universe::create_moon`
#1 [typeck_item_bodies] type-checking all item bodies
#2 [analysis] running analysis passes on this crate
end of query stack

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable ExampleI-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