Closed
Description
Code
#![feature(dyn_star, pointer_like_trait)]
#![allow(incomplete_features)]
use std::fmt::Debug;
use std::marker::PointerLike;
fn make_dyn_star<'a>(t: impl PointerLike + Debug + 'a) -> dyn* Debug + 'a {
f32::from_bits(0x1) as f64
}
fn main() {
println!("{:?}", make_dyn_star(Box::new(1i32)));
}
Meta
rustc --version --verbose
:
rustc 1.72.0-nightly (5bd28f5ea 2023-06-28)
binary: rustc
commit-hash: 5bd28f5eac1ba3569bfa8d49ec3f5acbdfdff7a0
commit-date: 2023-06-28
host: x86_64-unknown-linux-gnu
release: 1.72.0-nightly
LLVM version: 16.0.5
Error output
<output>
Backtrace
warning: unused variable: `t`
--> /home/matthias/vcs/github/rust/tests/ui/icemaker/1B6F4BE7A19A78BF67365C0E743A9D8944440CAE9F9A87C6D5AAC0E868B26F86.rs:15:22
|
15 | fn make_dyn_star<'a>(t: impl PointerLike + Debug + 'a) -> dyn* Debug + 'a {
| ^ help: if this is intentional, prefix it with an underscore: `_t`
|
= note: `#[warn(unused_variables)]` on by default
error: internal compiler error: /rustc/5bd28f5eac1ba3569bfa8d49ec3f5acbdfdff7a0/compiler/rustc_codegen_ssa/src/base.rs:279:17: unexpected TypeKind for left-hand side of `dyn*` cast: Double
thread 'rustc' panicked at 'Box<dyn Any>', /rustc/5bd28f5eac1ba3569bfa8d49ec3f5acbdfdff7a0/compiler/rustc_errors/src/lib.rs:1650:9
stack backtrace:
0: 0x7f1bb3b67e31 - std::backtrace_rs::backtrace::libunwind::trace::h8bc3e596fd6e6181
at /rustc/5bd28f5eac1ba3569bfa8d49ec3f5acbdfdff7a0/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
1: 0x7f1bb3b67e31 - std::backtrace_rs::backtrace::trace_unsynchronized::h9a0656fedca2f962
at /rustc/5bd28f5eac1ba3569bfa8d49ec3f5acbdfdff7a0/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
2: 0x7f1bb3b67e31 - std::sys_common::backtrace::_print_fmt::h11ca79bc953fda0e
at /rustc/5bd28f5eac1ba3569bfa8d49ec3f5acbdfdff7a0/library/std/src/sys_common/backtrace.rs:65:5
3: 0x7f1bb3b67e31 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h23585af82c540d61
at /rustc/5bd28f5eac1ba3569bfa8d49ec3f5acbdfdff7a0/library/std/src/sys_common/backtrace.rs:44:22
4: 0x7f1bb3bc95df - core::fmt::rt::Argument::fmt::h1e7f4bcecbee3fbb
at /rustc/5bd28f5eac1ba3569bfa8d49ec3f5acbdfdff7a0/library/core/src/fmt/rt.rs:138:9
5: 0x7f1bb3bc95df - core::fmt::write::h41633f265152b738
at /rustc/5bd28f5eac1ba3569bfa8d49ec3f5acbdfdff7a0/library/core/src/fmt/mod.rs:1094:21
6: 0x7f1bb3b5a967 - std::io::Write::write_fmt::hdf9fdeebf4391d4c
at /rustc/5bd28f5eac1ba3569bfa8d49ec3f5acbdfdff7a0/library/std/src/io/mod.rs:1714:15
7: 0x7f1bb3b67c45 - std::sys_common::backtrace::_print::h0761f433dadea582
at /rustc/5bd28f5eac1ba3569bfa8d49ec3f5acbdfdff7a0/library/std/src/sys_common/backtrace.rs:47:5
8: 0x7f1bb3b67c45 - std::sys_common::backtrace::print::hffcd468cc9baf957
at /rustc/5bd28f5eac1ba3569bfa8d49ec3f5acbdfdff7a0/library/std/src/sys_common/backtrace.rs:34:9
9: 0x7f1bb3b6a9f3 - std::panicking::default_hook::{{closure}}::h70eb212f41458c90
at /rustc/5bd28f5eac1ba3569bfa8d49ec3f5acbdfdff7a0/library/std/src/panicking.rs:269:22
10: 0x7f1bb3b6a784 - std::panicking::default_hook::hf217f8886a1385fc
at /rustc/5bd28f5eac1ba3569bfa8d49ec3f5acbdfdff7a0/library/std/src/panicking.rs:288:9
11: 0x7f1bb6e2217b - <rustc_driver_impl[ea51492c730803db]::install_ice_hook::{closure#0} as core[6e72eb595340d7ba]::ops::function::FnOnce<(&core[6e72eb595340d7ba]::panic::panic_info::PanicInfo,)>>::call_once::{shim:vtable#0}
12: 0x7f1bb3b6b21e - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::hdf84d12f536c7065
at /rustc/5bd28f5eac1ba3569bfa8d49ec3f5acbdfdff7a0/library/alloc/src/boxed.rs:2024:9
13: 0x7f1bb3b6b21e - std::panicking::rust_panic_with_hook::h7901b0073bb3ed74
at /rustc/5bd28f5eac1ba3569bfa8d49ec3f5acbdfdff7a0/library/std/src/panicking.rs:709:13
14: 0x7f1bb72f6d91 - std[4a840e81aae3439]::panicking::begin_panic::<rustc_errors[74566eb9727f9d9c]::ExplicitBug>::{closure#0}
15: 0x7f1bb72f5106 - std[4a840e81aae3439]::sys_common::backtrace::__rust_end_short_backtrace::<std[4a840e81aae3439]::panicking::begin_panic<rustc_errors[74566eb9727f9d9c]::ExplicitBug>::{closure#0}, !>
16: 0x7f1bb72f4626 - std[4a840e81aae3439]::panicking::begin_panic::<rustc_errors[74566eb9727f9d9c]::ExplicitBug>
17: 0x7f1bb736ae94 - <rustc_errors[74566eb9727f9d9c]::HandlerInner>::bug::<alloc[6fd48550c51b5745]::string::String>
18: 0x7f1bb736ad16 - <rustc_errors[74566eb9727f9d9c]::Handler>::bug::<alloc[6fd48550c51b5745]::string::String>
19: 0x7f1bb72f204c - rustc_middle[9f74ec5cb00a905a]::util::bug::opt_span_bug_fmt::<rustc_span[624dabdd61f2978b]::span_encoding::Span>::{closure#0}
20: 0x7f1bb72f1f8a - rustc_middle[9f74ec5cb00a905a]::ty::context::tls::with_opt::<rustc_middle[9f74ec5cb00a905a]::util::bug::opt_span_bug_fmt<rustc_span[624dabdd61f2978b]::span_encoding::Span>::{closure#0}, !>::{closure#0}
21: 0x7f1bb72f1f5a - rustc_middle[9f74ec5cb00a905a]::ty::context::tls::with_context_opt::<rustc_middle[9f74ec5cb00a905a]::ty::context::tls::with_opt<rustc_middle[9f74ec5cb00a905a]::util::bug::opt_span_bug_fmt<rustc_span[624dabdd61f2978b]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
22: 0x7f1bb528cc4d - rustc_middle[9f74ec5cb00a905a]::util::bug::bug_fmt
23: 0x7f1bb6c877a8 - rustc_codegen_ssa[452061f54d1b0567]::base::cast_to_dyn_star::<rustc_codegen_llvm[b63e3bb365d5076c]::builder::Builder>
24: 0x7f1bb561c164 - <rustc_codegen_ssa[452061f54d1b0567]::mir::FunctionCx<rustc_codegen_llvm[b63e3bb365d5076c]::builder::Builder>>::codegen_rvalue_operand
25: 0x7f1bb55e6a34 - rustc_codegen_ssa[452061f54d1b0567]::mir::codegen_mir::<rustc_codegen_llvm[b63e3bb365d5076c]::builder::Builder>
26: 0x7f1bb625ca2a - rustc_codegen_llvm[b63e3bb365d5076c]::base::compile_codegen_unit::module_codegen
27: 0x7f1bb625aaa9 - rustc_codegen_llvm[b63e3bb365d5076c]::base::compile_codegen_unit
28: 0x7f1bb630c77d - rustc_codegen_ssa[452061f54d1b0567]::base::codegen_crate::<rustc_codegen_llvm[b63e3bb365d5076c]::LlvmCodegenBackend>
29: 0x7f1bb630c066 - <rustc_codegen_llvm[b63e3bb365d5076c]::LlvmCodegenBackend as rustc_codegen_ssa[452061f54d1b0567]::traits::backend::CodegenBackend>::codegen_crate
30: 0x7f1bb60c0282 - <rustc_session[a15a65f093e103e1]::session::Session>::time::<alloc[6fd48550c51b5745]::boxed::Box<dyn core[6e72eb595340d7ba]::any::Any>, rustc_interface[b943f00ad50b5541]::passes::start_codegen::{closure#0}>
31: 0x7f1bb60bfdcb - rustc_interface[b943f00ad50b5541]::passes::start_codegen
32: 0x7f1bb60b9f2a - <rustc_middle[9f74ec5cb00a905a]::ty::context::GlobalCtxt>::enter::<<rustc_interface[b943f00ad50b5541]::queries::Queries>::ongoing_codegen::{closure#0}, core[6e72eb595340d7ba]::result::Result<alloc[6fd48550c51b5745]::boxed::Box<dyn core[6e72eb595340d7ba]::any::Any>, rustc_span[624dabdd61f2978b]::ErrorGuaranteed>>
33: 0x7f1bb60b93a2 - <rustc_interface[b943f00ad50b5541]::interface::Compiler>::enter::<rustc_driver_impl[ea51492c730803db]::run_compiler::{closure#1}::{closure#2}, core[6e72eb595340d7ba]::result::Result<core[6e72eb595340d7ba]::option::Option<rustc_interface[b943f00ad50b5541]::queries::Linker>, rustc_span[624dabdd61f2978b]::ErrorGuaranteed>>
34: 0x7f1bb60b4575 - rustc_span[624dabdd61f2978b]::set_source_map::<core[6e72eb595340d7ba]::result::Result<(), rustc_span[624dabdd61f2978b]::ErrorGuaranteed>, rustc_interface[b943f00ad50b5541]::interface::run_compiler<core[6e72eb595340d7ba]::result::Result<(), rustc_span[624dabdd61f2978b]::ErrorGuaranteed>, rustc_driver_impl[ea51492c730803db]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
35: 0x7f1bb60b3996 - <scoped_tls[8088cff701f74b4a]::ScopedKey<rustc_span[624dabdd61f2978b]::SessionGlobals>>::set::<rustc_interface[b943f00ad50b5541]::interface::run_compiler<core[6e72eb595340d7ba]::result::Result<(), rustc_span[624dabdd61f2978b]::ErrorGuaranteed>, rustc_driver_impl[ea51492c730803db]::run_compiler::{closure#1}>::{closure#0}, core[6e72eb595340d7ba]::result::Result<(), rustc_span[624dabdd61f2978b]::ErrorGuaranteed>>
36: 0x7f1bb60b2f46 - std[4a840e81aae3439]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[b943f00ad50b5541]::util::run_in_thread_pool_with_globals<rustc_interface[b943f00ad50b5541]::interface::run_compiler<core[6e72eb595340d7ba]::result::Result<(), rustc_span[624dabdd61f2978b]::ErrorGuaranteed>, rustc_driver_impl[ea51492c730803db]::run_compiler::{closure#1}>::{closure#0}, core[6e72eb595340d7ba]::result::Result<(), rustc_span[624dabdd61f2978b]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[6e72eb595340d7ba]::result::Result<(), rustc_span[624dabdd61f2978b]::ErrorGuaranteed>>
37: 0x7f1bb60b2cee - <<std[4a840e81aae3439]::thread::Builder>::spawn_unchecked_<rustc_interface[b943f00ad50b5541]::util::run_in_thread_pool_with_globals<rustc_interface[b943f00ad50b5541]::interface::run_compiler<core[6e72eb595340d7ba]::result::Result<(), rustc_span[624dabdd61f2978b]::ErrorGuaranteed>, rustc_driver_impl[ea51492c730803db]::run_compiler::{closure#1}>::{closure#0}, core[6e72eb595340d7ba]::result::Result<(), rustc_span[624dabdd61f2978b]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[6e72eb595340d7ba]::result::Result<(), rustc_span[624dabdd61f2978b]::ErrorGuaranteed>>::{closure#1} as core[6e72eb595340d7ba]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
38: 0x7f1bb3b75695 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h61eb867555625a06
at /rustc/5bd28f5eac1ba3569bfa8d49ec3f5acbdfdff7a0/library/alloc/src/boxed.rs:2010:9
39: 0x7f1bb3b75695 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hb80c29f89b136b72
at /rustc/5bd28f5eac1ba3569bfa8d49ec3f5acbdfdff7a0/library/alloc/src/boxed.rs:2010:9
40: 0x7f1bb3b75695 - std::sys::unix::thread::Thread::new::thread_start::hf4205715d65b27a6
at /rustc/5bd28f5eac1ba3569bfa8d49ec3f5acbdfdff7a0/library/std/src/sys/unix/thread.rs:108:17
41: 0x7f1bb390d44b - <unknown>
42: 0x7f1bb3990e40 - <unknown>
43: 0x0 - <unknown>
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.72.0-nightly (5bd28f5ea 2023-06-28) running on x86_64-unknown-linux-gnu
query stack during panic:
end of query stack
error: aborting due to previous error; 1 warning emitted