Closed
Description
Code
fn main() {
println!("{:?}", {
type T = ();
pub fn cloneit (it: &'_ mut T) -> (&'_ mut T, &'_ mut T)
where
for<'any> &'any mut T : Clone, {
(it.clone(), it)
}
}); }
Meta
rustc --version --verbose
:
1.61.0-nightly (2022-03-05 c274e4969f058b1c6442)
Error output
Compiling playground v0.0.1 (/playground)
warning: type alias is never used: `T`
[--> src/main.rs:3:4
](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=4c9140e1c57f836e8185361ea26f0541#) |
3 | type T = ();
| ^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: function is never used: `clone`
[--> src/main.rs:5:13
](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=4c9140e1c57f836e8185361ea26f0541#) |
5 | pub fn clone (it: &'_ mut T) -> (&'_ mut T, &'_ mut T)
| ^^^^^
error: internal compiler error: no errors encountered even though `delay_span_bug` issued
error: internal compiler error: Encountered error `Unimplemented` selecting `Binder(<&mut () as std::clone::Clone>, [])` during codegen
|
= note: delayed at compiler/rustc_trait_selection/src/traits/codegen.rs:69:32
thread 'rustc' panicked at 'Box<dyn Any>', compiler/rustc_errors/src/lib.rs:1266:13
stack backtrace:
0: 0x7fce63604d2c - std::backtrace_rs::backtrace::libunwind::trace::hd9d6c66ed2138bb0
at /rustc/c274e4969f058b1c644243181ece9f829efa7594/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
1: 0x7fce63604d2c - std::backtrace_rs::backtrace::trace_unsynchronized::ha4edb04af5a111d2
at /rustc/c274e4969f058b1c644243181ece9f829efa7594/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
2: 0x7fce63604d2c - std::sys_common::backtrace::_print_fmt::h34bfe6ef54352a7f
at /rustc/c274e4969f058b1c644243181ece9f829efa7594/library/std/src/sys_common/backtrace.rs:66:5
3: 0x7fce63604d2c - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h91638cd7890644b7
at /rustc/c274e4969f058b1c644243181ece9f829efa7594/library/std/src/sys_common/backtrace.rs:45:22
4: 0x7fce6365ebec - core::fmt::write::h407f77bceaf22b75
at /rustc/c274e4969f058b1c644243181ece9f829efa7594/library/core/src/fmt/mod.rs:1190:17
5: 0x7fce635f5801 - std::io::Write::write_fmt::h85de75cd3cb86034
at /rustc/c274e4969f058b1c644243181ece9f829efa7594/library/std/src/io/mod.rs:1655:15
6: 0x7fce63607c65 - std::sys_common::backtrace::_print::h9303e0f315439c4b
at /rustc/c274e4969f058b1c644243181ece9f829efa7594/library/std/src/sys_common/backtrace.rs:48:5
7: 0x7fce63607c65 - std::sys_common::backtrace::print::h278cbd6c00b20bf7
at /rustc/c274e4969f058b1c644243181ece9f829efa7594/library/std/src/sys_common/backtrace.rs:35:9
8: 0x7fce63607c65 - std::panicking::default_hook::{{closure}}::h66dc8e0c0481f9ac
at /rustc/c274e4969f058b1c644243181ece9f829efa7594/library/std/src/panicking.rs:295:22
9: 0x7fce63607908 - std::panicking::default_hook::h3732f22170eb6fcb
at /rustc/c274e4969f058b1c644243181ece9f829efa7594/library/std/src/panicking.rs:314:9
10: 0x7fce63d9d4a1 - rustc_driver[a243c3d9738e9cda]::DEFAULT_HOOK::{closure#0}::{closure#0}
11: 0x7fce63608501 - std::panicking::rust_panic_with_hook::hfa6a9afb1a6b2eff
at /rustc/c274e4969f058b1c644243181ece9f829efa7594/library/std/src/panicking.rs:702:17
12: 0x7fce64e2dfb1 - std[54a224735ab911a]::panicking::begin_panic::<rustc_errors[e9d593471e7e5a86]::ExplicitBug>::{closure#0}
13: 0x7fce64e2dea6 - std[54a224735ab911a]::sys_common::backtrace::__rust_end_short_backtrace::<std[54a224735ab911a]::panicking::begin_panic<rustc_errors[e9d593471e7e5a86]::ExplicitBug>::{closure#0}, !>
14: 0x7fce64e348ef - std[54a224735ab911a]::panicking::begin_panic::<rustc_errors[e9d593471e7e5a86]::ExplicitBug>
15: 0x7fce64e41756 - std[54a224735ab911a]::panic::panic_any::<rustc_errors[e9d593471e7e5a86]::ExplicitBug>
16: 0x7fce664bd16e - <rustc_errors[e9d593471e7e5a86]::HandlerInner as core[f66f8263def5172a]::ops::drop::Drop>::drop
17: 0x7fce65bfb338 - core[f66f8263def5172a]::ptr::drop_in_place::<rustc_session[7e14f15cd8696afc]::parse::ParseSess>
18: 0x7fce65bfde8a - <alloc[16beeacba2f7b906]::rc::Rc<rustc_session[7e14f15cd8696afc]::session::Session> as core[f66f8263def5172a]::ops::drop::Drop>::drop
19: 0x7fce65be652d - core[f66f8263def5172a]::ptr::drop_in_place::<rustc_interface[ee304f5e577cf6b9]::interface::Compiler>
20: 0x7fce65be6033 - rustc_span[1b916fa4cb305af0]::with_source_map::<core[f66f8263def5172a]::result::Result<(), rustc_errors[e9d593471e7e5a86]::ErrorGuaranteed>, rustc_interface[ee304f5e577cf6b9]::interface::create_compiler_and_run<core[f66f8263def5172a]::result::Result<(), rustc_errors[e9d593471e7e5a86]::ErrorGuaranteed>, rustc_driver[a243c3d9738e9cda]::run_compiler::{closure#1}>::{closure#1}>
21: 0x7fce65bd3f24 - rustc_interface[ee304f5e577cf6b9]::interface::create_compiler_and_run::<core[f66f8263def5172a]::result::Result<(), rustc_errors[e9d593471e7e5a86]::ErrorGuaranteed>, rustc_driver[a243c3d9738e9cda]::run_compiler::{closure#1}>
22: 0x7fce65bd1f42 - <scoped_tls[a76d38c46f15ed9e]::ScopedKey<rustc_span[1b916fa4cb305af0]::SessionGlobals>>::set::<rustc_interface[ee304f5e577cf6b9]::interface::run_compiler<core[f66f8263def5172a]::result::Result<(), rustc_errors[e9d593471e7e5a86]::ErrorGuaranteed>, rustc_driver[a243c3d9738e9cda]::run_compiler::{closure#1}>::{closure#0}, core[f66f8263def5172a]::result::Result<(), rustc_errors[e9d593471e7e5a86]::ErrorGuaranteed>>
23: 0x7fce65bd021f - std[54a224735ab911a]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[ee304f5e577cf6b9]::util::run_in_thread_pool_with_globals<rustc_interface[ee304f5e577cf6b9]::interface::run_compiler<core[f66f8263def5172a]::result::Result<(), rustc_errors[e9d593471e7e5a86]::ErrorGuaranteed>, rustc_driver[a243c3d9738e9cda]::run_compiler::{closure#1}>::{closure#0}, core[f66f8263def5172a]::result::Result<(), rustc_errors[e9d593471e7e5a86]::ErrorGuaranteed>>::{closure#0}, core[f66f8263def5172a]::result::Result<(), rustc_errors[e9d593471e7e5a86]::ErrorGuaranteed>>
24: 0x7fce65bd0509 - <<std[54a224735ab911a]::thread::Builder>::spawn_unchecked_<rustc_interface[ee304f5e577cf6b9]::util::run_in_thread_pool_with_globals<rustc_interface[ee304f5e577cf6b9]::interface::run_compiler<core[f66f8263def5172a]::result::Result<(), rustc_errors[e9d593471e7e5a86]::ErrorGuaranteed>, rustc_driver[a243c3d9738e9cda]::run_compiler::{closure#1}>::{closure#0}, core[f66f8263def5172a]::result::Result<(), rustc_errors[e9d593471e7e5a86]::ErrorGuaranteed>>::{closure#0}, core[f66f8263def5172a]::result::Result<(), rustc_errors[e9d593471e7e5a86]::ErrorGuaranteed>>::{closure#1} as core[f66f8263def5172a]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
25: 0x7fce636128c3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hb7ce1f9a74daab59
at /rustc/c274e4969f058b1c644243181ece9f829efa7594/library/alloc/src/boxed.rs:1854:9
26: 0x7fce636128c3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hc28d1f774d95b80d
at /rustc/c274e4969f058b1c644243181ece9f829efa7594/library/alloc/src/boxed.rs:1854:9
27: 0x7fce636128c3 - std::sys::unix::thread::Thread::new::thread_start::h7c8916b17d3c6d45
at /rustc/c274e4969f058b1c644243181ece9f829efa7594/library/std/src/sys/unix/thread.rs:108:17
28: 0x7fce63542609 - start_thread
29: 0x7fce6345b163 - clone
30: 0x0 - <unknown>
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.61.0-nightly (c274e4969 2022-03-05) running on x86_64-unknown-linux-gnu
note: compiler flags: --crate-type bin -C embed-bitcode=no -C codegen-units=1 -C debuginfo=2
note: some of the compiler flags provided by cargo are hidden
query stack during panic:
end of query stack
warning: `playground` (bin "playground") generated 2 warnings
error: could not compile `playground`; 2 warnings emitted