Closed
Description
From https://www.reddit.com/r/rust/comments/616rc8/rcpp_discusses_rust/dfcjk09/
The following code:
fn clone_copy_type<T: Copy>(t: T) -> T {
t.clone()
}
fn main() {
// [_; 33] implements Copy, but not Clone, violating trait inheritance
clone_copy_type([(); 33]);
}
Causes the following crash in playpen, due to [T; 33]
(where T: Copy
) implementing Copy
, but not Clone
, but Copy
trait requiring Clone
implementation.
error: internal compiler error: /checkout/src/librustc_trans/monomorphize.rs:151: Encountered error `Unimplemented` selecting `Binder(<[(); 33] as std::clone::Clone>)` during trans
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
thread 'rustc' panicked at 'Box<Any>', /checkout/src/librustc_errors/lib.rs:377
note: Run with `RUST_BACKTRACE=1` for a backtrace.