Skip to content

ICE: error was constructed but not emitted #104870

Description

@matthiaskrgr

Code

#![feature(cfg_target_has_atomic, no_core, intrinsics, lang_items)]
#![crate_type="rlib"]
#![no_core]

extern "rust-intrinsic" {
    fn atomic_xadd<T>(dst: *mut T, src: T) -> T;
}

#[lang = "sized"]
trait Sized {}
#[lang = "copy"]
trait Copy {}

#[cfg(target_has_atomic = "8")]
pub unsafe fn atomic_u8(x: *mut u8) {
    atomic_xadd(x, 1);
    atomic_xadd(x, 1);
}

rustc 1.67.0-nightly (70f8737b2 2022-11-23) :

error[E0382]: use of moved value: `x`
  --> 023f2218b87ae7e7afaf853e5d953b53363da95e.rs:27:17
   |
25 | pub unsafe fn atomic_u8(x: *mut u8) {
   |                         - move occurs because `x` has type `*mut u8`, which does not implement the `Copy` trait
26 |     atomic_xadd(x, 1);
   |                 - value moved here
27 |     atomic_xadd(x, 1);
   |                 ^ value used here after move

error: aborting due to previous error

For more information about this error, try `rustc --explain E0382`.

rustc 1.67.0-nightly (5dfb4b0af 2022-11-24):

Backtrace

thread '<unnamed>' panicked at 'called `Option::unwrap()` on a `None` value', compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs:742:17
stack backtrace:
   0:     0x7f7a4d3662aa - std::backtrace_rs::backtrace::libunwind::trace::hb323b1c60fddca93
                               at /rustc/5dfb4b0afaf6acace0845d00e85a934fb4289d83/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f7a4d3662aa - std::backtrace_rs::backtrace::trace_unsynchronized::hc84e7bf61bca2c6e
                               at /rustc/5dfb4b0afaf6acace0845d00e85a934fb4289d83/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f7a4d3662aa - std::sys_common::backtrace::_print_fmt::h6d347369517c3499
                               at /rustc/5dfb4b0afaf6acace0845d00e85a934fb4289d83/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7f7a4d3662aa - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::ha8becfe32371a83b
                               at /rustc/5dfb4b0afaf6acace0845d00e85a934fb4289d83/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f7a4d3c8bae - core::fmt::write::h49d04e24a4a0f5b0
                               at /rustc/5dfb4b0afaf6acace0845d00e85a934fb4289d83/library/core/src/fmt/mod.rs:1208:17
   5:     0x7f7a4d3566e5 - std::io::Write::write_fmt::h51e3e9a867946d92
                               at /rustc/5dfb4b0afaf6acace0845d00e85a934fb4289d83/library/std/src/io/mod.rs:1682:15
   6:     0x7f7a4d366075 - std::sys_common::backtrace::_print::hdca39b4597f42be8
                               at /rustc/5dfb4b0afaf6acace0845d00e85a934fb4289d83/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x7f7a4d366075 - std::sys_common::backtrace::print::h90a45fec0894e48c
                               at /rustc/5dfb4b0afaf6acace0845d00e85a934fb4289d83/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x7f7a4d368d9f - std::panicking::default_hook::{{closure}}::h33ff658e7827f9cc
                               at /rustc/5dfb4b0afaf6acace0845d00e85a934fb4289d83/library/std/src/panicking.rs:267:22
   9:     0x7f7a4d368adb - std::panicking::default_hook::h7b258e9d452b029f
                               at /rustc/5dfb4b0afaf6acace0845d00e85a934fb4289d83/library/std/src/panicking.rs:286:9
  10:     0x7f7a4d3695bc - std::panicking::rust_panic_with_hook::hf8e2608dfe7b3876
                               at /rustc/5dfb4b0afaf6acace0845d00e85a934fb4289d83/library/std/src/panicking.rs:688:13
  11:     0x7f7a4d369312 - std::panicking::begin_panic_handler::{{closure}}::hf08f8046f55d20d0
                               at /rustc/5dfb4b0afaf6acace0845d00e85a934fb4289d83/library/std/src/panicking.rs:577:13
  12:     0x7f7a4d36675c - std::sys_common::backtrace::__rust_end_short_backtrace::h156042f7f0b912a5
                               at /rustc/5dfb4b0afaf6acace0845d00e85a934fb4289d83/library/std/src/sys_common/backtrace.rs:137:18
  13:     0x7f7a4d369062 - rust_begin_unwind
                               at /rustc/5dfb4b0afaf6acace0845d00e85a934fb4289d83/library/std/src/panicking.rs:575:5
  14:     0x7f7a4d3c55c3 - core::panicking::panic_fmt::h65ed150133999c5f
                               at /rustc/5dfb4b0afaf6acace0845d00e85a934fb4289d83/library/core/src/panicking.rs:65:14
  15:     0x7f7a4d3c569d - core::panicking::panic::h49fb44491f39587d
                               at /rustc/5dfb4b0afaf6acace0845d00e85a934fb4289d83/library/core/src/panicking.rs:114:5
  16:     0x7f7a504105e2 - <rustc_borrowck[294c6deda030de41]::MirBorrowckCtxt>::suggest_cloning
  17:     0x7f7a5040f389 - <rustc_borrowck[294c6deda030de41]::MirBorrowckCtxt>::report_use_of_moved_or_uninitialized
  18:     0x7f7a4ec6e3ea - <rustc_borrowck[294c6deda030de41]::MirBorrowckCtxt as rustc_mir_dataflow[ca8e193615b72aa8]::framework::visitor::ResultsVisitor>::visit_statement_before_primary_effect
  19:     0x7f7a4f753463 - rustc_mir_dataflow[ca8e193615b72aa8]::framework::visitor::visit_results::<rustc_borrowck[294c6deda030de41]::dataflow::BorrowckAnalyses<rustc_index[348215daae5de83b]::bit_set::BitSet<rustc_borrowck[294c6deda030de41]::dataflow::BorrowIndex>, rustc_index[348215daae5de83b]::bit_set::ChunkedBitSet<rustc_mir_dataflow[ca8e193615b72aa8]::move_paths::MovePathIndex>, rustc_index[348215daae5de83b]::bit_set::ChunkedBitSet<rustc_mir_dataflow[ca8e193615b72aa8]::move_paths::InitIndex>>, rustc_borrowck[294c6deda030de41]::dataflow::BorrowckAnalyses<rustc_mir_dataflow[ca8e193615b72aa8]::framework::engine::Results<rustc_borrowck[294c6deda030de41]::dataflow::Borrows>, rustc_mir_dataflow[ca8e193615b72aa8]::framework::engine::Results<rustc_mir_dataflow[ca8e193615b72aa8]::impls::MaybeUninitializedPlaces>, rustc_mir_dataflow[ca8e193615b72aa8]::framework::engine::Results<rustc_mir_dataflow[ca8e193615b72aa8]::impls::EverInitializedPlaces>>, core[81c431c77b3227e5]::iter::adapters::map::Map<rustc_middle[4086bdcecfc20d80]::mir::traversal::ReversePostorderIter, rustc_borrowck[294c6deda030de41]::do_mir_borrowck::{closure#2}>, rustc_borrowck[294c6deda030de41]::MirBorrowckCtxt>
  20:     0x7f7a4f72c0e7 - rustc_borrowck[294c6deda030de41]::do_mir_borrowck
  21:     0x7f7a4f71677a - rustc_borrowck[294c6deda030de41]::mir_borrowck
  22:     0x7f7a4f6aa6d9 - rustc_query_system[1ad976e1215f3964]::query::plumbing::try_execute_query::<rustc_query_impl[dee4b94ff49e365e]::plumbing::QueryCtxt, rustc_query_system[1ad976e1215f3964]::query::caches::VecCache<rustc_span[9fb21a881f0bdab2]::def_id::LocalDefId, &rustc_middle[4086bdcecfc20d80]::mir::query::BorrowCheckResult>>
  23:     0x7f7a4eb4ab82 - rustc_data_structures[ac380a40d754c2da]::sync::par_for_each_in::<&[rustc_span[9fb21a881f0bdab2]::def_id::LocalDefId], <rustc_middle[4086bdcecfc20d80]::hir::map::Map>::par_body_owners<rustc_interface[5a01d4b645e062e2]::passes::analysis::{closure#2}::{closure#0}>::{closure#0}>
  24:     0x7f7a4eb495b3 - <rustc_session[3662fe595b759729]::session::Session>::time::<(), rustc_interface[5a01d4b645e062e2]::passes::analysis::{closure#2}>
  25:     0x7f7a4eb47857 - rustc_interface[5a01d4b645e062e2]::passes::analysis
  26:     0x7f7a4fded45c - rustc_query_system[1ad976e1215f3964]::query::plumbing::try_execute_query::<rustc_query_impl[dee4b94ff49e365e]::plumbing::QueryCtxt, rustc_query_system[1ad976e1215f3964]::query::caches::DefaultCache<(), core[81c431c77b3227e5]::result::Result<(), rustc_errors[fa90e1d5d2ab9e2c]::ErrorGuaranteed>>>
  27:     0x7f7a4fded14b - rustc_query_system[1ad976e1215f3964]::query::plumbing::get_query::<rustc_query_impl[dee4b94ff49e365e]::queries::analysis, rustc_query_impl[dee4b94ff49e365e]::plumbing::QueryCtxt>
  28:     0x7f7a4f926f0b - <rustc_interface[5a01d4b645e062e2]::passes::QueryContext>::enter::<rustc_driver[49d0649a537a4dce]::run_compiler::{closure#1}::{closure#2}::{closure#2}, core[81c431c77b3227e5]::result::Result<(), rustc_errors[fa90e1d5d2ab9e2c]::ErrorGuaranteed>>
  29:     0x7f7a4f91f5bf - <rustc_interface[5a01d4b645e062e2]::interface::Compiler>::enter::<rustc_driver[49d0649a537a4dce]::run_compiler::{closure#1}::{closure#2}, core[81c431c77b3227e5]::result::Result<core[81c431c77b3227e5]::option::Option<rustc_interface[5a01d4b645e062e2]::queries::Linker>, rustc_errors[fa90e1d5d2ab9e2c]::ErrorGuaranteed>>
  30:     0x7f7a4f91a5d8 - rustc_span[9fb21a881f0bdab2]::with_source_map::<core[81c431c77b3227e5]::result::Result<(), rustc_errors[fa90e1d5d2ab9e2c]::ErrorGuaranteed>, rustc_interface[5a01d4b645e062e2]::interface::run_compiler<core[81c431c77b3227e5]::result::Result<(), rustc_errors[fa90e1d5d2ab9e2c]::ErrorGuaranteed>, rustc_driver[49d0649a537a4dce]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  31:     0x7f7a4f91a0c5 - <scoped_tls[1cce71beeef11336]::ScopedKey<rustc_span[9fb21a881f0bdab2]::SessionGlobals>>::set::<rustc_interface[5a01d4b645e062e2]::interface::run_compiler<core[81c431c77b3227e5]::result::Result<(), rustc_errors[fa90e1d5d2ab9e2c]::ErrorGuaranteed>, rustc_driver[49d0649a537a4dce]::run_compiler::{closure#1}>::{closure#0}, core[81c431c77b3227e5]::result::Result<(), rustc_errors[fa90e1d5d2ab9e2c]::ErrorGuaranteed>>
  32:     0x7f7a4f9196b2 - std[9f362533f84673f0]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[5a01d4b645e062e2]::util::run_in_thread_pool_with_globals<rustc_interface[5a01d4b645e062e2]::interface::run_compiler<core[81c431c77b3227e5]::result::Result<(), rustc_errors[fa90e1d5d2ab9e2c]::ErrorGuaranteed>, rustc_driver[49d0649a537a4dce]::run_compiler::{closure#1}>::{closure#0}, core[81c431c77b3227e5]::result::Result<(), rustc_errors[fa90e1d5d2ab9e2c]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[81c431c77b3227e5]::result::Result<(), rustc_errors[fa90e1d5d2ab9e2c]::ErrorGuaranteed>>
  33:     0x7f7a4f9193c8 - <<std[9f362533f84673f0]::thread::Builder>::spawn_unchecked_<rustc_interface[5a01d4b645e062e2]::util::run_in_thread_pool_with_globals<rustc_interface[5a01d4b645e062e2]::interface::run_compiler<core[81c431c77b3227e5]::result::Result<(), rustc_errors[fa90e1d5d2ab9e2c]::ErrorGuaranteed>, rustc_driver[49d0649a537a4dce]::run_compiler::{closure#1}>::{closure#0}, core[81c431c77b3227e5]::result::Result<(), rustc_errors[fa90e1d5d2ab9e2c]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[81c431c77b3227e5]::result::Result<(), rustc_errors[fa90e1d5d2ab9e2c]::ErrorGuaranteed>>::{closure#1} as core[81c431c77b3227e5]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  34:     0x7f7a5144ad93 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h9b61d15b0ee557ed
                               at /rustc/5dfb4b0afaf6acace0845d00e85a934fb4289d83/library/alloc/src/boxed.rs:2000:9
  35:     0x7f7a5144ad93 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::haff1f709ebbd1677
                               at /rustc/5dfb4b0afaf6acace0845d00e85a934fb4289d83/library/alloc/src/boxed.rs:2000:9
  36:     0x7f7a5144ad93 - std::sys::unix::thread::Thread::new::thread_start::h98e69f1908d18751
                               at /rustc/5dfb4b0afaf6acace0845d00e85a934fb4289d83/library/std/src/sys/unix/thread.rs:108:17
  37:     0x7f7a4d1078fd - <unknown>
  38:     0x7f7a4d189a60 - <unknown>
  39:                0x0 - <unknown>
error: internal compiler error: the following error was constructed but not emitted

error[E0382]: use of moved value: `x`
  --> 023f2218b87ae7e7afaf853e5d953b53363da95e.rs:27:17
   |
27 |     atomic_xadd(x, 1);
   |                 ^

thread '<unnamed>' panicked at 'error was constructed but not emitted', compiler/rustc_errors/src/diagnostic_builder.rs:675:21
stack backtrace:
   0:     0x7f7a4d3662aa - std::backtrace_rs::backtrace::libunwind::trace::hb323b1c60fddca93
                               at /rustc/5dfb4b0afaf6acace0845d00e85a934fb4289d83/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f7a4d3662aa - std::backtrace_rs::backtrace::trace_unsynchronized::hc84e7bf61bca2c6e
                               at /rustc/5dfb4b0afaf6acace0845d00e85a934fb4289d83/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f7a4d3662aa - std::sys_common::backtrace::_print_fmt::h6d347369517c3499
                               at /rustc/5dfb4b0afaf6acace0845d00e85a934fb4289d83/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7f7a4d3662aa - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::ha8becfe32371a83b
                               at /rustc/5dfb4b0afaf6acace0845d00e85a934fb4289d83/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f7a4d3c8bae - core::fmt::write::h49d04e24a4a0f5b0
                               at /rustc/5dfb4b0afaf6acace0845d00e85a934fb4289d83/library/core/src/fmt/mod.rs:1208:17
   5:     0x7f7a4d3566e5 - std::io::Write::write_fmt::h51e3e9a867946d92
                               at /rustc/5dfb4b0afaf6acace0845d00e85a934fb4289d83/library/std/src/io/mod.rs:1682:15
   6:     0x7f7a4d366075 - std::sys_common::backtrace::_print::hdca39b4597f42be8
                               at /rustc/5dfb4b0afaf6acace0845d00e85a934fb4289d83/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x7f7a4d366075 - std::sys_common::backtrace::print::h90a45fec0894e48c
                               at /rustc/5dfb4b0afaf6acace0845d00e85a934fb4289d83/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x7f7a4d368d9f - std::panicking::default_hook::{{closure}}::h33ff658e7827f9cc
                               at /rustc/5dfb4b0afaf6acace0845d00e85a934fb4289d83/library/std/src/panicking.rs:267:22
   9:     0x7f7a4d368adb - std::panicking::default_hook::h7b258e9d452b029f
                               at /rustc/5dfb4b0afaf6acace0845d00e85a934fb4289d83/library/std/src/panicking.rs:286:9
  10:     0x7f7a4d3695bc - std::panicking::rust_panic_with_hook::hf8e2608dfe7b3876
                               at /rustc/5dfb4b0afaf6acace0845d00e85a934fb4289d83/library/std/src/panicking.rs:688:13
  11:     0x7f7a4d369312 - std::panicking::begin_panic_handler::{{closure}}::hf08f8046f55d20d0
                               at /rustc/5dfb4b0afaf6acace0845d00e85a934fb4289d83/library/std/src/panicking.rs:577:13
  12:     0x7f7a4d36675c - std::sys_common::backtrace::__rust_end_short_backtrace::h156042f7f0b912a5
                               at /rustc/5dfb4b0afaf6acace0845d00e85a934fb4289d83/library/std/src/sys_common/backtrace.rs:137:18
  13:     0x7f7a4d369062 - rust_begin_unwind
                               at /rustc/5dfb4b0afaf6acace0845d00e85a934fb4289d83/library/std/src/panicking.rs:575:5
  14:     0x7f7a4d3c55c3 - core::panicking::panic_fmt::h65ed150133999c5f
                               at /rustc/5dfb4b0afaf6acace0845d00e85a934fb4289d83/library/core/src/panicking.rs:65:14
  15:     0x7f7a4f4075fd - <rustc_errors[fa90e1d5d2ab9e2c]::diagnostic_builder::DiagnosticBuilderInner as core[81c431c77b3227e5]::ops::drop::Drop>::drop
  16:     0x7f7a5040566d - core[81c431c77b3227e5]::ptr::drop_in_place::<rustc_errors[fa90e1d5d2ab9e2c]::diagnostic_builder::DiagnosticBuilder<rustc_errors[fa90e1d5d2ab9e2c]::ErrorGuaranteed>>
  17:     0x7f7a50410209 - <rustc_borrowck[294c6deda030de41]::MirBorrowckCtxt>::report_use_of_moved_or_uninitialized
  18:     0x7f7a4ec6e3ea - <rustc_borrowck[294c6deda030de41]::MirBorrowckCtxt as rustc_mir_dataflow[ca8e193615b72aa8]::framework::visitor::ResultsVisitor>::visit_statement_before_primary_effect
  19:     0x7f7a4f753463 - rustc_mir_dataflow[ca8e193615b72aa8]::framework::visitor::visit_results::<rustc_borrowck[294c6deda030de41]::dataflow::BorrowckAnalyses<rustc_index[348215daae5de83b]::bit_set::BitSet<rustc_borrowck[294c6deda030de41]::dataflow::BorrowIndex>, rustc_index[348215daae5de83b]::bit_set::ChunkedBitSet<rustc_mir_dataflow[ca8e193615b72aa8]::move_paths::MovePathIndex>, rustc_index[348215daae5de83b]::bit_set::ChunkedBitSet<rustc_mir_dataflow[ca8e193615b72aa8]::move_paths::InitIndex>>, rustc_borrowck[294c6deda030de41]::dataflow::BorrowckAnalyses<rustc_mir_dataflow[ca8e193615b72aa8]::framework::engine::Results<rustc_borrowck[294c6deda030de41]::dataflow::Borrows>, rustc_mir_dataflow[ca8e193615b72aa8]::framework::engine::Results<rustc_mir_dataflow[ca8e193615b72aa8]::impls::MaybeUninitializedPlaces>, rustc_mir_dataflow[ca8e193615b72aa8]::framework::engine::Results<rustc_mir_dataflow[ca8e193615b72aa8]::impls::EverInitializedPlaces>>, core[81c431c77b3227e5]::iter::adapters::map::Map<rustc_middle[4086bdcecfc20d80]::mir::traversal::ReversePostorderIter, rustc_borrowck[294c6deda030de41]::do_mir_borrowck::{closure#2}>, rustc_borrowck[294c6deda030de41]::MirBorrowckCtxt>
  20:     0x7f7a4f72c0e7 - rustc_borrowck[294c6deda030de41]::do_mir_borrowck
  21:     0x7f7a4f71677a - rustc_borrowck[294c6deda030de41]::mir_borrowck
  22:     0x7f7a4f6aa6d9 - rustc_query_system[1ad976e1215f3964]::query::plumbing::try_execute_query::<rustc_query_impl[dee4b94ff49e365e]::plumbing::QueryCtxt, rustc_query_system[1ad976e1215f3964]::query::caches::VecCache<rustc_span[9fb21a881f0bdab2]::def_id::LocalDefId, &rustc_middle[4086bdcecfc20d80]::mir::query::BorrowCheckResult>>
  23:     0x7f7a4eb4ab82 - rustc_data_structures[ac380a40d754c2da]::sync::par_for_each_in::<&[rustc_span[9fb21a881f0bdab2]::def_id::LocalDefId], <rustc_middle[4086bdcecfc20d80]::hir::map::Map>::par_body_owners<rustc_interface[5a01d4b645e062e2]::passes::analysis::{closure#2}::{closure#0}>::{closure#0}>
  24:     0x7f7a4eb495b3 - <rustc_session[3662fe595b759729]::session::Session>::time::<(), rustc_interface[5a01d4b645e062e2]::passes::analysis::{closure#2}>
  25:     0x7f7a4eb47857 - rustc_interface[5a01d4b645e062e2]::passes::analysis
  26:     0x7f7a4fded45c - rustc_query_system[1ad976e1215f3964]::query::plumbing::try_execute_query::<rustc_query_impl[dee4b94ff49e365e]::plumbing::QueryCtxt, rustc_query_system[1ad976e1215f3964]::query::caches::DefaultCache<(), core[81c431c77b3227e5]::result::Result<(), rustc_errors[fa90e1d5d2ab9e2c]::ErrorGuaranteed>>>
  27:     0x7f7a4fded14b - rustc_query_system[1ad976e1215f3964]::query::plumbing::get_query::<rustc_query_impl[dee4b94ff49e365e]::queries::analysis, rustc_query_impl[dee4b94ff49e365e]::plumbing::QueryCtxt>
  28:     0x7f7a4f926f0b - <rustc_interface[5a01d4b645e062e2]::passes::QueryContext>::enter::<rustc_driver[49d0649a537a4dce]::run_compiler::{closure#1}::{closure#2}::{closure#2}, core[81c431c77b3227e5]::result::Result<(), rustc_errors[fa90e1d5d2ab9e2c]::ErrorGuaranteed>>
  29:     0x7f7a4f91f5bf - <rustc_interface[5a01d4b645e062e2]::interface::Compiler>::enter::<rustc_driver[49d0649a537a4dce]::run_compiler::{closure#1}::{closure#2}, core[81c431c77b3227e5]::result::Result<core[81c431c77b3227e5]::option::Option<rustc_interface[5a01d4b645e062e2]::queries::Linker>, rustc_errors[fa90e1d5d2ab9e2c]::ErrorGuaranteed>>
  30:     0x7f7a4f91a5d8 - rustc_span[9fb21a881f0bdab2]::with_source_map::<core[81c431c77b3227e5]::result::Result<(), rustc_errors[fa90e1d5d2ab9e2c]::ErrorGuaranteed>, rustc_interface[5a01d4b645e062e2]::interface::run_compiler<core[81c431c77b3227e5]::result::Result<(), rustc_errors[fa90e1d5d2ab9e2c]::ErrorGuaranteed>, rustc_driver[49d0649a537a4dce]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  31:     0x7f7a4f91a0c5 - <scoped_tls[1cce71beeef11336]::ScopedKey<rustc_span[9fb21a881f0bdab2]::SessionGlobals>>::set::<rustc_interface[5a01d4b645e062e2]::interface::run_compiler<core[81c431c77b3227e5]::result::Result<(), rustc_errors[fa90e1d5d2ab9e2c]::ErrorGuaranteed>, rustc_driver[49d0649a537a4dce]::run_compiler::{closure#1}>::{closure#0}, core[81c431c77b3227e5]::result::Result<(), rustc_errors[fa90e1d5d2ab9e2c]::ErrorGuaranteed>>
  32:     0x7f7a4f9196b2 - std[9f362533f84673f0]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[5a01d4b645e062e2]::util::run_in_thread_pool_with_globals<rustc_interface[5a01d4b645e062e2]::interface::run_compiler<core[81c431c77b3227e5]::result::Result<(), rustc_errors[fa90e1d5d2ab9e2c]::ErrorGuaranteed>, rustc_driver[49d0649a537a4dce]::run_compiler::{closure#1}>::{closure#0}, core[81c431c77b3227e5]::result::Result<(), rustc_errors[fa90e1d5d2ab9e2c]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[81c431c77b3227e5]::result::Result<(), rustc_errors[fa90e1d5d2ab9e2c]::ErrorGuaranteed>>
  33:     0x7f7a4f9193c8 - <<std[9f362533f84673f0]::thread::Builder>::spawn_unchecked_<rustc_interface[5a01d4b645e062e2]::util::run_in_thread_pool_with_globals<rustc_interface[5a01d4b645e062e2]::interface::run_compiler<core[81c431c77b3227e5]::result::Result<(), rustc_errors[fa90e1d5d2ab9e2c]::ErrorGuaranteed>, rustc_driver[49d0649a537a4dce]::run_compiler::{closure#1}>::{closure#0}, core[81c431c77b3227e5]::result::Result<(), rustc_errors[fa90e1d5d2ab9e2c]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[81c431c77b3227e5]::result::Result<(), rustc_errors[fa90e1d5d2ab9e2c]::ErrorGuaranteed>>::{closure#1} as core[81c431c77b3227e5]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  34:     0x7f7a5144ad93 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h9b61d15b0ee557ed
                               at /rustc/5dfb4b0afaf6acace0845d00e85a934fb4289d83/library/alloc/src/boxed.rs:2000:9
  35:     0x7f7a5144ad93 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::haff1f709ebbd1677
                               at /rustc/5dfb4b0afaf6acace0845d00e85a934fb4289d83/library/alloc/src/boxed.rs:2000:9
  36:     0x7f7a5144ad93 - std::sys::unix::thread::Thread::new::thread_start::h98e69f1908d18751
                               at /rustc/5dfb4b0afaf6acace0845d00e85a934fb4289d83/library/std/src/sys/unix/thread.rs:108:17
  37:     0x7f7a4d1078fd - <unknown>
  38:     0x7f7a4d189a60 - <unknown>
  39:                0x0 - <unknown>
thread panicked while panicking. aborting.

Activity

  1. added
    I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    C-bugCategory: This is a bug.
    regression-untriagedUntriaged performance or correctness regression.
    on Nov 25, 2022
  2. added
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    on Nov 25, 2022
  3. compiler-errors commented on Nov 25, 2022

    @compiler-errors
    Contributor

    The real error isn't the unemitted diagnostic, it's the unwrap. The unemitted diagnostic only happens bc this unwrap occurs during diagnostics code, I think.

  4. matthiaskrgr commented on Nov 25, 2022

    @matthiaskrgr
    MemberAuthor

    cc @estebank I think this might be #103908 and we try to suggest .clone() which is not available for the type though?

  5. mucinoab commented on Nov 26, 2022

    @mucinoab
    Contributor

    If you add

    #[lang = "clone"]
    trait Clone {}

    ... to the example you no longer ICE and just hit the normal error[E0382]: use of moved value: 'x'

  6. mucinoab commented on Nov 26, 2022

    @mucinoab
    Contributor

    @rustbot claim

  7. compiler-errors commented on Nov 26, 2022

    @compiler-errors
    Contributor

    Please use this minimized repro:

    #![feature(no_core, lang_items)]
    #![no_core]
    
    #[lang = "sized"]
    trait Sized {}
    
    #[lang = "copy"]
    trait Copy {}
    
    fn g<T>(x: T) {}
    
    fn f(x: *mut u8) {
        g(x);
        g(x);
    }
  8. matthiaskrgr commented on Nov 26, 2022

    @matthiaskrgr
    MemberAuthor

  9. estebank commented on Nov 27, 2022

    @estebank
    Contributor

    Every time I think "surely this unwrap will be fine", it bites me in the read as sure as the sun coming up.

  10. JakobDegen commented on Nov 27, 2022

    @JakobDegen
    Contributor

    Are we fixing #![feature(no_core)] ICEs? Not so sure we should bother...

  11. compiler-errors commented on Nov 27, 2022

    @compiler-errors
    Contributor

    @JakobDegen: This one was particularly easy to fix (#104956) and probably shouldn't've have been an unwrap in the first place (unwraps in diagnostics code are generally a code smell, since they should fail gracefully in strange situations) -- but I generally agree, had this fix required some large refactoring or implemented extra checks on a performance-sensitive path, then I think this should've been closed w/ a wontfix.

  12. added 4 commits that reference this issue on Nov 27, 2022
    3f25e34
    4d62c79
    4990ab8
    db2850c
  13. removed
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    on Nov 29, 2022
  14. added a commit that references this issue on Jan 6, 2023
    874723c
  15. added 6 commits that reference this issue on Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-untriagedUntriaged performance or correctness regression.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions