Closed
Description
Version: rustc 1.13.0-nightly (c772948 2016-09-20)
Test case:
#![feature(untagged_unions)]
#[repr(C)]
#[derive(Copy, Clone)]
pub struct Struct<T> {
pub inner: Union<T>,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union Union<T> {
pub foo: *mut (),
pub _phantom_0: ::std::marker::PhantomData<T>,
}
URL: https://is.gd/snf8Kb
Note that replacing the union
for an struct
works fine.
Result
error[E0277]: the trait bound `T: std::marker::Copy` is not satisfied
--> <anon>:6:5
|
6 | pub inner: Union<T>,
| ^^^^^^^^^^^^^^^^^^^ trait `T: std::marker::Copy` not satisfied
|
= help: consider adding a `where T: std::marker::Copy` bound
= note: required because of the requirements on the impl of `std::clone::Clone` for `Union<T>`
= note: required by `std::clone::Clone::clone`
Expected
No errors.
Metadata
Metadata
Assignees
Labels
No labels