@@ -49,17 +49,13 @@ pub struct InputClone {
49
49
bounds : Option < Vec < syn:: WherePredicate > > ,
50
50
/// Whether the implementation should have an explicit `clone_from`.
51
51
pub clone_from : bool ,
52
- /// Whether the `rustc_copy_clone_marker` was found.
53
- pub rustc_copy_clone_marker : bool ,
54
52
}
55
53
56
54
#[ derive( Debug , Default ) ]
57
55
/// Represent the `derivative(Clone(…))` attributes on an input.
58
56
pub struct InputCopy {
59
57
/// The `bound` attribute if present and the corresponding bounds.
60
58
bounds : Option < Vec < syn:: WherePredicate > > ,
61
- /// Whether the input also derive `Clone` (ie. `derive(Clone)`, but not `derivative(Clone)`)
62
- derives_clone : bool ,
63
59
}
64
60
65
61
#[ derive( Debug , Default ) ]
@@ -215,50 +211,21 @@ impl Input {
215
211
for_all_attr ! {
216
212
for ( name, values) in attrs;
217
213
"Clone" => {
218
- let mut clone = input. clone. take( ) . unwrap_or_default( ) ;
219
-
220
- clone. rustc_copy_clone_marker = attrs
221
- . iter( )
222
- . filter_map( |attr| attr. parse_meta( ) . ok( ) )
223
- . any( |meta| meta. name( ) . to_string( ) == "rustc_copy_clone_marker" ) ;
224
-
225
214
match_attributes! {
215
+ let Some ( clone) = input. clone;
226
216
for value in values;
227
217
"bound" => try!( parse_bound( & mut clone. bounds, opt_string_to_str!( value) ) ) ,
228
218
"clone_from" => {
229
219
clone. clone_from = try!( parse_boolean_meta_item( & opt_string_to_str!( value) , true , "clone_from" ) ) ;
230
220
}
231
221
}
232
-
233
- input. clone = Some ( clone) ;
234
222
}
235
223
"Copy" => {
236
- let mut copy = input. copy. take( ) . unwrap_or_default( ) ;
237
-
238
- for attr in attrs {
239
- if let Ok ( syn:: Meta :: List ( syn:: MetaList {
240
- ident: ref name,
241
- nested: ref traits,
242
- ..
243
- } ) ) = attr. parse_meta( ) {
244
- fn is_clone( elem: & syn:: NestedMeta ) -> bool {
245
- match * elem {
246
- syn:: NestedMeta :: Meta ( ref mi) => mi. name( ) == "Clone" ,
247
- syn:: NestedMeta :: Literal ( ..) => false ,
248
- }
249
- }
250
- if name == "derive" && traits. iter( ) . any( is_clone) {
251
- copy. derives_clone = true ;
252
- }
253
- }
254
- }
255
-
256
224
match_attributes! {
225
+ let Some ( copy) = input. copy;
257
226
for value in values;
258
227
"bound" => try!( parse_bound( & mut copy. bounds, opt_string_to_str!( value) ) ) ,
259
228
}
260
-
261
- input. copy = Some ( copy) ;
262
229
}
263
230
"Debug" => {
264
231
match_attributes! {
@@ -325,10 +292,6 @@ impl Input {
325
292
. map_or ( None , |d| d. bounds . as_ref ( ) . map ( Vec :: as_slice) )
326
293
}
327
294
328
- pub fn derives_clone ( & self ) -> bool {
329
- self . copy . as_ref ( ) . map_or ( false , |d| d. derives_clone )
330
- }
331
-
332
295
pub fn debug_bound ( & self ) -> Option < & [ syn:: WherePredicate ] > {
333
296
self . debug
334
297
. as_ref ( )
@@ -357,12 +320,6 @@ impl Input {
357
320
. map_or ( None , |d| d. bounds . as_ref ( ) . map ( Vec :: as_slice) )
358
321
}
359
322
360
- pub fn rustc_copy_clone_marker ( & self ) -> bool {
361
- self . clone
362
- . as_ref ( )
363
- . map_or ( false , |d| d. rustc_copy_clone_marker )
364
- }
365
-
366
323
pub fn partial_eq_bound ( & self ) -> Option < & [ syn:: WherePredicate ] > {
367
324
self . partial_eq
368
325
. as_ref ( )
0 commit comments