@@ -41,10 +41,6 @@ macro_rules! impl_error_chain_processed {
41
41
$result_ext_name: ident;
42
42
}
43
43
44
- derive {
45
- $( $bound: ident) ,*
46
- }
47
-
48
44
links {
49
45
$( $link_variant: ident ( $link_error_path: path, $link_kind_path: path )
50
46
$( #[ $meta_links: meta] ) * ; ) *
@@ -59,10 +55,11 @@ macro_rules! impl_error_chain_processed {
59
55
$( $error_chunks: tt ) *
60
56
}
61
57
58
+ derive {
59
+ $( $bound: ident) ,*
60
+ }
62
61
) => {
63
- use :: std:: fmt:: Debug ;
64
- use :: std:: error:: Error as StdError ;
65
- create_super_trait!( Trait : Debug , StdError , Send $( , $bound) * ) ;
62
+ create_super_trait!( Trait : :: std:: fmt:: Debug , :: std:: error:: Error , Send $( , $bound) * ) ;
66
63
67
64
/// The Error type.
68
65
///
@@ -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
impl_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
}
@@ -434,12 +431,9 @@ macro_rules! error_chain {
434
431
#[ macro_export]
435
432
#[ doc( hidden) ]
436
433
macro_rules! create_super_trait {
437
- ( $name: ident: $( $bound: ident) ,* ) => {
438
- create_super_trait!( $name: $( $bound +) * ) ;
439
- } ;
440
- ( $name: ident: $bound_1: ident + $( $bound_2: tt +) * ) => {
441
- trait $name: $bound_1 $( + $bound_2) * { }
442
- impl <T : $bound_1 $( + $bound_2) * > $name for T { }
434
+ ( $name: ident: $bound_1: path, $( $rest: path) ,* ) => {
435
+ trait $name: $bound_1 $( + $rest) * { }
436
+ impl <T : $bound_1 $( + $rest) * > $name for T { }
443
437
} ;
444
438
}
445
439
0 commit comments