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: mismatched argument count #1329

Closed
matthiaskrgr opened this issue Dec 20, 2022 · 3 comments
Closed

ICE: mismatched argument count #1329

matthiaskrgr opened this issue Dec 20, 2022 · 3 comments

Comments

@matthiaskrgr
Copy link
Member

// ignore-macos

#![feature(no_core, lang_items, start)]
#![no_core]
#![allow(clippy::missing_safety_doc)]

#[link(name = "c")]
extern "C" {}

#[lang = "sized"]
pub trait Sized {}
#[lang = "copy"]
pub trait Copy {}
#[lang = "freeze"]
pub unsafe trait Freeze {}

#[lang = "start"]
fn start<T>(_main: fn() -> T, _argc: isize, _argv: *const *const u8) -> isize {
    0
}

fn main() {}

struct A;

impl A {
    pub fn as_ref(self) -> &'static str {
        "A"
    }
}
warning: struct `A` is never constructed
  --> /home/matthias/vcs/github/rust_debug_assertions/src/tools/clippy/tests/ui/def_id_nocore.rs:24:8
   |
24 | struct A;
   |        ^
   |
   = note: `#[warn(dead_code)]` on by default

warning: associated function `as_ref` is never used
  --> /home/matthias/vcs/github/rust_debug_assertions/src/tools/clippy/tests/ui/def_id_nocore.rs:27:12
   |
27 |     pub fn as_ref(self) -> &'static str {
   |            ^^^^^^

thread 'rustc' panicked at 'called `Result::unwrap()` on an `Err` value: Compilation(Verifier(VerifierErrors([VerifierError { location: inst2, context: Some("v4 = call fn1(v3, v0, v1, v2)  ; v2 = 0"), message: "mismatched argument count for `v4 = call fn1(v3, v0, v1, v2)  ; v2 = 0`: got 4, expected 3" }])))', src/main_shim.rs:165:52
stack backtrace:
   0:     0x7f5093f66c04 - std::backtrace_rs::backtrace::libunwind::trace::h4c97bf25d2e51ae8
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f5093f66c04 - std::backtrace_rs::backtrace::trace_unsynchronized::h37aa0c666953359e
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f5093f66c04 - std::sys_common::backtrace::_print_fmt::hda9969f991ffe421
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7f5093f66c04 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h43dbafa239606d9e
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f5093fe4d68 - core::fmt::write::hd8b1d49ea978e1a7
                               at /home/matthias/vcs/github/rust_debug_assertions/library/core/src/fmt/mod.rs:1208:17
   5:     0x7f5093f26acf - std::io::Write::write_fmt::h910d70db5835b5b3
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/io/mod.rs:1682:15
   6:     0x7f5093f66a05 - std::sys_common::backtrace::_print::hba0af3cc8e4f9e16
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x7f5093f66a05 - std::sys_common::backtrace::print::hcb425016d7f50579
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x7f5093f4e1a4 - std::panicking::default_hook::{{closure}}::h5a92231480ffed71
   9:     0x7f5093f4dec6 - std::panicking::default_hook::h6128a4fdcff47458
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/panicking.rs:286:9
  10:     0x7f5096af3f62 - <alloc[8442e47aebcde8b2]::boxed::Box<dyn for<'a, 'b> core[a28e3aee1dd4a69e]::ops::function::Fn<(&'a core[a28e3aee1dd4a69e]::panic::panic_info::PanicInfo<'b>,), Output = ()> + core[a28e3aee1dd4a69e]::marker::Sync + core[a28e3aee1dd4a69e]::marker::Send> as core[a28e3aee1dd4a69e]::ops::function::Fn<(&core[a28e3aee1dd4a69e]::panic::panic_info::PanicInfo,)>>::call
                               at /home/matthias/vcs/github/rust_debug_assertions/library/alloc/src/boxed.rs:2032:9
  11:     0x7f5096af3f62 - rustc_driver[388e45bfc77c8dd2]::DEFAULT_HOOK::{closure#0}::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_driver/src/lib.rs:1202:13
  12:     0x7f5093f4e957 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::haf9ff6e68c2e05a7
                               at /home/matthias/vcs/github/rust_debug_assertions/library/alloc/src/boxed.rs:2032:9
  13:     0x7f5093f4e957 - std::panicking::rust_panic_with_hook::h0207dd496e646917
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/panicking.rs:692:13
  14:     0x7f5093f67e49 - std::panicking::begin_panic_handler::{{closure}}::h4f3167dde486c20a
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/panicking.rs:579:13
  15:     0x7f5093f66d4e - std::sys_common::backtrace::__rust_end_short_backtrace::h5667162f671b6d90
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/sys_common/backtrace.rs:137:18
  16:     0x7f5093f4e442 - rust_begin_unwind
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/panicking.rs:575:5
  17:     0x7f5093fe9403 - core::panicking::panic_fmt::h90dee617596c399d
                               at /home/matthias/vcs/github/rust_debug_assertions/library/core/src/panicking.rs:64:14
  18:     0x7f5093fe9a53 - core::result::unwrap_failed::h303efdcd3d5e7a03
                               at /home/matthias/vcs/github/rust_debug_assertions/library/core/src/result.rs:1790:5
  19:     0x7f508d9513b2 - <core[a28e3aee1dd4a69e]::result::Result<cranelift_module[93373e9e154b7c4c]::module::ModuleCompiledFunction, cranelift_module[93373e9e154b7c4c]::module::ModuleError>>::unwrap
                               at /home/matthias/vcs/github/rust_debug_assertions/library/core/src/result.rs:1112:23
  20:     0x7f508d9513b2 - rustc_codegen_cranelift[e80a840dcfedcc0]::main_shim::maybe_create_entry_wrapper::create_entry_fn::<cranelift_object[c5896af7f33dfa77]::backend::ObjectModule>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_codegen_cranelift/src/main_shim.rs:165:9
  21:     0x7f508d94fd11 - rustc_codegen_cranelift[e80a840dcfedcc0]::main_shim::maybe_create_entry_wrapper::<cranelift_object[c5896af7f33dfa77]::backend::ObjectModule>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_codegen_cranelift/src/main_shim.rs:38:5
  22:     0x7f508d899bdc - rustc_codegen_cranelift[e80a840dcfedcc0]::driver::aot::module_codegen::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_codegen_cranelift/src/driver/aot.rs:298:9
  23:     0x7f508d899bdc - <rustc_data_structures[e855f16069d18ad7]::profiling::VerboseTimingGuard>::run::<(alloc[8442e47aebcde8b2]::string::String, rustc_codegen_cranelift[e80a840dcfedcc0]::CodegenCx, cranelift_object[c5896af7f33dfa77]::backend::ObjectModule, alloc[8442e47aebcde8b2]::vec::Vec<rustc_codegen_cranelift[e80a840dcfedcc0]::base::CodegenedFunction>), rustc_codegen_cranelift[e80a840dcfedcc0]::driver::aot::module_codegen::{closure#0}>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_data_structures/src/profiling.rs:726:9
  24:     0x7f508d899bdc - <rustc_session[bd0fec20e3e30607]::session::Session>::time::<(alloc[8442e47aebcde8b2]::string::String, rustc_codegen_cranelift[e80a840dcfedcc0]::CodegenCx, cranelift_object[c5896af7f33dfa77]::backend::ObjectModule, alloc[8442e47aebcde8b2]::vec::Vec<rustc_codegen_cranelift[e80a840dcfedcc0]::base::CodegenedFunction>), rustc_codegen_cranelift[e80a840dcfedcc0]::driver::aot::module_codegen::{closure#0}>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_session/src/utils.rs:10:9
  25:     0x7f508d983909 - rustc_codegen_cranelift[e80a840dcfedcc0]::driver::aot::module_codegen
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_codegen_cranelift/src/driver/aot.rs:261:63
  26:     0x7f508d8e2386 - <rustc_query_system[ac6d26d16f7ebea6]::dep_graph::graph::DepGraph<rustc_middle[e9b4372b5e8bc47d]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[e9b4372b5e8bc47d]::ty::context::TyCtxt, (rustc_codegen_cranelift[e80a840dcfedcc0]::config::BackendConfig, alloc[8442e47aebcde8b2]::sync::Arc<rustc_codegen_cranelift[e80a840dcfedcc0]::global_asm::GlobalAsmConfig>, rustc_span[8293014313a13715]::symbol::Symbol, rustc_codegen_cranelift[e80a840dcfedcc0]::concurrency_limiter::ConcurrencyLimiterToken), rustc_codegen_cranelift[e80a840dcfedcc0]::driver::aot::OngoingModuleCodegen>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_query_system/src/dep_graph/graph.rs:296:14
  27:     0x7f508d8f8ebd - rustc_codegen_cranelift[e80a840dcfedcc0]::driver::aot::run_aot::{closure#0}::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_codegen_cranelift/src/driver/aot.rs:377:25
  28:     0x7f508d8f8ebd - core[a28e3aee1dd4a69e]::iter::adapters::map::map_fold::<&rustc_middle[e9b4372b5e8bc47d]::mir::mono::CodegenUnit, rustc_codegen_cranelift[e80a840dcfedcc0]::driver::aot::OngoingModuleCodegen, (), rustc_codegen_cranelift[e80a840dcfedcc0]::driver::aot::run_aot::{closure#0}::{closure#0}, core[a28e3aee1dd4a69e]::iter::traits::iterator::Iterator::for_each::call<rustc_codegen_cranelift[e80a840dcfedcc0]::driver::aot::OngoingModuleCodegen, <alloc[8442e47aebcde8b2]::vec::Vec<rustc_codegen_cranelift[e80a840dcfedcc0]::driver::aot::OngoingModuleCodegen>>::extend_trusted<core[a28e3aee1dd4a69e]::iter::adapters::map::Map<core[a28e3aee1dd4a69e]::slice::iter::Iter<rustc_middle[e9b4372b5e8bc47d]::mir::mono::CodegenUnit>, rustc_codegen_cranelift[e80a840dcfedcc0]::driver::aot::run_aot::{closure#0}::{closure#0}>>::{closure#0}>::{closure#0}>::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/library/core/src/iter/adapters/map.rs:84:28
  29:     0x7f508d8f8ebd - <core[a28e3aee1dd4a69e]::slice::iter::Iter<rustc_middle[e9b4372b5e8bc47d]::mir::mono::CodegenUnit> as core[a28e3aee1dd4a69e]::iter::traits::iterator::Iterator>::fold::<(), core[a28e3aee1dd4a69e]::iter::adapters::map::map_fold<&rustc_middle[e9b4372b5e8bc47d]::mir::mono::CodegenUnit, rustc_codegen_cranelift[e80a840dcfedcc0]::driver::aot::OngoingModuleCodegen, (), rustc_codegen_cranelift[e80a840dcfedcc0]::driver::aot::run_aot::{closure#0}::{closure#0}, core[a28e3aee1dd4a69e]::iter::traits::iterator::Iterator::for_each::call<rustc_codegen_cranelift[e80a840dcfedcc0]::driver::aot::OngoingModuleCodegen, <alloc[8442e47aebcde8b2]::vec::Vec<rustc_codegen_cranelift[e80a840dcfedcc0]::driver::aot::OngoingModuleCodegen>>::extend_trusted<core[a28e3aee1dd4a69e]::iter::adapters::map::Map<core[a28e3aee1dd4a69e]::slice::iter::Iter<rustc_middle[e9b4372b5e8bc47d]::mir::mono::CodegenUnit>, rustc_codegen_cranelift[e80a840dcfedcc0]::driver::aot::run_aot::{closure#0}::{closure#0}>>::{closure#0}>::{closure#0}>::{closure#0}>
                               at /home/matthias/vcs/github/rust_debug_assertions/library/core/src/iter/traits/iterator.rs:2415:21
  30:     0x7f508d8f8ebd - <core[a28e3aee1dd4a69e]::iter::adapters::map::Map<core[a28e3aee1dd4a69e]::slice::iter::Iter<rustc_middle[e9b4372b5e8bc47d]::mir::mono::CodegenUnit>, rustc_codegen_cranelift[e80a840dcfedcc0]::driver::aot::run_aot::{closure#0}::{closure#0}> as core[a28e3aee1dd4a69e]::iter::traits::iterator::Iterator>::fold::<(), core[a28e3aee1dd4a69e]::iter::traits::iterator::Iterator::for_each::call<rustc_codegen_cranelift[e80a840dcfedcc0]::driver::aot::OngoingModuleCodegen, <alloc[8442e47aebcde8b2]::vec::Vec<rustc_codegen_cranelift[e80a840dcfedcc0]::driver::aot::OngoingModuleCodegen>>::extend_trusted<core[a28e3aee1dd4a69e]::iter::adapters::map::Map<core[a28e3aee1dd4a69e]::slice::iter::Iter<rustc_middle[e9b4372b5e8bc47d]::mir::mono::CodegenUnit>, rustc_codegen_cranelift[e80a840dcfedcc0]::driver::aot::run_aot::{closure#0}::{closure#0}>>::{closure#0}>::{closure#0}>
                               at /home/matthias/vcs/github/rust_debug_assertions/library/core/src/iter/adapters/map.rs:124:9
  31:     0x7f508d8c1aec - <core[a28e3aee1dd4a69e]::iter::adapters::map::Map<core[a28e3aee1dd4a69e]::slice::iter::Iter<rustc_middle[e9b4372b5e8bc47d]::mir::mono::CodegenUnit>, rustc_codegen_cranelift[e80a840dcfedcc0]::driver::aot::run_aot::{closure#0}::{closure#0}> as core[a28e3aee1dd4a69e]::iter::traits::iterator::Iterator>::for_each::<<alloc[8442e47aebcde8b2]::vec::Vec<rustc_codegen_cranelift[e80a840dcfedcc0]::driver::aot::OngoingModuleCodegen>>::extend_trusted<core[a28e3aee1dd4a69e]::iter::adapters::map::Map<core[a28e3aee1dd4a69e]::slice::iter::Iter<rustc_middle[e9b4372b5e8bc47d]::mir::mono::CodegenUnit>, rustc_codegen_cranelift[e80a840dcfedcc0]::driver::aot::run_aot::{closure#0}::{closure#0}>>::{closure#0}>
                               at /home/matthias/vcs/github/rust_debug_assertions/library/core/src/iter/traits/iterator.rs:831:9
  32:     0x7f508d8c1aec - <alloc[8442e47aebcde8b2]::vec::Vec<rustc_codegen_cranelift[e80a840dcfedcc0]::driver::aot::OngoingModuleCodegen>>::extend_trusted::<core[a28e3aee1dd4a69e]::iter::adapters::map::Map<core[a28e3aee1dd4a69e]::slice::iter::Iter<rustc_middle[e9b4372b5e8bc47d]::mir::mono::CodegenUnit>, rustc_codegen_cranelift[e80a840dcfedcc0]::driver::aot::run_aot::{closure#0}::{closure#0}>>
                               at /home/matthias/vcs/github/rust_debug_assertions/library/alloc/src/vec/mod.rs:2880:17
  33:     0x7f508d8c1aec - <alloc[8442e47aebcde8b2]::vec::Vec<rustc_codegen_cranelift[e80a840dcfedcc0]::driver::aot::OngoingModuleCodegen> as alloc[8442e47aebcde8b2]::vec::spec_extend::SpecExtend<rustc_codegen_cranelift[e80a840dcfedcc0]::driver::aot::OngoingModuleCodegen, core[a28e3aee1dd4a69e]::iter::adapters::map::Map<core[a28e3aee1dd4a69e]::slice::iter::Iter<rustc_middle[e9b4372b5e8bc47d]::mir::mono::CodegenUnit>, rustc_codegen_cranelift[e80a840dcfedcc0]::driver::aot::run_aot::{closure#0}::{closure#0}>>>::spec_extend
                               at /home/matthias/vcs/github/rust_debug_assertions/library/alloc/src/vec/spec_extend.rs:26:9
  34:     0x7f508d8c1aec - <alloc[8442e47aebcde8b2]::vec::Vec<rustc_codegen_cranelift[e80a840dcfedcc0]::driver::aot::OngoingModuleCodegen> as alloc[8442e47aebcde8b2]::vec::spec_from_iter_nested::SpecFromIterNested<rustc_codegen_cranelift[e80a840dcfedcc0]::driver::aot::OngoingModuleCodegen, core[a28e3aee1dd4a69e]::iter::adapters::map::Map<core[a28e3aee1dd4a69e]::slice::iter::Iter<rustc_middle[e9b4372b5e8bc47d]::mir::mono::CodegenUnit>, rustc_codegen_cranelift[e80a840dcfedcc0]::driver::aot::run_aot::{closure#0}::{closure#0}>>>::from_iter
                               at /home/matthias/vcs/github/rust_debug_assertions/library/alloc/src/vec/spec_from_iter_nested.rs:62:9
  35:     0x7f508d8c1aec - <alloc[8442e47aebcde8b2]::vec::Vec<rustc_codegen_cranelift[e80a840dcfedcc0]::driver::aot::OngoingModuleCodegen> as alloc[8442e47aebcde8b2]::vec::spec_from_iter::SpecFromIter<rustc_codegen_cranelift[e80a840dcfedcc0]::driver::aot::OngoingModuleCodegen, core[a28e3aee1dd4a69e]::iter::adapters::map::Map<core[a28e3aee1dd4a69e]::slice::iter::Iter<rustc_middle[e9b4372b5e8bc47d]::mir::mono::CodegenUnit>, rustc_codegen_cranelift[e80a840dcfedcc0]::driver::aot::run_aot::{closure#0}::{closure#0}>>>::from_iter
                               at /home/matthias/vcs/github/rust_debug_assertions/library/alloc/src/vec/spec_from_iter.rs:33:9
  36:     0x7f508d9042de - <alloc[8442e47aebcde8b2]::vec::Vec<rustc_codegen_cranelift[e80a840dcfedcc0]::driver::aot::OngoingModuleCodegen> as core[a28e3aee1dd4a69e]::iter::traits::collect::FromIterator<rustc_codegen_cranelift[e80a840dcfedcc0]::driver::aot::OngoingModuleCodegen>>::from_iter::<core[a28e3aee1dd4a69e]::iter::adapters::map::Map<core[a28e3aee1dd4a69e]::slice::iter::Iter<rustc_middle[e9b4372b5e8bc47d]::mir::mono::CodegenUnit>, rustc_codegen_cranelift[e80a840dcfedcc0]::driver::aot::run_aot::{closure#0}::{closure#0}>>
                               at /home/matthias/vcs/github/rust_debug_assertions/library/alloc/src/vec/mod.rs:2748:9
  37:     0x7f508d9042de - <core[a28e3aee1dd4a69e]::iter::adapters::map::Map<core[a28e3aee1dd4a69e]::slice::iter::Iter<rustc_middle[e9b4372b5e8bc47d]::mir::mono::CodegenUnit>, rustc_codegen_cranelift[e80a840dcfedcc0]::driver::aot::run_aot::{closure#0}::{closure#0}> as core[a28e3aee1dd4a69e]::iter::traits::iterator::Iterator>::collect::<alloc[8442e47aebcde8b2]::vec::Vec<rustc_codegen_cranelift[e80a840dcfedcc0]::driver::aot::OngoingModuleCodegen>>
                               at /home/matthias/vcs/github/rust_debug_assertions/library/core/src/iter/traits/iterator.rs:1837:9
  38:     0x7f508d9042de - rustc_codegen_cranelift[e80a840dcfedcc0]::driver::aot::run_aot::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_codegen_cranelift/src/driver/aot.rs:365:9
  39:     0x7f508d9042de - <rustc_data_structures[e855f16069d18ad7]::profiling::VerboseTimingGuard>::run::<alloc[8442e47aebcde8b2]::vec::Vec<rustc_codegen_cranelift[e80a840dcfedcc0]::driver::aot::OngoingModuleCodegen>, rustc_codegen_cranelift[e80a840dcfedcc0]::driver::aot::run_aot::{closure#0}>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_data_structures/src/profiling.rs:726:9
  40:     0x7f508d9042de - <rustc_session[bd0fec20e3e30607]::session::Session>::time::<alloc[8442e47aebcde8b2]::vec::Vec<rustc_codegen_cranelift[e80a840dcfedcc0]::driver::aot::OngoingModuleCodegen>, rustc_codegen_cranelift[e80a840dcfedcc0]::driver::aot::run_aot::{closure#0}>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_session/src/utils.rs:10:9
  41:     0x7f508d9042de - rustc_codegen_cranelift[e80a840dcfedcc0]::driver::time::<alloc[8442e47aebcde8b2]::vec::Vec<rustc_codegen_cranelift[e80a840dcfedcc0]::driver::aot::OngoingModuleCodegen>, rustc_codegen_cranelift[e80a840dcfedcc0]::driver::aot::run_aot::{closure#0}>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_codegen_cranelift/src/driver/mod.rs:52:9
  42:     0x7f508d984039 - rustc_codegen_cranelift[e80a840dcfedcc0]::driver::aot::run_aot
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_codegen_cranelift/src/driver/aot.rs:364:19
  43:     0x7f508d9a203e - <rustc_codegen_cranelift[e80a840dcfedcc0]::CraneliftCodegenBackend as rustc_codegen_ssa[f201c9901f3e77a7]::traits::backend::CodegenBackend>::codegen_crate
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_codegen_cranelift/src/lib.rs:205:33
  44:     0x7f509775aceb - rustc_interface[198cb90d51a3ad9]::passes::start_codegen::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_interface/src/passes.rs:989:9
  45:     0x7f509775aceb - <rustc_data_structures[e855f16069d18ad7]::profiling::VerboseTimingGuard>::run::<alloc[8442e47aebcde8b2]::boxed::Box<dyn core[a28e3aee1dd4a69e]::any::Any>, rustc_interface[198cb90d51a3ad9]::passes::start_codegen::{closure#0}>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_data_structures/src/profiling.rs:726:9
  46:     0x7f509775aceb - <rustc_session[bd0fec20e3e30607]::session::Session>::time::<alloc[8442e47aebcde8b2]::boxed::Box<dyn core[a28e3aee1dd4a69e]::any::Any>, rustc_interface[198cb90d51a3ad9]::passes::start_codegen::{closure#0}>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_session/src/utils.rs:10:9
  47:     0x7f509775aceb - rustc_interface[198cb90d51a3ad9]::passes::start_codegen
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_interface/src/passes.rs:988:19
  48:     0x7f5097759bce - <rustc_interface[198cb90d51a3ad9]::queries::Queries>::ongoing_codegen::{closure#0}::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_interface/src/queries.rs:253:20
  49:     0x7f5097759bce - <rustc_interface[198cb90d51a3ad9]::passes::QueryContext>::enter::<<rustc_interface[198cb90d51a3ad9]::queries::Queries>::ongoing_codegen::{closure#0}::{closure#0}, core[a28e3aee1dd4a69e]::result::Result<alloc[8442e47aebcde8b2]::boxed::Box<dyn core[a28e3aee1dd4a69e]::any::Any>, rustc_errors[cecb0e7535209709]::ErrorGuaranteed>>::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_interface/src/passes.rs:765:42
  50:     0x7f5097759bce - rustc_middle[e9b4372b5e8bc47d]::ty::context::tls::enter_context::<<rustc_interface[198cb90d51a3ad9]::passes::QueryContext>::enter<<rustc_interface[198cb90d51a3ad9]::queries::Queries>::ongoing_codegen::{closure#0}::{closure#0}, core[a28e3aee1dd4a69e]::result::Result<alloc[8442e47aebcde8b2]::boxed::Box<dyn core[a28e3aee1dd4a69e]::any::Any>, rustc_errors[cecb0e7535209709]::ErrorGuaranteed>>::{closure#0}, core[a28e3aee1dd4a69e]::result::Result<alloc[8442e47aebcde8b2]::boxed::Box<dyn core[a28e3aee1dd4a69e]::any::Any>, rustc_errors[cecb0e7535209709]::ErrorGuaranteed>>::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_middle/src/ty/context.rs:1311:50
  51:     0x7f5097759bce - rustc_middle[e9b4372b5e8bc47d]::ty::context::tls::set_tlv::<rustc_middle[e9b4372b5e8bc47d]::ty::context::tls::enter_context<<rustc_interface[198cb90d51a3ad9]::passes::QueryContext>::enter<<rustc_interface[198cb90d51a3ad9]::queries::Queries>::ongoing_codegen::{closure#0}::{closure#0}, core[a28e3aee1dd4a69e]::result::Result<alloc[8442e47aebcde8b2]::boxed::Box<dyn core[a28e3aee1dd4a69e]::any::Any>, rustc_errors[cecb0e7535209709]::ErrorGuaranteed>>::{closure#0}, core[a28e3aee1dd4a69e]::result::Result<alloc[8442e47aebcde8b2]::boxed::Box<dyn core[a28e3aee1dd4a69e]::any::Any>, rustc_errors[cecb0e7535209709]::ErrorGuaranteed>>::{closure#0}, core[a28e3aee1dd4a69e]::result::Result<alloc[8442e47aebcde8b2]::boxed::Box<dyn core[a28e3aee1dd4a69e]::any::Any>, rustc_errors[cecb0e7535209709]::ErrorGuaranteed>>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_middle/src/ty/context.rs:1295:9
  52:     0x7f5097759bce - rustc_middle[e9b4372b5e8bc47d]::ty::context::tls::enter_context::<<rustc_interface[198cb90d51a3ad9]::passes::QueryContext>::enter<<rustc_interface[198cb90d51a3ad9]::queries::Queries>::ongoing_codegen::{closure#0}::{closure#0}, core[a28e3aee1dd4a69e]::result::Result<alloc[8442e47aebcde8b2]::boxed::Box<dyn core[a28e3aee1dd4a69e]::any::Any>, rustc_errors[cecb0e7535209709]::ErrorGuaranteed>>::{closure#0}, core[a28e3aee1dd4a69e]::result::Result<alloc[8442e47aebcde8b2]::boxed::Box<dyn core[a28e3aee1dd4a69e]::any::Any>, rustc_errors[cecb0e7535209709]::ErrorGuaranteed>>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_middle/src/ty/context.rs:1311:9
  53:     0x7f5097759bce - <rustc_interface[198cb90d51a3ad9]::passes::QueryContext>::enter::<<rustc_interface[198cb90d51a3ad9]::queries::Queries>::ongoing_codegen::{closure#0}::{closure#0}, core[a28e3aee1dd4a69e]::result::Result<alloc[8442e47aebcde8b2]::boxed::Box<dyn core[a28e3aee1dd4a69e]::any::Any>, rustc_errors[cecb0e7535209709]::ErrorGuaranteed>>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_interface/src/passes.rs:765:9
  54:     0x7f50977eba6a - <rustc_interface[198cb90d51a3ad9]::queries::Queries>::ongoing_codegen::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_interface/src/queries.rs:240:13
  55:     0x7f50977eba6a - <core[a28e3aee1dd4a69e]::option::Option<core[a28e3aee1dd4a69e]::result::Result<alloc[8442e47aebcde8b2]::boxed::Box<dyn core[a28e3aee1dd4a69e]::any::Any>, rustc_errors[cecb0e7535209709]::ErrorGuaranteed>>>::get_or_insert_with::<<rustc_interface[198cb90d51a3ad9]::queries::Queries>::ongoing_codegen::{closure#0}>
                               at /home/matthias/vcs/github/rust_debug_assertions/library/core/src/option.rs:1590:49
  56:     0x7f50977eba6a - <rustc_interface[198cb90d51a3ad9]::queries::Query<alloc[8442e47aebcde8b2]::boxed::Box<dyn core[a28e3aee1dd4a69e]::any::Any>>>::compute::<<rustc_interface[198cb90d51a3ad9]::queries::Queries>::ongoing_codegen::{closure#0}>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_interface/src/queries.rs:38:9
  57:     0x7f50977eba6a - <rustc_interface[198cb90d51a3ad9]::queries::Queries>::ongoing_codegen
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_interface/src/queries.rs:239:9
  58:     0x7f5096b85449 - rustc_driver[388e45bfc77c8dd2]::run_compiler::{closure#1}::{closure#2}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_driver/src/lib.rs:395:13
  59:     0x7f5096b85449 - <rustc_interface[198cb90d51a3ad9]::interface::Compiler>::enter::<rustc_driver[388e45bfc77c8dd2]::run_compiler::{closure#1}::{closure#2}, core[a28e3aee1dd4a69e]::result::Result<core[a28e3aee1dd4a69e]::option::Option<rustc_interface[198cb90d51a3ad9]::queries::Linker>, rustc_errors[cecb0e7535209709]::ErrorGuaranteed>>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_interface/src/queries.rs:380:19
  60:     0x7f5096af5cdc - rustc_driver[388e45bfc77c8dd2]::run_compiler::{closure#1}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_driver/src/lib.rs:306:22
  61:     0x7f5096af5cdc - rustc_interface[198cb90d51a3ad9]::interface::run_compiler::<core[a28e3aee1dd4a69e]::result::Result<(), rustc_errors[cecb0e7535209709]::ErrorGuaranteed>, rustc_driver[388e45bfc77c8dd2]::run_compiler::{closure#1}>::{closure#0}::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_interface/src/interface.rs:327:21
  62:     0x7f5096af5cdc - rustc_span[8293014313a13715]::with_source_map::<core[a28e3aee1dd4a69e]::result::Result<(), rustc_errors[cecb0e7535209709]::ErrorGuaranteed>, rustc_interface[198cb90d51a3ad9]::interface::run_compiler<core[a28e3aee1dd4a69e]::result::Result<(), rustc_errors[cecb0e7535209709]::ErrorGuaranteed>, rustc_driver[388e45bfc77c8dd2]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_span/src/lib.rs:1023:5
  63:     0x7f5096b7400a - rustc_interface[198cb90d51a3ad9]::interface::run_compiler::<core[a28e3aee1dd4a69e]::result::Result<(), rustc_errors[cecb0e7535209709]::ErrorGuaranteed>, rustc_driver[388e45bfc77c8dd2]::run_compiler::{closure#1}>::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_interface/src/interface.rs:321:13
  64:     0x7f5096b7400a - <scoped_tls[b7a439aa38053655]::ScopedKey<rustc_span[8293014313a13715]::SessionGlobals>>::set::<rustc_interface[198cb90d51a3ad9]::interface::run_compiler<core[a28e3aee1dd4a69e]::result::Result<(), rustc_errors[cecb0e7535209709]::ErrorGuaranteed>, rustc_driver[388e45bfc77c8dd2]::run_compiler::{closure#1}>::{closure#0}, core[a28e3aee1dd4a69e]::result::Result<(), rustc_errors[cecb0e7535209709]::ErrorGuaranteed>>
                               at /home/matthias/.cargo/registry/src/github.com-1ecc6299db9ec823/scoped-tls-1.0.0/src/lib.rs:137:9
  65:     0x7f5096b2433f - rustc_span[8293014313a13715]::create_session_globals_then::<core[a28e3aee1dd4a69e]::result::Result<(), rustc_errors[cecb0e7535209709]::ErrorGuaranteed>, rustc_interface[198cb90d51a3ad9]::interface::run_compiler<core[a28e3aee1dd4a69e]::result::Result<(), rustc_errors[cecb0e7535209709]::ErrorGuaranteed>, rustc_driver[388e45bfc77c8dd2]::run_compiler::{closure#1}>::{closure#0}>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_span/src/lib.rs:111:5
  66:     0x7f5096b2433f - rustc_interface[198cb90d51a3ad9]::util::run_in_thread_pool_with_globals::<rustc_interface[198cb90d51a3ad9]::interface::run_compiler<core[a28e3aee1dd4a69e]::result::Result<(), rustc_errors[cecb0e7535209709]::ErrorGuaranteed>, rustc_driver[388e45bfc77c8dd2]::run_compiler::{closure#1}>::{closure#0}, core[a28e3aee1dd4a69e]::result::Result<(), rustc_errors[cecb0e7535209709]::ErrorGuaranteed>>::{closure#0}::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_interface/src/util.rs:145:38
  67:     0x7f5096b2433f - std[898f9bf6a8d0f504]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[198cb90d51a3ad9]::util::run_in_thread_pool_with_globals<rustc_interface[198cb90d51a3ad9]::interface::run_compiler<core[a28e3aee1dd4a69e]::result::Result<(), rustc_errors[cecb0e7535209709]::ErrorGuaranteed>, rustc_driver[388e45bfc77c8dd2]::run_compiler::{closure#1}>::{closure#0}, core[a28e3aee1dd4a69e]::result::Result<(), rustc_errors[cecb0e7535209709]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[a28e3aee1dd4a69e]::result::Result<(), rustc_errors[cecb0e7535209709]::ErrorGuaranteed>>
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/sys_common/backtrace.rs:121:18
  68:     0x7f5096b0c7e1 - <std[898f9bf6a8d0f504]::thread::Builder>::spawn_unchecked_::<rustc_interface[198cb90d51a3ad9]::util::run_in_thread_pool_with_globals<rustc_interface[198cb90d51a3ad9]::interface::run_compiler<core[a28e3aee1dd4a69e]::result::Result<(), rustc_errors[cecb0e7535209709]::ErrorGuaranteed>, rustc_driver[388e45bfc77c8dd2]::run_compiler::{closure#1}>::{closure#0}, core[a28e3aee1dd4a69e]::result::Result<(), rustc_errors[cecb0e7535209709]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[a28e3aee1dd4a69e]::result::Result<(), rustc_errors[cecb0e7535209709]::ErrorGuaranteed>>::{closure#1}::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/thread/mod.rs:550:17
  69:     0x7f5096b0c7e1 - <core[a28e3aee1dd4a69e]::panic::unwind_safe::AssertUnwindSafe<<std[898f9bf6a8d0f504]::thread::Builder>::spawn_unchecked_<rustc_interface[198cb90d51a3ad9]::util::run_in_thread_pool_with_globals<rustc_interface[198cb90d51a3ad9]::interface::run_compiler<core[a28e3aee1dd4a69e]::result::Result<(), rustc_errors[cecb0e7535209709]::ErrorGuaranteed>, rustc_driver[388e45bfc77c8dd2]::run_compiler::{closure#1}>::{closure#0}, core[a28e3aee1dd4a69e]::result::Result<(), rustc_errors[cecb0e7535209709]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[a28e3aee1dd4a69e]::result::Result<(), rustc_errors[cecb0e7535209709]::ErrorGuaranteed>>::{closure#1}::{closure#0}> as core[a28e3aee1dd4a69e]::ops::function::FnOnce<()>>::call_once
                               at /home/matthias/vcs/github/rust_debug_assertions/library/core/src/panic/unwind_safe.rs:271:9
  70:     0x7f5096b0c7e1 - std[898f9bf6a8d0f504]::panicking::try::do_call::<core[a28e3aee1dd4a69e]::panic::unwind_safe::AssertUnwindSafe<<std[898f9bf6a8d0f504]::thread::Builder>::spawn_unchecked_<rustc_interface[198cb90d51a3ad9]::util::run_in_thread_pool_with_globals<rustc_interface[198cb90d51a3ad9]::interface::run_compiler<core[a28e3aee1dd4a69e]::result::Result<(), rustc_errors[cecb0e7535209709]::ErrorGuaranteed>, rustc_driver[388e45bfc77c8dd2]::run_compiler::{closure#1}>::{closure#0}, core[a28e3aee1dd4a69e]::result::Result<(), rustc_errors[cecb0e7535209709]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[a28e3aee1dd4a69e]::result::Result<(), rustc_errors[cecb0e7535209709]::ErrorGuaranteed>>::{closure#1}::{closure#0}>, core[a28e3aee1dd4a69e]::result::Result<(), rustc_errors[cecb0e7535209709]::ErrorGuaranteed>>
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/panicking.rs:483:40
  71:     0x7f5096b0c7e1 - std[898f9bf6a8d0f504]::panicking::try::<core[a28e3aee1dd4a69e]::result::Result<(), rustc_errors[cecb0e7535209709]::ErrorGuaranteed>, core[a28e3aee1dd4a69e]::panic::unwind_safe::AssertUnwindSafe<<std[898f9bf6a8d0f504]::thread::Builder>::spawn_unchecked_<rustc_interface[198cb90d51a3ad9]::util::run_in_thread_pool_with_globals<rustc_interface[198cb90d51a3ad9]::interface::run_compiler<core[a28e3aee1dd4a69e]::result::Result<(), rustc_errors[cecb0e7535209709]::ErrorGuaranteed>, rustc_driver[388e45bfc77c8dd2]::run_compiler::{closure#1}>::{closure#0}, core[a28e3aee1dd4a69e]::result::Result<(), rustc_errors[cecb0e7535209709]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[a28e3aee1dd4a69e]::result::Result<(), rustc_errors[cecb0e7535209709]::ErrorGuaranteed>>::{closure#1}::{closure#0}>>
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/panicking.rs:447:19
  72:     0x7f5096b0c7e1 - std[898f9bf6a8d0f504]::panic::catch_unwind::<core[a28e3aee1dd4a69e]::panic::unwind_safe::AssertUnwindSafe<<std[898f9bf6a8d0f504]::thread::Builder>::spawn_unchecked_<rustc_interface[198cb90d51a3ad9]::util::run_in_thread_pool_with_globals<rustc_interface[198cb90d51a3ad9]::interface::run_compiler<core[a28e3aee1dd4a69e]::result::Result<(), rustc_errors[cecb0e7535209709]::ErrorGuaranteed>, rustc_driver[388e45bfc77c8dd2]::run_compiler::{closure#1}>::{closure#0}, core[a28e3aee1dd4a69e]::result::Result<(), rustc_errors[cecb0e7535209709]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[a28e3aee1dd4a69e]::result::Result<(), rustc_errors[cecb0e7535209709]::ErrorGuaranteed>>::{closure#1}::{closure#0}>, core[a28e3aee1dd4a69e]::result::Result<(), rustc_errors[cecb0e7535209709]::ErrorGuaranteed>>
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/panic.rs:137:14
  73:     0x7f5096b0c7e1 - <std[898f9bf6a8d0f504]::thread::Builder>::spawn_unchecked_::<rustc_interface[198cb90d51a3ad9]::util::run_in_thread_pool_with_globals<rustc_interface[198cb90d51a3ad9]::interface::run_compiler<core[a28e3aee1dd4a69e]::result::Result<(), rustc_errors[cecb0e7535209709]::ErrorGuaranteed>, rustc_driver[388e45bfc77c8dd2]::run_compiler::{closure#1}>::{closure#0}, core[a28e3aee1dd4a69e]::result::Result<(), rustc_errors[cecb0e7535209709]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[a28e3aee1dd4a69e]::result::Result<(), rustc_errors[cecb0e7535209709]::ErrorGuaranteed>>::{closure#1}
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/thread/mod.rs:549:30
  74:     0x7f5096b0c7e1 - <<std[898f9bf6a8d0f504]::thread::Builder>::spawn_unchecked_<rustc_interface[198cb90d51a3ad9]::util::run_in_thread_pool_with_globals<rustc_interface[198cb90d51a3ad9]::interface::run_compiler<core[a28e3aee1dd4a69e]::result::Result<(), rustc_errors[cecb0e7535209709]::ErrorGuaranteed>, rustc_driver[388e45bfc77c8dd2]::run_compiler::{closure#1}>::{closure#0}, core[a28e3aee1dd4a69e]::result::Result<(), rustc_errors[cecb0e7535209709]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[a28e3aee1dd4a69e]::result::Result<(), rustc_errors[cecb0e7535209709]::ErrorGuaranteed>>::{closure#1} as core[a28e3aee1dd4a69e]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/library/core/src/ops/function.rs:507:5
  75:     0x7f5093f235a8 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hbd90f1d7134662bc
                               at /home/matthias/vcs/github/rust_debug_assertions/library/alloc/src/boxed.rs:2000:9
  76:     0x7f5093f235a8 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h1ec077bbd6166474
                               at /home/matthias/vcs/github/rust_debug_assertions/library/alloc/src/boxed.rs:2000:9
  77:     0x7f5093f12de5 - std::sys::unix::thread::Thread::new::thread_start::h357b5324080a198e
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/sys/unix/thread.rs:108:17
  78:     0x7f509409f8fd - <unknown>
  79:     0x7f5094121a60 - <unknown>
  80:                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.68.0-dev running on x86_64-unknown-linux-gnu

note: compiler flags: -Z codegen-backend=cranelift

query stack during panic:
end of query stack
warning: 2 warnings emitted
@bjorn3
Copy link
Member

bjorn3 commented Dec 20, 2022

Reduced to:

#![feature(no_core, lang_items, start)]
#![no_core]

#[link(name = "c")]
extern "C" {}

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

#[lang = "start"]
fn start<T>(_main: fn() -> T, _argc: isize, _argv: *const *const u8) -> isize {
    0
}

fn main() {}

The issue is the missing sigpipe: u8 argument for start. While cg_llvm doesn't crash on it, it does pass one argument too much to start. I think rustc will need to verify the signature of start.

@bjorn3
Copy link
Member

bjorn3 commented Dec 20, 2022

Closing in favor of rust-lang/rust#105963.

@bjorn3 bjorn3 closed this as completed Dec 20, 2022
@bjorn3
Copy link
Member

bjorn3 commented Jan 13, 2023

Fixed by rust-lang/rust#106092. Will be pulled in with the next subtree sync (which is blocked on a rustc regression).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants