Skip to content

Bug? attempted to read from stolen value: rustc_middle::mir::Body #100170

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

Closed
schneiderfelipe opened this issue Aug 5, 2022 · 4 comments
Closed
Labels
C-bug Category: This is a bug. E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example 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

@schneiderfelipe
Copy link

I can't currently provide the code, but the rest of the information is below.
I'll try to provide a minimal example when I'm able to.

Please let me know if there's anything else I can do to help (this is my first bug report to this repo).

Meta

rustc --version --verbose:

rustc 1.62.1 (e092d0b6b 2022-07-16)
binary: rustc
commit-hash: e092d0b6b43f2de967af0887873151bb1c0b18d3
commit-date: 2022-07-16
host: x86_64-unknown-linux-gnu
release: 1.62.1
LLVM version: 14.0.5

Error output

$ cargo test
   Compiling iodine v0.1.0 (/home/schneider/Dropbox/iodine/iodine)

...

thread 'rustc' panicked at 'attempted to read from stolen value: rustc_middle::mir::Body', compiler/rustc_mir_transform/src/check_unsafety.rs:517:36
stack backtrace:
   0:     0x7fcb3e49dfbd - std::backtrace_rs::backtrace::libunwind::trace::h8e036432725b1c57
                               at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7fcb3e49dfbd - std::backtrace_rs::backtrace::trace_unsynchronized::h4f83092254c85869
                               at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7fcb3e49dfbd - std::sys_common::backtrace::_print_fmt::h9728b5e056a3ece3
                               at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/sys_common/backtrace.rs:66:5
   3:     0x7fcb3e49dfbd - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h48bb4bd2928827d2
                               at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/sys_common/backtrace.rs:45:22
   4:     0x7fcb3e4f9c4c - core::fmt::write::h909e69a2c24f44cc
                               at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/core/src/fmt/mod.rs:1196:17
   5:     0x7fcb3e48f731 - std::io::Write::write_fmt::h7f4b8ab8af89e9ef
                               at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/io/mod.rs:1654:15
   6:     0x7fcb3e4a0cd5 - std::sys_common::backtrace::_print::hff4838ebf14a2171
                               at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/sys_common/backtrace.rs:48:5
   7:     0x7fcb3e4a0cd5 - std::sys_common::backtrace::print::h2499280374189ad9
                               at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/sys_common/backtrace.rs:35:9
   8:     0x7fcb3e4a0cd5 - std::panicking::default_hook::{{closure}}::h8b270fc55eeb284e
                               at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panicking.rs:295:22
   9:     0x7fcb3e4a0949 - std::panicking::default_hook::h3217e229d6e9d13c
                               at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panicking.rs:314:9
  10:     0x7fcb3ece9571 - rustc_driver[b4654d3c4d4292dd]::DEFAULT_HOOK::{closure#0}::{closure#0}
  11:     0x7fcb2fec5363 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::hcd0b259b682f74e2
                               at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/alloc/src/boxed.rs:1886:9
  12:     0x7fcb2febecbd - proc_macro::bridge::client::<impl proc_macro::bridge::Bridge>::enter::{{closure}}::{{closure}}::h1d53703338e8bcbd
                               at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/proc_macro/src/bridge/client.rs:335:21
  13:     0x7fcb3e4a14a6 - std::panicking::rust_panic_with_hook::h9acb8048b738d2e0
                               at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panicking.rs:702:17
  14:     0x7fcb3e4a12a7 - std::panicking::begin_panic_handler::{{closure}}::h70f3b839526af6dc
                               at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panicking.rs:588:13
  15:     0x7fcb3e49e474 - std::sys_common::backtrace::__rust_end_short_backtrace::h1ecf2cee857fbe0a
                               at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/sys_common/backtrace.rs:138:18
  16:     0x7fcb3e4a0fd9 - rust_begin_unwind
                               at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panicking.rs:584:5
  17:     0x7fcb3e466253 - core::panicking::panic_fmt::h9f8393e7fd56d655
                               at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/core/src/panicking.rs:142:14
  18:     0x7fcb401361ff - rustc_mir_transform[fea6be209b04bad0]::check_unsafety::unsafety_check_result
  19:     0x7fcb4012d5a0 - <rustc_mir_transform[fea6be209b04bad0]::check_unsafety::provide::{closure#0} as core[dbea6f494faa966e]::ops::function::FnOnce<(rustc_middle[74ddc95a19f9493f]::ty::context::TyCtxt, rustc_span[1d0b4d44d1f53955]::def_id::LocalDefId)>>::call_once
  20:     0x7fcb3f5c6d9b - <rustc_middle[74ddc95a19f9493f]::dep_graph::dep_node::DepKind as rustc_query_system[b4bd2ce220f7e42d]::dep_graph::DepKind>::with_deps::<rustc_query_system[b4bd2ce220f7e42d]::query::plumbing::try_load_from_disk_and_cache_in_memory<rustc_query_impl[4e222bcb6a32466d]::plumbing::QueryCtxt, rustc_span[1d0b4d44d1f53955]::def_id::LocalDefId, &rustc_middle[74ddc95a19f9493f]::mir::query::UnsafetyCheckResult>::{closure#1}, &rustc_middle[74ddc95a19f9493f]::mir::query::UnsafetyCheckResult>
  21:     0x7fcb412f4270 - rustc_query_system[b4bd2ce220f7e42d]::query::plumbing::try_load_from_disk_and_cache_in_memory::<rustc_query_impl[4e222bcb6a32466d]::plumbing::QueryCtxt, rustc_span[1d0b4d44d1f53955]::def_id::LocalDefId, &rustc_middle[74ddc95a19f9493f]::mir::query::UnsafetyCheckResult>
  22:     0x7fcb407b4f36 - rustc_query_system[b4bd2ce220f7e42d]::query::plumbing::try_execute_query::<rustc_query_impl[4e222bcb6a32466d]::plumbing::QueryCtxt, rustc_query_system[b4bd2ce220f7e42d]::query::caches::DefaultCache<rustc_span[1d0b4d44d1f53955]::def_id::LocalDefId, &rustc_middle[74ddc95a19f9493f]::mir::query::UnsafetyCheckResult>>
  23:     0x7fcb4077e68e - <rustc_query_impl[4e222bcb6a32466d]::Queries as rustc_middle[74ddc95a19f9493f]::ty::query::QueryEngine>::unsafety_check_result
  24:     0x7fcb4013dc2b - rustc_mir_transform[fea6be209b04bad0]::check_unsafety::check_unsafety
  25:     0x7fcb3ffc8408 - <rustc_session[a2f3190f51a45935]::session::Session>::time::<(), rustc_interface[9f664daa3237129]::passes::analysis::{closure#3}>
  26:     0x7fcb40d86fdc - rustc_interface[9f664daa3237129]::passes::analysis
  27:     0x7fcb41233185 - <rustc_query_system[b4bd2ce220f7e42d]::dep_graph::graph::DepGraph<rustc_middle[74ddc95a19f9493f]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[74ddc95a19f9493f]::ty::context::TyCtxt, (), core[dbea6f494faa966e]::result::Result<(), rustc_errors[4633ef6e4608f9c1]::ErrorGuaranteed>>
  28:     0x7fcb412d85c1 - rustc_query_system[b4bd2ce220f7e42d]::query::plumbing::try_execute_query::<rustc_query_impl[4e222bcb6a32466d]::plumbing::QueryCtxt, rustc_query_system[b4bd2ce220f7e42d]::query::caches::DefaultCache<(), core[dbea6f494faa966e]::result::Result<(), rustc_errors[4633ef6e4608f9c1]::ErrorGuaranteed>>>
  29:     0x7fcb413198ce - rustc_query_system[b4bd2ce220f7e42d]::query::plumbing::get_query::<rustc_query_impl[4e222bcb6a32466d]::queries::analysis, rustc_query_impl[4e222bcb6a32466d]::plumbing::QueryCtxt>
  30:     0x7fcb40d67777 - <rustc_interface[9f664daa3237129]::passes::QueryContext>::enter::<rustc_driver[b4654d3c4d4292dd]::run_compiler::{closure#1}::{closure#2}::{closure#3}, core[dbea6f494faa966e]::result::Result<(), rustc_errors[4633ef6e4608f9c1]::ErrorGuaranteed>>
  31:     0x7fcb40d52708 - <rustc_interface[9f664daa3237129]::interface::Compiler>::enter::<rustc_driver[b4654d3c4d4292dd]::run_compiler::{closure#1}::{closure#2}, core[dbea6f494faa966e]::result::Result<core[dbea6f494faa966e]::option::Option<rustc_interface[9f664daa3237129]::queries::Linker>, rustc_errors[4633ef6e4608f9c1]::ErrorGuaranteed>>
  32:     0x7fcb40d7b09f - rustc_span[1d0b4d44d1f53955]::with_source_map::<core[dbea6f494faa966e]::result::Result<(), rustc_errors[4633ef6e4608f9c1]::ErrorGuaranteed>, rustc_interface[9f664daa3237129]::interface::create_compiler_and_run<core[dbea6f494faa966e]::result::Result<(), rustc_errors[4633ef6e4608f9c1]::ErrorGuaranteed>, rustc_driver[b4654d3c4d4292dd]::run_compiler::{closure#1}>::{closure#1}>
  33:     0x7fcb40d53374 - rustc_interface[9f664daa3237129]::interface::create_compiler_and_run::<core[dbea6f494faa966e]::result::Result<(), rustc_errors[4633ef6e4608f9c1]::ErrorGuaranteed>, rustc_driver[b4654d3c4d4292dd]::run_compiler::{closure#1}>
  34:     0x7fcb40d50c12 - <scoped_tls[ab1554bfb6e7ab15]::ScopedKey<rustc_span[1d0b4d44d1f53955]::SessionGlobals>>::set::<rustc_interface[9f664daa3237129]::interface::run_compiler<core[dbea6f494faa966e]::result::Result<(), rustc_errors[4633ef6e4608f9c1]::ErrorGuaranteed>, rustc_driver[b4654d3c4d4292dd]::run_compiler::{closure#1}>::{closure#0}, core[dbea6f494faa966e]::result::Result<(), rustc_errors[4633ef6e4608f9c1]::ErrorGuaranteed>>
  35:     0x7fcb40d67dff - std[8996aeeb2a45fe64]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[9f664daa3237129]::util::run_in_thread_pool_with_globals<rustc_interface[9f664daa3237129]::interface::run_compiler<core[dbea6f494faa966e]::result::Result<(), rustc_errors[4633ef6e4608f9c1]::ErrorGuaranteed>, rustc_driver[b4654d3c4d4292dd]::run_compiler::{closure#1}>::{closure#0}, core[dbea6f494faa966e]::result::Result<(), rustc_errors[4633ef6e4608f9c1]::ErrorGuaranteed>>::{closure#0}, core[dbea6f494faa966e]::result::Result<(), rustc_errors[4633ef6e4608f9c1]::ErrorGuaranteed>>
  36:     0x7fcb40d67f39 - <<std[8996aeeb2a45fe64]::thread::Builder>::spawn_unchecked_<rustc_interface[9f664daa3237129]::util::run_in_thread_pool_with_globals<rustc_interface[9f664daa3237129]::interface::run_compiler<core[dbea6f494faa966e]::result::Result<(), rustc_errors[4633ef6e4608f9c1]::ErrorGuaranteed>, rustc_driver[b4654d3c4d4292dd]::run_compiler::{closure#1}>::{closure#0}, core[dbea6f494faa966e]::result::Result<(), rustc_errors[4633ef6e4608f9c1]::ErrorGuaranteed>>::{closure#0}, core[dbea6f494faa966e]::result::Result<(), rustc_errors[4633ef6e4608f9c1]::ErrorGuaranteed>>::{closure#1} as core[dbea6f494faa966e]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  37:     0x7fcb3e4ab3c3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h191d5c5ea3edb31d
                               at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/alloc/src/boxed.rs:1872:9
  38:     0x7fcb3e4ab3c3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h42ef7cb2ae640a31
                               at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/alloc/src/boxed.rs:1872:9
  39:     0x7fcb3e4ab3c3 - std::sys::unix::thread::Thread::new::thread_start::he47f7169665dab60
                               at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/sys/unix/thread.rs:108:17
thread 'rustc' panicked at 'attempted to read from stolen value: rustc_middle::mir::Body', compiler/rustc_mir_transform/src/check_unsafety.rs:517:36
stack backtrace:
   0:     0x7fc7c229dfbd - std::backtrace_rs::backtrace::libunwind::trace::h8e036432725b1c57
                               at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7fc7c229dfbd - std::backtrace_rs::backtrace::trace_unsynchronized::h4f83092254c85869
                               at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7fc7c229dfbd - std::sys_common::backtrace::_print_fmt::h9728b5e056a3ece3
                               at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/sys_common/backtrace.rs:66:5
   3:     0x7fc7c229dfbd - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h48bb4bd2928827d2
                               at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/sys_common/backtrace.rs:45:22
   4:     0x7fc7c22f9c4c - core::fmt::write::h909e69a2c24f44cc
                               at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/core/src/fmt/mod.rs:1196:17
   5:     0x7fc7c228f731 - std::io::Write::write_fmt::h7f4b8ab8af89e9ef
                               at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/io/mod.rs:1654:15
   6:     0x7fc7c22a0cd5 - std::sys_common::backtrace::_print::hff4838ebf14a2171
                               at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/sys_common/backtrace.rs:48:5
   7:     0x7fc7c22a0cd5 - std::sys_common::backtrace::print::h2499280374189ad9
                               at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/sys_common/backtrace.rs:35:9
   8:     0x7fc7c22a0cd5 - std::panicking::default_hook::{{closure}}::h8b270fc55eeb284e
                               at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panicking.rs:295:22
   9:     0x7fc7c22a0949 - std::panicking::default_hook::h3217e229d6e9d13c
                               at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panicking.rs:314:9
  10:     0x7fc7c2ae9571 - rustc_driver[b4654d3c4d4292dd]::DEFAULT_HOOK::{closure#0}::{closure#0}
  11:     0x7fc7b3a7e363 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::hcd0b259b682f74e2
                               at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/alloc/src/boxed.rs:1886:9
  12:     0x7fc7b3a77cbd - proc_macro::bridge::client::<impl proc_macro::bridge::Bridge>::enter::{{closure}}::{{closure}}::h1d53703338e8bcbd
                               at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/proc_macro/src/bridge/client.rs:335:21
  13:     0x7fc7c22a14a6 - std::panicking::rust_panic_with_hook::h9acb8048b738d2e0
                               at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panicking.rs:702:17
  14:     0x7fc7c22a12a7 - std::panicking::begin_panic_handler::{{closure}}::h70f3b839526af6dc
                               at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panicking.rs:588:13
  15:     0x7fc7c229e474 - std::sys_common::backtrace::__rust_end_short_backtrace::h1ecf2cee857fbe0a
                               at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/sys_common/backtrace.rs:138:18
  16:     0x7fc7c22a0fd9 - rust_begin_unwind
                               at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panicking.rs:584:5
  17:     0x7fc7c2266253 - core::panicking::panic_fmt::h9f8393e7fd56d655
                               at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/core/src/panicking.rs:142:14
  18:     0x7fc7c3f361ff - rustc_mir_transform[fea6be209b04bad0]::check_unsafety::unsafety_check_result
  19:     0x7fc7c3f2d5a0 - <rustc_mir_transform[fea6be209b04bad0]::check_unsafety::provide::{closure#0} as core[dbea6f494faa966e]::ops::function::FnOnce<(rustc_middle[74ddc95a19f9493f]::ty::context::TyCtxt, rustc_span[1d0b4d44d1f53955]::def_id::LocalDefId)>>::call_once
  20:     0x7fc7c33c6d9b - <rustc_middle[74ddc95a19f9493f]::dep_graph::dep_node::DepKind as rustc_query_system[b4bd2ce220f7e42d]::dep_graph::DepKind>::with_deps::<rustc_query_system[b4bd2ce220f7e42d]::query::plumbing::try_load_from_disk_and_cache_in_memory<rustc_query_impl[4e222bcb6a32466d]::plumbing::QueryCtxt, rustc_span[1d0b4d44d1f53955]::def_id::LocalDefId, &rustc_middle[74ddc95a19f9493f]::mir::query::UnsafetyCheckResult>::{closure#1}, &rustc_middle[74ddc95a19f9493f]::mir::query::UnsafetyCheckResult>
  21:     0x7fc7c50f4270 - rustc_query_system[b4bd2ce220f7e42d]::query::plumbing::try_load_from_disk_and_cache_in_memory::<rustc_query_impl[4e222bcb6a32466d]::plumbing::QueryCtxt, rustc_span[1d0b4d44d1f53955]::def_id::LocalDefId, &rustc_middle[74ddc95a19f9493f]::mir::query::UnsafetyCheckResult>
  22:     0x7fc7c45b4f36 - rustc_query_system[b4bd2ce220f7e42d]::query::plumbing::try_execute_query::<rustc_query_impl[4e222bcb6a32466d]::plumbing::QueryCtxt, rustc_query_system[b4bd2ce220f7e42d]::query::caches::DefaultCache<rustc_span[1d0b4d44d1f53955]::def_id::LocalDefId, &rustc_middle[74ddc95a19f9493f]::mir::query::UnsafetyCheckResult>>
  23:     0x7fc7c457e68e - <rustc_query_impl[4e222bcb6a32466d]::Queries as rustc_middle[74ddc95a19f9493f]::ty::query::QueryEngine>::unsafety_check_result
  24:     0x7fc7c3f3dc2b - rustc_mir_transform[fea6be209b04bad0]::check_unsafety::check_unsafety
  25:     0x7fc7c3dc8408 - <rustc_session[a2f3190f51a45935]::session::Session>::time::<(), rustc_interface[9f664daa3237129]::passes::analysis::{closure#3}>
  26:     0x7fc7c4b86fdc - rustc_interface[9f664daa3237129]::passes::analysis
  27:     0x7fc7c5033185 - <rustc_query_system[b4bd2ce220f7e42d]::dep_graph::graph::DepGraph<rustc_middle[74ddc95a19f9493f]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[74ddc95a19f9493f]::ty::context::TyCtxt, (), core[dbea6f494faa966e]::result::Result<(), rustc_errors[4633ef6e4608f9c1]::ErrorGuaranteed>>
  28:     0x7fc7c50d85c1 - rustc_query_system[b4bd2ce220f7e42d]::query::plumbing::try_execute_query::<rustc_query_impl[4e222bcb6a32466d]::plumbing::QueryCtxt, rustc_query_system[b4bd2ce220f7e42d]::query::caches::DefaultCache<(), core[dbea6f494faa966e]::result::Result<(), rustc_errors[4633ef6e4608f9c1]::ErrorGuaranteed>>>
  29:     0x7fc7c51198ce - rustc_query_system[b4bd2ce220f7e42d]::query::plumbing::get_query::<rustc_query_impl[4e222bcb6a32466d]::queries::analysis, rustc_query_impl[4e222bcb6a32466d]::plumbing::QueryCtxt>
  30:     0x7fc7c4b67777 - <rustc_interface[9f664daa3237129]::passes::QueryContext>::enter::<rustc_driver[b4654d3c4d4292dd]::run_compiler::{closure#1}::{closure#2}::{closure#3}, core[dbea6f494faa966e]::result::Result<(), rustc_errors[4633ef6e4608f9c1]::ErrorGuaranteed>>
  31:     0x7fc7c4b52708 - <rustc_interface[9f664daa3237129]::interface::Compiler>::enter::<rustc_driver[b4654d3c4d4292dd]::run_compiler::{closure#1}::{closure#2}, core[dbea6f494faa966e]::result::Result<core[dbea6f494faa966e]::option::Option<rustc_interface[9f664daa3237129]::queries::Linker>, rustc_errors[4633ef6e4608f9c1]::ErrorGuaranteed>>
  32:     0x7fc7c4b7b09f - rustc_span[1d0b4d44d1f53955]::with_source_map::<core[dbea6f494faa966e]::result::Result<(), rustc_errors[4633ef6e4608f9c1]::ErrorGuaranteed>, rustc_interface[9f664daa3237129]::interface::create_compiler_and_run<core[dbea6f494faa966e]::result::Result<(), rustc_errors[4633ef6e4608f9c1]::ErrorGuaranteed>, rustc_driver[b4654d3c4d4292dd]::run_compiler::{closure#1}>::{closure#1}>
  33:     0x7fc7c4b53374 - rustc_interface[9f664daa3237129]::interface::create_compiler_and_run::<core[dbea6f494faa966e]::result::Result<(), rustc_errors[4633ef6e4608f9c1]::ErrorGuaranteed>, rustc_driver[b4654d3c4d4292dd]::run_compiler::{closure#1}>
  34:     0x7fc7c4b50c12 - <scoped_tls[ab1554bfb6e7ab15]::ScopedKey<rustc_span[1d0b4d44d1f53955]::SessionGlobals>>::set::<rustc_interface[9f664daa3237129]::interface::run_compiler<core[dbea6f494faa966e]::result::Result<(), rustc_errors[4633ef6e4608f9c1]::ErrorGuaranteed>, rustc_driver[b4654d3c4d4292dd]::run_compiler::{closure#1}>::{closure#0}, core[dbea6f494faa966e]::result::Result<(), rustc_errors[4633ef6e4608f9c1]::ErrorGuaranteed>>
  35:     0x7fc7c4b67dff - std[8996aeeb2a45fe64]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[9f664daa3237129]::util::run_in_thread_pool_with_globals<rustc_interface[9f664daa3237129]::interface::run_compiler<core[dbea6f494faa966e]::result::Result<(), rustc_errors[4633ef6e4608f9c1]::ErrorGuaranteed>, rustc_driver[b4654d3c4d4292dd]::run_compiler::{closure#1}>::{closure#0}, core[dbea6f494faa966e]::result::Result<(), rustc_errors[4633ef6e4608f9c1]::ErrorGuaranteed>>::{closure#0}, core[dbea6f494faa966e]::result::Result<(), rustc_errors[4633ef6e4608f9c1]::ErrorGuaranteed>>
  36:     0x7fc7c4b67f39 - <<std[8996aeeb2a45fe64]::thread::Builder>::spawn_unchecked_<rustc_interface[9f664daa3237129]::util::run_in_thread_pool_with_globals<rustc_interface[9f664daa3237129]::interface::run_compiler<core[dbea6f494faa966e]::result::Result<(), rustc_errors[4633ef6e4608f9c1]::ErrorGuaranteed>, rustc_driver[b4654d3c4d4292dd]::run_compiler::{closure#1}>::{closure#0}, core[dbea6f494faa966e]::result::Result<(), rustc_errors[4633ef6e4608f9c1]::ErrorGuaranteed>>::{closure#0}, core[dbea6f494faa966e]::result::Result<(), rustc_errors[4633ef6e4608f9c1]::ErrorGuaranteed>>::{closure#1} as core[dbea6f494faa966e]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  37:     0x7fc7c22ab3c3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h191d5c5ea3edb31d
                               at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/alloc/src/boxed.rs:1872:9
  38:     0x7fc7c22ab3c3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h42ef7cb2ae640a31
                               at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/alloc/src/boxed.rs:1872:9
  39:     0x7fc7c22ab3c3 - std::sys::unix::thread::Thread::new::thread_start::he47f7169665dab60
                               at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/sys/unix/thread.rs:108:17
  40:     0x7fcb3e26cb43 - start_thread
                               at ./nptl/./nptl/pthread_create.c:442:8
  41:     0x7fcb3e2fea00 - clone3
                               at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
  42:                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.1 (e092d0b6b 2022-07-16) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type lib -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 [unsafety_check_result] unsafety-checking `area::Area::area`
#1 [analysis] running analysis passes on this crate
end of query stack
warning: `iodine` (lib) generated 3 warnings (1 duplicate)
error: could not compile `iodine`; 3 warnings emitted
warning: build failed, waiting for other jobs to finish...
  40:     0x7fc7c206cb43 - start_thread
                               at ./nptl/./nptl/pthread_create.c:442:8
  41:     0x7fc7c20fea00 - clone3
                               at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
  42:                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.1 (e092d0b6b 2022-07-16) 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 [unsafety_check_result] unsafety-checking `area::Area::area`
#1 [analysis] running analysis passes on this crate
end of query stack
warning: `iodine` (lib test) generated 3 warnings (2 duplicates)
error: could not compile `iodine`; 3 warnings emitted
Backtrace

$ RUST_BACKTRACE=1 cargo build
   Compiling iodine v0.1.0 (/home/schneider/Dropbox/iodine/iodine)
warning: unused import: `cell::Cell`
 --> iodine/src/iter.rs:6:5
  |
6 |     cell::Cell,
  |     ^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: variable `last_cell` is assigned to, but never used
  --> iodine/src/grid.rs:64:42
   |
64 |         let (mut last_x, mut last_y, mut last_cell) = if let Some((x, y, cell)) = scheduled.next() {
   |                                          ^^^^^^^^^
   |
   = note: `#[warn(unused_variables)]` on by default
   = note: consider using `_last_cell` instead

warning: value assigned to `last_cell` is never read
  --> iodine/src/grid.rs:92:30
   |
92 |             (last_x, last_y, last_cell) = (x, y, cell);
   |                              ^^^^^^^^^
   |
   = note: `#[warn(unused_assignments)]` on by default
   = help: maybe it is overwritten before being read?

thread 'rustc' panicked at 'attempted to read from stolen value: rustc_middle::mir::Body', compiler/rustc_mir_transform/src/check_unsafety.rs:517:36
stack backtrace:
   0: rust_begin_unwind
             at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panicking.rs:584:5
   1: core::panicking::panic_fmt
             at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/core/src/panicking.rs:142:14
   2: rustc_mir_transform::check_unsafety::unsafety_check_result
   3: <rustc_mir_transform::check_unsafety::provide::{closure#0} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_span::def_id::LocalDefId)>>::call_once
   4: <rustc_middle::dep_graph::dep_node::DepKind as rustc_query_system::dep_graph::DepKind>::with_deps::<rustc_query_system::query::plumbing::try_load_from_disk_and_cache_in_memory<rustc_query_impl::plumbing::QueryCtxt, rustc_span::def_id::LocalDefId, &rustc_middle::mir::query::UnsafetyCheckResult>::{closure#1}, &rustc_middle::mir::query::UnsafetyCheckResult>
   5: rustc_query_system::query::plumbing::try_load_from_disk_and_cache_in_memory::<rustc_query_impl::plumbing::QueryCtxt, rustc_span::def_id::LocalDefId, &rustc_middle::mir::query::UnsafetyCheckResult>
   6: 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::mir::query::UnsafetyCheckResult>>
   7: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::unsafety_check_result
   8: rustc_mir_transform::check_unsafety::check_unsafety
   9: <rustc_session::session::Session>::time::<(), rustc_interface::passes::analysis::{closure#3}>
  10: rustc_interface::passes::analysis
  11: <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>>
  12: 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>>>
  13: rustc_query_system::query::plumbing::get_query::<rustc_query_impl::queries::analysis, rustc_query_impl::plumbing::QueryCtxt>
  14: <rustc_interface::passes::QueryContext>::enter::<rustc_driver::run_compiler::{closure#1}::{closure#2}::{closure#3}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>
  15: <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>>
  16: 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}>
  17: rustc_interface::interface::create_compiler_and_run::<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>
  18: <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>>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

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.1 (e092d0b6b 2022-07-16) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type lib -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 [unsafety_check_result] unsafety-checking `area::Area::area`
#1 [analysis] running analysis passes on this crate
end of query stack
warning: `iodine` (lib) generated 3 warnings
error: could not compile `iodine`; 3 warnings emitted

@schneiderfelipe schneiderfelipe 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 Aug 5, 2022
@Noratrieb
Copy link
Member

Thank you for your bug report! Is the problem still present on the latest nightly?

rustup install nightly
cargo +nightly test

@ghost
Copy link

ghost commented Aug 5, 2022

@rustbot label +E-needs-mcve

@rustbot rustbot added the E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example label Aug 5, 2022
@ghost
Copy link

ghost commented Aug 5, 2022

This is probably a duplicate of this issue.

@cjgillot
Copy link
Contributor

cjgillot commented May 1, 2023

Marking as closed by #108820. Please open a new issue if this still happens.

@cjgillot cjgillot closed this as completed May 1, 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. E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example 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

4 participants