@@ -39,10 +39,6 @@ macro_rules! error_chain_processed {
39
39
$result_ext_name: ident;
40
40
}
41
41
42
- derive {
43
- $( $bound: ident) ,*
44
- }
45
-
46
42
links {
47
43
$( $link_variant: ident ( $link_error_path: path, $link_kind_path: path )
48
44
$( #[ $meta_links: meta] ) * ; ) *
@@ -57,10 +53,11 @@ macro_rules! error_chain_processed {
57
53
$( $error_chunks: tt ) *
58
54
}
59
55
56
+ derive {
57
+ $( $bound: ident) ,*
58
+ }
60
59
) => {
61
- use :: std:: fmt:: Debug ;
62
- use :: std:: error:: Error as StdError ;
63
- create_super_trait!( Trait : Debug , StdError , Send $( , $bound) * ) ;
60
+ create_super_trait!( Trait : :: std:: fmt:: Debug , :: std:: error:: Error , Send $( , $bound) * ) ;
64
61
65
62
/// The Error type.
66
63
///
@@ -351,7 +348,7 @@ macro_rules! error_chain_processing {
351
348
} ;
352
349
(
353
350
( $a: tt, { } , $c: tt, $d: tt, $e: tt)
354
- derive $content: tt
351
+ links $content: tt
355
352
$( $tail: tt ) *
356
353
) => {
357
354
error_chain_processing! {
@@ -361,7 +358,7 @@ macro_rules! error_chain_processing {
361
358
} ;
362
359
(
363
360
( $a: tt, $b: tt, { } , $d: tt, $e: tt)
364
- links $content: tt
361
+ foreign_links $content: tt
365
362
$( $tail: tt ) *
366
363
) => {
367
364
error_chain_processing! {
@@ -371,7 +368,7 @@ macro_rules! error_chain_processing {
371
368
} ;
372
369
(
373
370
( $a: tt, $b: tt, $c: tt, { } , $e: tt)
374
- foreign_links $content: tt
371
+ errors $content: tt
375
372
$( $tail: tt ) *
376
373
) => {
377
374
error_chain_processing! {
@@ -381,7 +378,7 @@ macro_rules! error_chain_processing {
381
378
} ;
382
379
(
383
380
( $a: tt, $b: tt, $c: tt, $d: tt, { } )
384
- errors $content: tt
381
+ derive $content: tt
385
382
$( $tail: tt ) *
386
383
) => {
387
384
error_chain_processing! {
@@ -392,10 +389,10 @@ macro_rules! error_chain_processing {
392
389
( ( $a: tt, $b: tt, $c: tt, $d: tt, $e: tt) ) => {
393
390
error_chain_processed! {
394
391
types $a
395
- derive $b
396
- links $c
397
- foreign_links $d
398
- errors $e
392
+ links $b
393
+ foreign_links $c
394
+ errors $d
395
+ derive $e
399
396
}
400
397
} ;
401
398
}
@@ -416,12 +413,9 @@ macro_rules! error_chain {
416
413
#[ macro_export]
417
414
#[ doc( hidden) ]
418
415
macro_rules! create_super_trait {
419
- ( $name: ident: $( $bound: ident) ,* ) => {
420
- create_super_trait!( $name: $( $bound +) * ) ;
421
- } ;
422
- ( $name: ident: $bound_1: ident + $( $bound_2: tt +) * ) => {
423
- trait $name: $bound_1 $( + $bound_2) * { }
424
- impl <T : $bound_1 $( + $bound_2) * > $name for T { }
416
+ ( $name: ident: $bound_1: path, $( $rest: path) ,* ) => {
417
+ trait $name: $bound_1 $( + $rest) * { }
418
+ impl <T : $bound_1 $( + $rest) * > $name for T { }
425
419
} ;
426
420
}
427
421
0 commit comments