@@ -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
///
@@ -370,7 +367,7 @@ macro_rules! error_chain_processing {
370
367
} ;
371
368
(
372
369
( $a: tt, { } , $c: tt, $d: tt, $e: tt)
373
- derive $content: tt
370
+ links $content: tt
374
371
$( $tail: tt ) *
375
372
) => {
376
373
error_chain_processing! {
@@ -380,7 +377,7 @@ macro_rules! error_chain_processing {
380
377
} ;
381
378
(
382
379
( $a: tt, $b: tt, { } , $d: tt, $e: tt)
383
- links $content: tt
380
+ foreign_links $content: tt
384
381
$( $tail: tt ) *
385
382
) => {
386
383
error_chain_processing! {
@@ -390,7 +387,7 @@ macro_rules! error_chain_processing {
390
387
} ;
391
388
(
392
389
( $a: tt, $b: tt, $c: tt, { } , $e: tt)
393
- foreign_links $content: tt
390
+ errors $content: tt
394
391
$( $tail: tt ) *
395
392
) => {
396
393
error_chain_processing! {
@@ -400,7 +397,7 @@ macro_rules! error_chain_processing {
400
397
} ;
401
398
(
402
399
( $a: tt, $b: tt, $c: tt, $d: tt, { } )
403
- errors $content: tt
400
+ derive $content: tt
404
401
$( $tail: tt ) *
405
402
) => {
406
403
error_chain_processing! {
@@ -411,10 +408,10 @@ macro_rules! error_chain_processing {
411
408
( ( $a: tt, $b: tt, $c: tt, $d: tt, $e: tt) ) => {
412
409
error_chain_processed! {
413
410
types $a
414
- derive $b
415
- links $c
416
- foreign_links $d
417
- errors $e
411
+ links $b
412
+ foreign_links $c
413
+ errors $d
414
+ derive $e
418
415
}
419
416
} ;
420
417
}
@@ -435,12 +432,9 @@ macro_rules! error_chain {
435
432
#[ macro_export]
436
433
#[ doc( hidden) ]
437
434
macro_rules! create_super_trait {
438
- ( $name: ident: $( $bound: ident) ,* ) => {
439
- create_super_trait!( $name: $( $bound +) * ) ;
440
- } ;
441
- ( $name: ident: $bound_1: ident + $( $bound_2: tt +) * ) => {
442
- trait $name: $bound_1 $( + $bound_2) * { }
443
- impl <T : $bound_1 $( + $bound_2) * > $name for T { }
435
+ ( $name: ident: $bound_1: path, $( $rest: path) ,* ) => {
436
+ trait $name: $bound_1 $( + $rest) * { }
437
+ impl <T : $bound_1 $( + $rest) * > $name for T { }
444
438
} ;
445
439
}
446
440
0 commit comments