rust-clippy/tests/ui/clone_on_copy_impl.rs

25 lines
428 B
Rust
Raw Normal View History

2023-06-13 10:25:49 +00:00
#![allow(clippy::incorrect_clone_impl_on_copy_type)]
use std::fmt;
2018-12-09 22:26:16 +00:00
use std::marker::PhantomData;
pub struct Key<T> {
#[doc(hidden)]
pub __name: &'static str,
#[doc(hidden)]
pub __phantom: PhantomData<T>,
}
impl<T> Copy for Key<T> {}
impl<T> Clone for Key<T> {
fn clone(&self) -> Self {
Key {
__name: self.__name,
__phantom: self.__phantom,
}
}
}
fn main() {}