Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //#[derive(Clone, Copy)]
- struct Copyable<'a, N: 'static> {
- #[allow(dead_code)]
- field: &'a N,
- }
- impl<'a, N> Clone for Copyable<'a, N> {
- fn clone(&self) -> Self {
- *self
- }
- }
- impl<'a, N> Copy for Copyable<'a, N> {
- }
- struct NonCopy;
- fn main() {
- let thing = NonCopy;
- let copyable = Copyable {
- field: &thing,
- };
- drop(copyable);
- drop(copyable);
- }
Add Comment
Please, Sign In to add comment