mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-18 03:25:55 +00:00
20 lines
475 B
Rust
20 lines
475 B
Rust
|
// run-rustfix
|
||
|
|
||
|
#[derive(Clone)]
|
||
|
struct Wrapper<T>(T);
|
||
|
|
||
|
struct OnlyCopyIfDisplay<T>(std::marker::PhantomData<T>);
|
||
|
|
||
|
impl<T: std::fmt::Display> Clone for OnlyCopyIfDisplay<T> {
|
||
|
fn clone(&self) -> Self {
|
||
|
OnlyCopyIfDisplay(std::marker::PhantomData)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
impl<T: std::fmt::Display> Copy for OnlyCopyIfDisplay<T> {}
|
||
|
|
||
|
impl<S: std::fmt::Display> Copy for Wrapper<OnlyCopyIfDisplay<S>> {}
|
||
|
//~^ ERROR the trait `Copy` may not be implemented for this type
|
||
|
|
||
|
fn main() {}
|