@@ -82,11 +82,16 @@ macro_rules! s {
82
82
__item! {
83
83
#[ repr( C ) ]
84
84
#[ cfg_attr( feature = "extra_traits" , derive( Debug , Eq , Hash , PartialEq ) ) ]
85
- #[ derive( Copy , Clone ) ]
86
85
#[ allow( deprecated) ]
87
86
$( #[ $attr] ) *
88
87
pub struct $i { $( $field) * }
89
88
}
89
+ #[ allow( deprecated) ]
90
+ impl :: Copy for $i { }
91
+ #[ allow( deprecated) ]
92
+ impl :: Clone for $i {
93
+ fn clone( & self ) -> $i { * self }
94
+ }
90
95
) ;
91
96
}
92
97
@@ -101,10 +106,13 @@ macro_rules! s_paren {
101
106
) * ) => ( $(
102
107
__item! {
103
108
#[ cfg_attr( feature = "extra_traits" , derive( Debug , Eq , Hash , PartialEq ) ) ]
104
- #[ derive( Copy , Clone ) ]
105
109
$( #[ $attr] ) *
106
110
pub struct $i ( $( $field) * ) ;
107
111
}
112
+ impl :: Copy for $i { }
113
+ impl :: Clone for $i {
114
+ fn clone( & self ) -> $i { * self }
115
+ }
108
116
) * ) ;
109
117
}
110
118
@@ -122,19 +130,28 @@ macro_rules! s_no_extra_traits {
122
130
( it: $( #[ $attr: meta] ) * pub union $i: ident { $( $field: tt) * } ) => (
123
131
__item! {
124
132
#[ repr( C ) ]
125
- #[ derive( Copy , Clone ) ]
126
133
$( #[ $attr] ) *
127
134
pub union $i { $( $field) * }
128
135
}
136
+
137
+ impl :: Copy for $i { }
138
+ impl :: Clone for $i {
139
+ fn clone( & self ) -> $i { * self }
140
+ }
129
141
) ;
130
142
131
143
( it: $( #[ $attr: meta] ) * pub struct $i: ident { $( $field: tt) * } ) => (
132
144
__item! {
133
145
#[ repr( C ) ]
134
- #[ derive( Copy , Clone ) ]
135
146
$( #[ $attr] ) *
136
147
pub struct $i { $( $field) * }
137
148
}
149
+ #[ allow( deprecated) ]
150
+ impl :: Copy for $i { }
151
+ #[ allow( deprecated) ]
152
+ impl :: Clone for $i {
153
+ fn clone( & self ) -> $i { * self }
154
+ }
138
155
) ;
139
156
}
140
157
@@ -160,10 +177,13 @@ macro_rules! e {
160
177
) * ) => ( $(
161
178
__item! {
162
179
#[ cfg_attr( feature = "extra_traits" , derive( Debug , Eq , Hash , PartialEq ) ) ]
163
- #[ derive( Copy , Clone ) ]
164
180
$( #[ $attr] ) *
165
181
pub enum $i { $( $field) * }
166
182
}
183
+ impl :: Copy for $i { }
184
+ impl :: Clone for $i {
185
+ fn clone( & self ) -> $i { * self }
186
+ }
167
187
) * ) ;
168
188
}
169
189
0 commit comments