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: bx.cx().is_backend_scalar_pair(cast): dyn star #104794

Closed
matthiaskrgr opened this issue Nov 23, 2022 · 1 comment · Fixed by #104594
Closed

ICE: bx.cx().is_backend_scalar_pair(cast): dyn star #104794

matthiaskrgr opened this issue Nov 23, 2022 · 1 comment · Fixed by #104594
Assignees
Labels
C-bug Category: This is a bug. F-dyn_star `#![feature(dyn_star)]` 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

@matthiaskrgr
Copy link
Member

Code

./src/test/ui/dyn-star/dont-unsize-coerce-dyn-star.rs

// check-pass

#![feature(dyn_star)]
#![allow(incomplete_features)]

trait AddOne {
    fn add1(&mut self) -> usize;
}

impl AddOne for usize {
    fn add1(&mut self) -> usize {
        *self += 1;
        *self
    }
}

fn add_one(i: &mut (dyn* AddOne + '_)) -> usize {
    i.add1()
}

fn main() {
    let mut x = 42usize as dyn* AddOne;

    println!("{}", add_one(&mut x));
    println!("{}", add_one(&mut x));
}

Meta

rustc --version --verbose:

rustc 1.67.0-nightly (ff8c8dfbe 2022-11-22)
binary: rustc
commit-hash: ff8c8dfbe66701531e3e5e335c28c544d0fbc945
commit-date: 2022-11-22
host: x86_64-unknown-linux-gnu
release: 1.67.0-nightly
LLVM version: 15.0.4

Error output

<output>
Backtrace

thread '<unnamed>' panicked at 'assertion failed: bx.cx().is_backend_scalar_pair(cast)', /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/compiler/rustc_codegen_ssa/src/mir/rvalue.rs:227:25
stack backtrace:
   0:     0x7f3aa9966240 - std::backtrace_rs::backtrace::libunwind::trace::h8706adb1093146ed
                               at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f3aa9966240 - std::backtrace_rs::backtrace::trace_unsynchronized::hf63de70ab53f1103
                               at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f3aa9966240 - std::sys_common::backtrace::_print_fmt::h5957d298699ffe59
                               at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7f3aa9966240 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hcd957416de719678
                               at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f3aa99c865e - core::fmt::write::h984028dcea06bcfd
                               at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/core/src/fmt/mod.rs:1208:17
   5:     0x7f3aa99566c5 - std::io::Write::write_fmt::he809968620ea8258
                               at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/std/src/io/mod.rs:1682:15
   6:     0x7f3aa9966005 - std::sys_common::backtrace::_print::hb0bd3686578e8d46
                               at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x7f3aa9966005 - std::sys_common::backtrace::print::hc5833b565793a292
                               at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x7f3aa9968d0f - std::panicking::default_hook::{{closure}}::h74c2f33bce600c62
                               at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/std/src/panicking.rs:267:22
   9:     0x7f3aa9968a4a - std::panicking::default_hook::hfe2fefb386033115
                               at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/std/src/panicking.rs:286:9
  10:     0x7f3aa996951c - std::panicking::rust_panic_with_hook::he2509c58eec530df
                               at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/std/src/panicking.rs:688:13
  11:     0x7f3aa9969271 - std::panicking::begin_panic_handler::{{closure}}::h119207ccf961ce41
                               at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/std/src/panicking.rs:577:13
  12:     0x7f3aa99666ec - std::sys_common::backtrace::__rust_end_short_backtrace::hcaa5a71abba4373d
                               at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/std/src/sys_common/backtrace.rs:137:18
  13:     0x7f3aa9968fd2 - rust_begin_unwind
                               at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/std/src/panicking.rs:575:5
  14:     0x7f3aa99c5033 - core::panicking::panic_fmt::hfba047ce4c50c7c1
                               at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/core/src/panicking.rs:65:14
  15:     0x7f3aa99c510d - core::panicking::panic::h1d3088ee0ec67c87
                               at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/core/src/panicking.rs:114:5
  16:     0x7f3aab17b14f - <rustc_codegen_ssa[e8308c49eae86124]::mir::FunctionCx<rustc_codegen_llvm[a7c379c6fc230ce8]::builder::Builder>>::codegen_block
  17:     0x7f3aab167134 - rustc_codegen_ssa[e8308c49eae86124]::mir::codegen_mir::<rustc_codegen_llvm[a7c379c6fc230ce8]::builder::Builder>
  18:     0x7f3aab65f529 - rustc_codegen_llvm[a7c379c6fc230ce8]::base::compile_codegen_unit::module_codegen
  19:     0x7f3aac2d0313 - <rustc_query_system[5a7ebb5f2835af36]::dep_graph::graph::DepGraph<rustc_middle[10860b0b9ad25f4]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[10860b0b9ad25f4]::ty::context::TyCtxt, rustc_span[452fb2538b9e8b2]::symbol::Symbol, rustc_codegen_ssa[e8308c49eae86124]::ModuleCodegen<rustc_codegen_llvm[a7c379c6fc230ce8]::ModuleLlvm>>
  20:     0x7f3aac2d002a - rustc_codegen_llvm[a7c379c6fc230ce8]::base::compile_codegen_unit
  21:     0x7f3aac2eb47b - rustc_codegen_ssa[e8308c49eae86124]::base::codegen_crate::<rustc_codegen_llvm[a7c379c6fc230ce8]::LlvmCodegenBackend>
  22:     0x7f3aac2eac39 - <rustc_codegen_llvm[a7c379c6fc230ce8]::LlvmCodegenBackend as rustc_codegen_ssa[e8308c49eae86124]::traits::backend::CodegenBackend>::codegen_crate
  23:     0x7f3aabee7fc1 - <rustc_session[60eb0f9dbaf3963]::session::Session>::time::<alloc[9f61cdb96537af8e]::boxed::Box<dyn core[f8fd3abe6b5d63cf]::any::Any>, rustc_interface[6b7eaaa4ad5b511f]::passes::start_codegen::{closure#0}>
  24:     0x7f3aabee7ab4 - rustc_interface[6b7eaaa4ad5b511f]::passes::start_codegen
  25:     0x7f3aabee1e70 - <rustc_interface[6b7eaaa4ad5b511f]::passes::QueryContext>::enter::<<rustc_interface[6b7eaaa4ad5b511f]::queries::Queries>::ongoing_codegen::{closure#0}::{closure#0}, core[f8fd3abe6b5d63cf]::result::Result<alloc[9f61cdb96537af8e]::boxed::Box<dyn core[f8fd3abe6b5d63cf]::any::Any>, rustc_errors[962da50c5f46999b]::ErrorGuaranteed>>
  26:     0x7f3aabedf273 - <rustc_interface[6b7eaaa4ad5b511f]::queries::Queries>::ongoing_codegen
  27:     0x7f3aabede382 - <rustc_interface[6b7eaaa4ad5b511f]::interface::Compiler>::enter::<rustc_driver[9074794128a33992]::run_compiler::{closure#1}::{closure#2}, core[f8fd3abe6b5d63cf]::result::Result<core[f8fd3abe6b5d63cf]::option::Option<rustc_interface[6b7eaaa4ad5b511f]::queries::Linker>, rustc_errors[962da50c5f46999b]::ErrorGuaranteed>>
  28:     0x7f3aabed9382 - rustc_span[452fb2538b9e8b2]::with_source_map::<core[f8fd3abe6b5d63cf]::result::Result<(), rustc_errors[962da50c5f46999b]::ErrorGuaranteed>, rustc_interface[6b7eaaa4ad5b511f]::interface::run_compiler<core[f8fd3abe6b5d63cf]::result::Result<(), rustc_errors[962da50c5f46999b]::ErrorGuaranteed>, rustc_driver[9074794128a33992]::run_compiler::{closure#1}>::{closure#0}::{closure#1}>
  29:     0x7f3aabed8e79 - <scoped_tls[d8d79e187ce2c7fa]::ScopedKey<rustc_span[452fb2538b9e8b2]::SessionGlobals>>::set::<rustc_interface[6b7eaaa4ad5b511f]::interface::run_compiler<core[f8fd3abe6b5d63cf]::result::Result<(), rustc_errors[962da50c5f46999b]::ErrorGuaranteed>, rustc_driver[9074794128a33992]::run_compiler::{closure#1}>::{closure#0}, core[f8fd3abe6b5d63cf]::result::Result<(), rustc_errors[962da50c5f46999b]::ErrorGuaranteed>>
  30:     0x7f3aabed8488 - std[1e9db942fc5862bc]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[6b7eaaa4ad5b511f]::util::run_in_thread_pool_with_globals<rustc_interface[6b7eaaa4ad5b511f]::interface::run_compiler<core[f8fd3abe6b5d63cf]::result::Result<(), rustc_errors[962da50c5f46999b]::ErrorGuaranteed>, rustc_driver[9074794128a33992]::run_compiler::{closure#1}>::{closure#0}, core[f8fd3abe6b5d63cf]::result::Result<(), rustc_errors[962da50c5f46999b]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[f8fd3abe6b5d63cf]::result::Result<(), rustc_errors[962da50c5f46999b]::ErrorGuaranteed>>
  31:     0x7f3aabed81ac - <<std[1e9db942fc5862bc]::thread::Builder>::spawn_unchecked_<rustc_interface[6b7eaaa4ad5b511f]::util::run_in_thread_pool_with_globals<rustc_interface[6b7eaaa4ad5b511f]::interface::run_compiler<core[f8fd3abe6b5d63cf]::result::Result<(), rustc_errors[962da50c5f46999b]::ErrorGuaranteed>, rustc_driver[9074794128a33992]::run_compiler::{closure#1}>::{closure#0}, core[f8fd3abe6b5d63cf]::result::Result<(), rustc_errors[962da50c5f46999b]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[f8fd3abe6b5d63cf]::result::Result<(), rustc_errors[962da50c5f46999b]::ErrorGuaranteed>>::{closure#1} as core[f8fd3abe6b5d63cf]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  32:     0x7f3aad9ca733 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h1b5a13ff0dfa7f2f
                               at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/alloc/src/boxed.rs:2000:9
  33:     0x7f3aad9ca733 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hba33c2ecbf5798cf
                               at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/alloc/src/boxed.rs:2000:9
  34:     0x7f3aad9ca733 - std::sys::unix::thread::Thread::new::thread_start::hb6c57436b925359e
                               at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/std/src/sys/unix/thread.rs:108:17
  35:     0x7f3aa96cd8fd - <unknown>
  36:     0x7f3aa974fa60 - <unknown>
  37:                0x0 - <unknown>

@matthiaskrgr matthiaskrgr added I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. C-bug Category: This is a bug. F-dyn_star `#![feature(dyn_star)]` labels Nov 23, 2022
@compiler-errors
Copy link
Member

Probably fixed by #104594, though I'll check later.

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. F-dyn_star `#![feature(dyn_star)]` 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

Successfully merging a pull request may close this issue.

2 participants