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

closure causes panic #96809

Closed
SephVelut opened this issue May 7, 2022 · 3 comments
Closed

closure causes panic #96809

SephVelut opened this issue May 7, 2022 · 3 comments
Labels
C-bug Category: This is a bug. 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.

Comments

@SephVelut
Copy link

SephVelut commented May 7, 2022

Change title if you understand this panic more descriptively.

note: rustc 1.62.0-nightly (30f386087 2022-05-05) running on x86_64-unknown-linux-gnu
note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental
note: some of the compiler flags provided by cargo are hidden

I don't really know how to minimize this example.

use pom::parser::{is_a, one_of}

#[test]
fn parse() {
    let input = b"Treehouse.ads :=";

    let uppercase_char = is_a(|x: u8| (x as char).is_uppercase());
    let pound = is_a(|x: u8| x == b'#');
    let ident = (one_of(b"abcdefghijklmnopqrstuvwxyz") | one_of(b"ABCDEFGHIJKLMNOPQRSTUVWXYZ")).repeat(0..);

    let spec_name = (-uppercase_char * ident).map((String::from_utf8).unwrap()); //this causes the panic

    println!("{:?}", spec_name.parse(input));
}

cargo test

thread 'rustc' panicked at 'DefId::expect_local: `DefId(5:5877 ~ alloc[2132]::string::{impl#0}::from_utf8)` isn't local', /rustc/30f386087564243ab88a93c984c265290a31580b/compiler/rustc_span/src/def_id.rs:283:43
stack backtrace:
   0:     0x7f77a128efad - std::backtrace_rs::backtrace::libunwind::trace::h7991ec96ab4c54d4
                               at /rustc/30f386087564243ab88a93c984c265290a31580b/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f77a128efad - std::backtrace_rs::backtrace::trace_unsynchronized::h18b7a321bd5fc0be
                               at /rustc/30f386087564243ab88a93c984c265290a31580b/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f77a128efad - std::sys_common::backtrace::_print_fmt::h3ce334712315b3b3
                               at /rustc/30f386087564243ab88a93c984c265290a31580b/library/std/src/sys_common/backtrace.rs:66:5
   3:     0x7f77a128efad - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h9fe3cb3617616bb1
                               at /rustc/30f386087564243ab88a93c984c265290a31580b/library/std/src/sys_common/backtrace.rs:45:22
   4:     0x7f77a12eacec - core::fmt::write::h3467ff15bc25f01c
                               at /rustc/30f386087564243ab88a93c984c265290a31580b/library/core/src/fmt/mod.rs:1194:17
   5:     0x7f77a12806a1 - std::io::Write::write_fmt::h27e7b97a23eeefb1
                               at /rustc/30f386087564243ab88a93c984c265290a31580b/library/std/src/io/mod.rs:1655:15
   6:     0x7f77a1291cc5 - std::sys_common::backtrace::_print::h31df922f8c433d5d
                               at /rustc/30f386087564243ab88a93c984c265290a31580b/library/std/src/sys_common/backtrace.rs:48:5
   7:     0x7f77a1291cc5 - std::sys_common::backtrace::print::hbb7030c9dcb3d932
                               at /rustc/30f386087564243ab88a93c984c265290a31580b/library/std/src/sys_common/backtrace.rs:35:9
   8:     0x7f77a1291cc5 - std::panicking::default_hook::{{closure}}::hfbd0333e3bf0a7f2
                               at /rustc/30f386087564243ab88a93c984c265290a31580b/library/std/src/panicking.rs:295:22
   9:     0x7f77a1291939 - std::panicking::default_hook::h3b718975ac1f8c21
                               at /rustc/30f386087564243ab88a93c984c265290a31580b/library/std/src/panicking.rs:314:9
  10:     0x7f77a1a54301 - rustc_driver[c9d212e03a1c949d]::DEFAULT_HOOK::{closure#0}::{closure#0}
  11:     0x7f77a1292496 - std::panicking::rust_panic_with_hook::h6a0399740ae00003
                               at /rustc/30f386087564243ab88a93c984c265290a31580b/library/std/src/panicking.rs:702:17
  12:     0x7f77a1292297 - std::panicking::begin_panic_handler::{{closure}}::h74abd2966959f709
                               at /rustc/30f386087564243ab88a93c984c265290a31580b/library/std/src/panicking.rs:588:13
  13:     0x7f77a128f464 - std::sys_common::backtrace::__rust_end_short_backtrace::h3ff98f1918a8e264
                               at /rustc/30f386087564243ab88a93c984c265290a31580b/library/std/src/sys_common/backtrace.rs:138:18
  14:     0x7f77a1291fc9 - rust_begin_unwind
                               at /rustc/30f386087564243ab88a93c984c265290a31580b/library/std/src/panicking.rs:584:5
  15:     0x7f77a1257293 - core::panicking::panic_fmt::hb51507b0dc635922
                               at /rustc/30f386087564243ab88a93c984c265290a31580b/library/core/src/panicking.rs:142:14
  16:     0x7f77a1d5a126 - <rustc_typeck[aa822bc0d0c95cda]::check::fn_ctxt::FnCtxt>::report_method_error
  17:     0x7f77a2f3f31b - <rustc_typeck[aa822bc0d0c95cda]::check::fn_ctxt::FnCtxt>::check_expr_kind
  18:     0x7f77a2efea1f - <rustc_typeck[aa822bc0d0c95cda]::check::fn_ctxt::FnCtxt>::check_argument_types
  19:     0x7f77a2f3ab70 - <rustc_typeck[aa822bc0d0c95cda]::check::fn_ctxt::FnCtxt>::check_expr_kind
  20:     0x7f77a2f392d0 - <rustc_typeck[aa822bc0d0c95cda]::check::fn_ctxt::FnCtxt>::check_expr_with_expectation
  21:     0x7f77a2f27909 - <rustc_typeck[aa822bc0d0c95cda]::check::fn_ctxt::FnCtxt>::check_stmt
  22:     0x7f77a2f29142 - <rustc_typeck[aa822bc0d0c95cda]::check::fn_ctxt::FnCtxt>::check_block_with_expected
  23:     0x7f77a2f3a5c3 - <rustc_typeck[aa822bc0d0c95cda]::check::fn_ctxt::FnCtxt>::check_expr_kind
  24:     0x7f77a2f392d0 - <rustc_typeck[aa822bc0d0c95cda]::check::fn_ctxt::FnCtxt>::check_expr_with_expectation
  25:     0x7f77a305d844 - rustc_typeck[aa822bc0d0c95cda]::check::check::check_fn
  26:     0x7f77a2fbb39c - <rustc_infer[fe031dec95907e56]::infer::InferCtxtBuilder>::enter::<&rustc_middle[aad4a7609f56511b]::ty::context::TypeckResults, <rustc_typeck[aa822bc0d0c95cda]::check::inherited::InheritedBuilder>::enter<rustc_typeck[aa822bc0d0c95cda]::check::typeck_with_fallback<rustc_typeck[aa822bc0d0c95cda]::check::typeck::{closure#0}>::{closure#1}, &rustc_middle[aad4a7609f56511b]::ty::context::TypeckResults>::{closure#0}>
  27:     0x7f77a2f72290 - rustc_typeck[aa822bc0d0c95cda]::check::typeck
  28:     0x7f77a3f87e70 - <rustc_query_system[a591ad4c8c400a0c]::dep_graph::graph::DepGraph<rustc_middle[aad4a7609f56511b]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[aad4a7609f56511b]::ty::context::TyCtxt, rustc_span[ecd98705281d56d4]::def_id::LocalDefId, &rustc_middle[aad4a7609f56511b]::ty::context::TypeckResults>
  29:     0x7f77a3532a66 - rustc_query_system[a591ad4c8c400a0c]::query::plumbing::try_execute_query::<rustc_query_impl[e6add8203dd53821]::plumbing::QueryCtxt, rustc_query_system[a591ad4c8c400a0c]::query::caches::DefaultCache<rustc_span[ecd98705281d56d4]::def_id::LocalDefId, &rustc_middle[aad4a7609f56511b]::ty::context::TypeckResults>>
  30:     0x7f77a3fefc61 - rustc_query_system[a591ad4c8c400a0c]::query::plumbing::force_query::<rustc_query_impl[e6add8203dd53821]::queries::typeck, rustc_query_impl[e6add8203dd53821]::plumbing::QueryCtxt>
  31:     0x7f77a3fe5a7e - rustc_query_impl[e6add8203dd53821]::query_callbacks::typeck::force_from_dep_node
  32:     0x7f77a397a1e1 - <rustc_middle[aad4a7609f56511b]::ty::context::TyCtxt as rustc_query_system[a591ad4c8c400a0c]::dep_graph::DepContext>::try_force_from_dep_node
  33:     0x7f77a34c37de - <rustc_query_system[a591ad4c8c400a0c]::dep_graph::graph::DepGraph<rustc_middle[aad4a7609f56511b]::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl[e6add8203dd53821]::plumbing::QueryCtxt>
  34:     0x7f77a3512bc9 - rustc_query_system[a591ad4c8c400a0c]::query::plumbing::ensure_must_run::<rustc_query_impl[e6add8203dd53821]::plumbing::QueryCtxt, rustc_span[ecd98705281d56d4]::def_id::LocalDefId, &rustc_middle[aad4a7609f56511b]::mir::query::UnsafetyCheckResult>
  35:     0x7f77a34fd92e - <rustc_query_impl[e6add8203dd53821]::Queries as rustc_middle[aad4a7609f56511b]::ty::query::QueryEngine>::typeck
  36:     0x7f77a3044e08 - <rustc_middle[aad4a7609f56511b]::hir::map::Map>::par_body_owners::<rustc_typeck[aa822bc0d0c95cda]::check::typeck_item_bodies::{closure#0}>
  37:     0x7f77a3d39b4c - rustc_typeck[aa822bc0d0c95cda]::check::typeck_item_bodies
  38:     0x7f77a3fa5264 - <rustc_query_system[a591ad4c8c400a0c]::dep_graph::graph::DepGraph<rustc_middle[aad4a7609f56511b]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[aad4a7609f56511b]::ty::context::TyCtxt, (), ()>
  39:     0x7f77a404f59a - rustc_query_system[a591ad4c8c400a0c]::query::plumbing::try_execute_query::<rustc_query_impl[e6add8203dd53821]::plumbing::QueryCtxt, rustc_query_system[a591ad4c8c400a0c]::query::caches::DefaultCache<(), ()>>
  40:     0x7f77a40768a1 - rustc_query_system[a591ad4c8c400a0c]::query::plumbing::get_query::<rustc_query_impl[e6add8203dd53821]::queries::typeck_item_bodies, rustc_query_impl[e6add8203dd53821]::plumbing::QueryCtxt>
  41:     0x7f77a3d6e233 - <rustc_session[84587541edc70f60]::session::Session>::time::<(), rustc_typeck[aa822bc0d0c95cda]::check_crate::{closure#7}>
  42:     0x7f77a3d43173 - rustc_typeck[aa822bc0d0c95cda]::check_crate
  43:     0x7f77a3af1e47 - rustc_interface[47d454462fe60f57]::passes::analysis
  44:     0x7f77a3fa1435 - <rustc_query_system[a591ad4c8c400a0c]::dep_graph::graph::DepGraph<rustc_middle[aad4a7609f56511b]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[aad4a7609f56511b]::ty::context::TyCtxt, (), core[44a3ffd1a61ebe53]::result::Result<(), rustc_errors[a0d973d131a14c77]::ErrorGuaranteed>>
  45:     0x7f77a4045631 - rustc_query_system[a591ad4c8c400a0c]::query::plumbing::try_execute_query::<rustc_query_impl[e6add8203dd53821]::plumbing::QueryCtxt, rustc_query_system[a591ad4c8c400a0c]::query::caches::DefaultCache<(), core[44a3ffd1a61ebe53]::result::Result<(), rustc_errors[a0d973d131a14c77]::ErrorGuaranteed>>>
  46:     0x7f77a408684e - rustc_query_system[a591ad4c8c400a0c]::query::plumbing::get_query::<rustc_query_impl[e6add8203dd53821]::queries::analysis, rustc_query_impl[e6add8203dd53821]::plumbing::QueryCtxt>
  47:     0x7f77a3ad2ce7 - <rustc_interface[47d454462fe60f57]::passes::QueryContext>::enter::<rustc_driver[c9d212e03a1c949d]::run_compiler::{closure#1}::{closure#2}::{closure#3}, core[44a3ffd1a61ebe53]::result::Result<(), rustc_errors[a0d973d131a14c77]::ErrorGuaranteed>>
  48:     0x7f77a3abdde8 - <rustc_interface[47d454462fe60f57]::interface::Compiler>::enter::<rustc_driver[c9d212e03a1c949d]::run_compiler::{closure#1}::{closure#2}, core[44a3ffd1a61ebe53]::result::Result<core[44a3ffd1a61ebe53]::option::Option<rustc_interface[47d454462fe60f57]::queries::Linker>, rustc_errors[a0d973d131a14c77]::ErrorGuaranteed>>
  49:     0x7f77a3ae611f - rustc_span[ecd98705281d56d4]::with_source_map::<core[44a3ffd1a61ebe53]::result::Result<(), rustc_errors[a0d973d131a14c77]::ErrorGuaranteed>, rustc_interface[47d454462fe60f57]::interface::create_compiler_and_run<core[44a3ffd1a61ebe53]::result::Result<(), rustc_errors[a0d973d131a14c77]::ErrorGuaranteed>, rustc_driver[c9d212e03a1c949d]::run_compiler::{closure#1}>::{closure#1}>
  50:     0x7f77a3ad1cc4 - rustc_interface[47d454462fe60f57]::interface::create_compiler_and_run::<core[44a3ffd1a61ebe53]::result::Result<(), rustc_errors[a0d973d131a14c77]::ErrorGuaranteed>, rustc_driver[c9d212e03a1c949d]::run_compiler::{closure#1}>
  51:     0x7f77a3abc332 - <scoped_tls[aaf4f2c814811d14]::ScopedKey<rustc_span[ecd98705281d56d4]::SessionGlobals>>::set::<rustc_interface[47d454462fe60f57]::interface::run_compiler<core[44a3ffd1a61ebe53]::result::Result<(), rustc_errors[a0d973d131a14c77]::ErrorGuaranteed>, rustc_driver[c9d212e03a1c949d]::run_compiler::{closure#1}>::{closure#0}, core[44a3ffd1a61ebe53]::result::Result<(), rustc_errors[a0d973d131a14c77]::ErrorGuaranteed>>
  52:     0x7f77a3ad336f - std[a407a9638424a447]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[47d454462fe60f57]::util::run_in_thread_pool_with_globals<rustc_interface[47d454462fe60f57]::interface::run_compiler<core[44a3ffd1a61ebe53]::result::Result<(), rustc_errors[a0d973d131a14c77]::ErrorGuaranteed>, rustc_driver[c9d212e03a1c949d]::run_compiler::{closure#1}>::{closure#0}, core[44a3ffd1a61ebe53]::result::Result<(), rustc_errors[a0d973d131a14c77]::ErrorGuaranteed>>::{closure#0}, core[44a3ffd1a61ebe53]::result::Result<(), rustc_errors[a0d973d131a14c77]::ErrorGuaranteed>>
  53:     0x7f77a3ad34a9 - <<std[a407a9638424a447]::thread::Builder>::spawn_unchecked_<rustc_interface[47d454462fe60f57]::util::run_in_thread_pool_with_globals<rustc_interface[47d454462fe60f57]::interface::run_compiler<core[44a3ffd1a61ebe53]::result::Result<(), rustc_errors[a0d973d131a14c77]::ErrorGuaranteed>, rustc_driver[c9d212e03a1c949d]::run_compiler::{closure#1}>::{closure#0}, core[44a3ffd1a61ebe53]::result::Result<(), rustc_errors[a0d973d131a14c77]::ErrorGuaranteed>>::{closure#0}, core[44a3ffd1a61ebe53]::result::Result<(), rustc_errors[a0d973d131a14c77]::ErrorGuaranteed>>::{closure#1} as core[44a3ffd1a61ebe53]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  54:     0x7f77a129c3e3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h4c3dffc69477c539
                               at /rustc/30f386087564243ab88a93c984c265290a31580b/library/alloc/src/boxed.rs:1866:9
  55:     0x7f77a129c3e3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h15723c91dab076f8
                               at /rustc/30f386087564243ab88a93c984c265290a31580b/library/alloc/src/boxed.rs:1866:9
  56:     0x7f77a129c3e3 - std::sys::unix::thread::Thread::new::thread_start::h6d2d622e645998de
                               at /rustc/30f386087564243ab88a93c984c265290a31580b/library/std/src/sys/unix/thread.rs:108:17
  57:     0x7f77a11b1609 - start_thread
                               at /build/glibc-sMfBJT/glibc-2.31/nptl/pthread_create.c:477:8
  58:     0x7f77a10ca163 - clone
  59:                0x0 - <unknown>

error: internal compiler error: unexpected panic

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.62.0-nightly (30f386087 2022-05-05) running on x86_64-unknown-linux-gnu

note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental

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

query stack during panic:
#0 [typeck] type-checking `parse`
#1 [typeck_item_bodies] type-checking all item bodies
#2 [analysis] running analysis passes on this crate
end of query stack
error: internal compiler error: no warnings or errors encountered even though `delayed_good_path_bugs` issued

error: internal compiler error: trimmed_def_paths constructed
  |
  = note: delayed at    0: <rustc_errors::Handler>::delay_good_path_bug::<&str>
             1: rustc_middle::ty::print::pretty::trimmed_def_paths
             2: <rustc_middle::dep_graph::dep_node::DepKind as rustc_query_system::dep_graph::DepKind>::with_deps::<<rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_task_impl<rustc_middle::ty::context::TyCtxt, (), std::collections::hash::map::HashMap<rustc_span::def_id::DefId, rustc_span::symbol::Symbol, core::hash::BuildHasherDefault<rustc_hash::FxHasher>>>::{closure#0}, std::collections::hash::map::HashMap<rustc_span::def_id::DefId, rustc_span::symbol::Symbol, core::hash::BuildHasherDefault<rustc_hash::FxHasher>>>
             3: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle::ty::context::TyCtxt, (), std::collections::hash::map::HashMap<rustc_span::def_id::DefId, rustc_span::symbol::Symbol, core::hash::BuildHasherDefault<rustc_hash::FxHasher>>>
             4: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::plumbing::QueryCtxt, rustc_query_system::query::caches::ArenaCache<(), std::collections::hash::map::HashMap<rustc_span::def_id::DefId, rustc_span::symbol::Symbol, core::hash::BuildHasherDefault<rustc_hash::FxHasher>>>>
             5: rustc_query_system::query::plumbing::get_query::<rustc_query_impl::queries::trimmed_def_paths, rustc_query_impl::plumbing::QueryCtxt>
             6: <rustc_middle::ty::print::pretty::FmtPrinter as rustc_middle::ty::print::Printer>::print_def_path
             7: <rustc_middle::ty::print::pretty::FmtPrinter as rustc_middle::ty::print::Printer>::default_print_def_path
             8: <rustc_middle::ty::print::pretty::FmtPrinter as rustc_middle::ty::print::Printer>::print_def_path
             9: <rustc_middle::ty::print::pretty::FmtPrinter as rustc_middle::ty::print::pretty::PrettyPrinter>::pretty_print_type
            10: <rustc_middle::ty::print::pretty::FmtPrinter as rustc_middle::ty::print::pretty::PrettyPrinter>::comma_sep::<rustc_middle::ty::Ty, core::iter::adapters::copied::Copied<core::slice::iter::Iter<rustc_middle::ty::Ty>>>
            11: <rustc_middle::ty::print::pretty::FmtPrinter as rustc_middle::ty::print::pretty::PrettyPrinter>::pretty_fn_sig
            12: <rustc_middle::ty::sty::FnSig as rustc_middle::ty::print::Print<rustc_middle::ty::print::pretty::FmtPrinter>>::print
            13: <rustc_middle::ty::print::pretty::FmtPrinter as rustc_middle::ty::print::pretty::PrettyPrinter>::in_binder::<rustc_middle::ty::sty::FnSig>
            14: <rustc_middle::ty::print::pretty::FmtPrinter as rustc_middle::ty::print::pretty::PrettyPrinter>::pretty_print_type
            15: <rustc_middle::ty::Ty as core::fmt::Display>::fmt
            16: <rustc_infer::infer::InferCtxt>::ty_to_string
            17: <rustc_typeck::check::fn_ctxt::FnCtxt>::report_method_error
            18: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_kind
            19: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_argument_types
            20: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_kind
            21: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_with_expectation
            22: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_stmt
            23: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_block_with_expected
            24: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_kind
            25: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_with_expectation
            26: rustc_typeck::check::check::check_fn
            27: <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}>
            28: rustc_typeck::check::typeck
            29: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle::ty::context::TyCtxt, rustc_span::def_id::LocalDefId, &rustc_middle::ty::context::TypeckResults>
            30: 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>>
            31: rustc_query_system::query::plumbing::force_query::<rustc_query_impl::queries::typeck, rustc_query_impl::plumbing::QueryCtxt>
            32: rustc_query_impl::query_callbacks::typeck::force_from_dep_node
            33: <rustc_middle::ty::context::TyCtxt as rustc_query_system::dep_graph::DepContext>::try_force_from_dep_node
            34: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
            35: rustc_query_system::query::plumbing::ensure_must_run::<rustc_query_impl::plumbing::QueryCtxt, rustc_span::def_id::LocalDefId, &rustc_middle::mir::query::UnsafetyCheckResult>
            36: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::typeck
            37: <rustc_middle::hir::map::Map>::par_body_owners::<rustc_typeck::check::typeck_item_bodies::{closure#0}>
            38: rustc_typeck::check::typeck_item_bodies
            39: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle::ty::context::TyCtxt, (), ()>
            40: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::plumbing::QueryCtxt, rustc_query_system::query::caches::DefaultCache<(), ()>>
            41: rustc_query_system::query::plumbing::get_query::<rustc_query_impl::queries::typeck_item_bodies, rustc_query_impl::plumbing::QueryCtxt>
            42: <rustc_session::session::Session>::time::<(), rustc_typeck::check_crate::{closure#7}>
            43: rustc_typeck::check_crate
            44: rustc_interface::passes::analysis
            45: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle::ty::context::TyCtxt, (), core::result::Result<(), rustc_errors::ErrorGuaranteed>>
            46: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::plumbing::QueryCtxt, rustc_query_system::query::caches::DefaultCache<(), core::result::Result<(), rustc_errors::ErrorGuaranteed>>>
            47: rustc_query_system::query::plumbing::get_query::<rustc_query_impl::queries::analysis, rustc_query_impl::plumbing::QueryCtxt>
            48: <rustc_interface::passes::QueryContext>::enter::<rustc_driver::run_compiler::{closure#1}::{closure#2}::{closure#3}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>
            49: <rustc_interface::interface::Compiler>::enter::<rustc_driver::run_compiler::{closure#1}::{closure#2}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_errors::ErrorGuaranteed>>
            50: rustc_span::with_source_map::<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_interface::interface::create_compiler_and_run<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>::{closure#1}>
            51: rustc_interface::interface::create_compiler_and_run::<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>
            52: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>
            53: std::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>
            54: <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
            55: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                       at /rustc/30f386087564243ab88a93c984c265290a31580b/library/alloc/src/boxed.rs:1866:9
            56: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                       at /rustc/30f386087564243ab88a93c984c265290a31580b/library/alloc/src/boxed.rs:1866:9
            57: std::sys::unix::thread::Thread::new::thread_start
                       at /rustc/30f386087564243ab88a93c984c265290a31580b/library/std/src/sys/unix/thread.rs:108:17
            58: start_thread
                       at /build/glibc-sMfBJT/glibc-2.31/nptl/pthread_create.c:477:8
            59: clone
          

thread 'rustc' panicked at 'Box<dyn Any>', compiler/rustc_errors/src/lib.rs:1358:13
stack backtrace:
   0:     0x7f77a128efad - std::backtrace_rs::backtrace::libunwind::trace::h7991ec96ab4c54d4
                               at /rustc/30f386087564243ab88a93c984c265290a31580b/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f77a128efad - std::backtrace_rs::backtrace::trace_unsynchronized::h18b7a321bd5fc0be
                               at /rustc/30f386087564243ab88a93c984c265290a31580b/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f77a128efad - std::sys_common::backtrace::_print_fmt::h3ce334712315b3b3
                               at /rustc/30f386087564243ab88a93c984c265290a31580b/library/std/src/sys_common/backtrace.rs:66:5
   3:     0x7f77a128efad - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h9fe3cb3617616bb1
                               at /rustc/30f386087564243ab88a93c984c265290a31580b/library/std/src/sys_common/backtrace.rs:45:22
   4:     0x7f77a12eacec - core::fmt::write::h3467ff15bc25f01c
                               at /rustc/30f386087564243ab88a93c984c265290a31580b/library/core/src/fmt/mod.rs:1194:17
   5:     0x7f77a12806a1 - std::io::Write::write_fmt::h27e7b97a23eeefb1
                               at /rustc/30f386087564243ab88a93c984c265290a31580b/library/std/src/io/mod.rs:1655:15
   6:     0x7f77a1291cc5 - std::sys_common::backtrace::_print::h31df922f8c433d5d
                               at /rustc/30f386087564243ab88a93c984c265290a31580b/library/std/src/sys_common/backtrace.rs:48:5
   7:     0x7f77a1291cc5 - std::sys_common::backtrace::print::hbb7030c9dcb3d932
                               at /rustc/30f386087564243ab88a93c984c265290a31580b/library/std/src/sys_common/backtrace.rs:35:9
   8:     0x7f77a1291cc5 - std::panicking::default_hook::{{closure}}::hfbd0333e3bf0a7f2
                               at /rustc/30f386087564243ab88a93c984c265290a31580b/library/std/src/panicking.rs:295:22
   9:     0x7f77a1291939 - std::panicking::default_hook::h3b718975ac1f8c21
                               at /rustc/30f386087564243ab88a93c984c265290a31580b/library/std/src/panicking.rs:314:9
  10:     0x7f77a1a54301 - rustc_driver[c9d212e03a1c949d]::DEFAULT_HOOK::{closure#0}::{closure#0}
  11:     0x7f77a1292496 - std::panicking::rust_panic_with_hook::h6a0399740ae00003
                               at /rustc/30f386087564243ab88a93c984c265290a31580b/library/std/src/panicking.rs:702:17
  12:     0x7f77a2bc74f1 - std[a407a9638424a447]::panicking::begin_panic::<rustc_errors[a0d973d131a14c77]::ExplicitBug>::{closure#0}
  13:     0x7f77a2bc7406 - std[a407a9638424a447]::sys_common::backtrace::__rust_end_short_backtrace::<std[a407a9638424a447]::panicking::begin_panic<rustc_errors[a0d973d131a14c77]::ExplicitBug>::{closure#0}, !>
  14:     0x7f77a2bcb126 - std[a407a9638424a447]::panicking::begin_panic::<rustc_errors[a0d973d131a14c77]::ExplicitBug>
  15:     0x7f77a2bcf1c6 - std[a407a9638424a447]::panic::panic_any::<rustc_errors[a0d973d131a14c77]::ExplicitBug>
  16:     0x7f77a4389ab7 - <rustc_errors[a0d973d131a14c77]::HandlerInner as core[44a3ffd1a61ebe53]::ops::drop::Drop>::drop
  17:     0x7f77a3ae7608 - core[44a3ffd1a61ebe53]::ptr::drop_in_place::<rustc_session[84587541edc70f60]::parse::ParseSess>
  18:     0x7f77a3ae9f93 - <alloc[2132930d12e8f725]::rc::Rc<rustc_session[84587541edc70f60]::session::Session> as core[44a3ffd1a61ebe53]::ops::drop::Drop>::drop
  19:     0x7f77a3ae691d - core[44a3ffd1a61ebe53]::ptr::drop_in_place::<rustc_interface[47d454462fe60f57]::interface::Compiler>
  20:     0x7f77a3ae679f - rustc_span[ecd98705281d56d4]::with_source_map::<core[44a3ffd1a61ebe53]::result::Result<(), rustc_errors[a0d973d131a14c77]::ErrorGuaranteed>, rustc_interface[47d454462fe60f57]::interface::create_compiler_and_run<core[44a3ffd1a61ebe53]::result::Result<(), rustc_errors[a0d973d131a14c77]::ErrorGuaranteed>, rustc_driver[c9d212e03a1c949d]::run_compiler::{closure#1}>::{closure#1}>
  21:     0x7f77a3ad1cc4 - rustc_interface[47d454462fe60f57]::interface::create_compiler_and_run::<core[44a3ffd1a61ebe53]::result::Result<(), rustc_errors[a0d973d131a14c77]::ErrorGuaranteed>, rustc_driver[c9d212e03a1c949d]::run_compiler::{closure#1}>
  22:     0x7f77a3abc332 - <scoped_tls[aaf4f2c814811d14]::ScopedKey<rustc_span[ecd98705281d56d4]::SessionGlobals>>::set::<rustc_interface[47d454462fe60f57]::interface::run_compiler<core[44a3ffd1a61ebe53]::result::Result<(), rustc_errors[a0d973d131a14c77]::ErrorGuaranteed>, rustc_driver[c9d212e03a1c949d]::run_compiler::{closure#1}>::{closure#0}, core[44a3ffd1a61ebe53]::result::Result<(), rustc_errors[a0d973d131a14c77]::ErrorGuaranteed>>
  23:     0x7f77a3ad336f - std[a407a9638424a447]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[47d454462fe60f57]::util::run_in_thread_pool_with_globals<rustc_interface[47d454462fe60f57]::interface::run_compiler<core[44a3ffd1a61ebe53]::result::Result<(), rustc_errors[a0d973d131a14c77]::ErrorGuaranteed>, rustc_driver[c9d212e03a1c949d]::run_compiler::{closure#1}>::{closure#0}, core[44a3ffd1a61ebe53]::result::Result<(), rustc_errors[a0d973d131a14c77]::ErrorGuaranteed>>::{closure#0}, core[44a3ffd1a61ebe53]::result::Result<(), rustc_errors[a0d973d131a14c77]::ErrorGuaranteed>>
  24:     0x7f77a3ad34a9 - <<std[a407a9638424a447]::thread::Builder>::spawn_unchecked_<rustc_interface[47d454462fe60f57]::util::run_in_thread_pool_with_globals<rustc_interface[47d454462fe60f57]::interface::run_compiler<core[44a3ffd1a61ebe53]::result::Result<(), rustc_errors[a0d973d131a14c77]::ErrorGuaranteed>, rustc_driver[c9d212e03a1c949d]::run_compiler::{closure#1}>::{closure#0}, core[44a3ffd1a61ebe53]::result::Result<(), rustc_errors[a0d973d131a14c77]::ErrorGuaranteed>>::{closure#0}, core[44a3ffd1a61ebe53]::result::Result<(), rustc_errors[a0d973d131a14c77]::ErrorGuaranteed>>::{closure#1} as core[44a3ffd1a61ebe53]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  25:     0x7f77a129c3e3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h4c3dffc69477c539
                               at /rustc/30f386087564243ab88a93c984c265290a31580b/library/alloc/src/boxed.rs:1866:9
  26:     0x7f77a129c3e3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h15723c91dab076f8
                               at /rustc/30f386087564243ab88a93c984c265290a31580b/library/alloc/src/boxed.rs:1866:9
  27:     0x7f77a129c3e3 - std::sys::unix::thread::Thread::new::thread_start::h6d2d622e645998de
                               at /rustc/30f386087564243ab88a93c984c265290a31580b/library/std/src/sys/unix/thread.rs:108:17
  28:     0x7f77a11b1609 - start_thread
                               at /build/glibc-sMfBJT/glibc-2.31/nptl/pthread_create.c:477:8
  29:     0x7f77a10ca163 - clone
  30:                0x0 - <unknown>
@SephVelut SephVelut added C-bug Category: This is a bug. 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. labels May 7, 2022
@JohnTitor
Copy link
Member

Should be a duplicate of #96738.

@JohnTitor
Copy link
Member

@SephVelut Could you try using the latest nightly?

@SephVelut
Copy link
Author

@JohnTitor Looks fixed with compile error now on latest.

error[E0599]: no method named `unwrap` found for fn item `fn(Vec<u8>) -> Result<String, FromUtf8Error> {String::from_utf8}` in the current scope
  --> src/lib.rs:83:71
   |
83 |     let spec_name = (-uppercase_char * ident).map((String::from_utf8).unwrap());
   |                                                   ------------------- ^^^^^^ method not found in `fn(Vec<u8>) -> Result<String, FromUtf8Error> {String::from_utf8}`
   |                                                   |
   |                                                   this is a function, perhaps you wish to call it

For more information about this error, try `rustc --explain E0599`.
error: could not compile `configurator` due to previous error

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) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

2 participants