File tree 2 files changed +14
-11
lines changed
2 files changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -441,19 +441,13 @@ impl tr for def::Def {
441
441
fn tr ( & self , dcx : & DecodeContext ) -> def:: Def {
442
442
match * self {
443
443
def:: DefFn ( did, is_ctor) => def:: DefFn ( did. tr ( dcx) , is_ctor) ,
444
- def:: DefStaticMethod ( did, wrapped_did2) => {
445
- def:: DefStaticMethod ( did. tr ( dcx) ,
446
- match wrapped_did2 {
447
- def:: FromTrait ( did2) => {
448
- def:: FromTrait ( did2. tr ( dcx) )
449
- }
450
- def:: FromImpl ( did2) => {
451
- def:: FromImpl ( did2. tr ( dcx) )
452
- }
453
- } )
444
+ def:: DefStaticMethod ( did, p) => {
445
+ def:: DefStaticMethod ( did. tr ( dcx) , p. map ( |did2| did2. tr ( dcx) ) )
454
446
}
455
447
def:: DefMethod ( did0, did1, p) => {
456
- def:: DefMethod ( did0. tr ( dcx) , did1. map ( |did1| did1. tr ( dcx) ) , p)
448
+ def:: DefMethod ( did0. tr ( dcx) ,
449
+ did1. map ( |did1| did1. tr ( dcx) ) ,
450
+ p. map ( |did2| did2. tr ( dcx) ) )
457
451
}
458
452
def:: DefSelfTy ( nid) => { def:: DefSelfTy ( dcx. tr_id ( nid) ) }
459
453
def:: DefMod ( did) => { def:: DefMod ( did. tr ( dcx) ) }
Original file line number Diff line number Diff line change @@ -55,6 +55,15 @@ pub enum MethodProvenance {
55
55
FromImpl ( ast:: DefId ) ,
56
56
}
57
57
58
+ impl MethodProvenance {
59
+ pub fn map ( self , f: |ast:: DefId | -> ast:: DefId ) -> MethodProvenance {
60
+ match self {
61
+ FromTrait ( did) => FromTrait ( f ( did) ) ,
62
+ FromImpl ( did) => FromImpl ( f ( did) )
63
+ }
64
+ }
65
+ }
66
+
58
67
impl Def {
59
68
pub fn def_id ( & self ) -> ast:: DefId {
60
69
match * self {
You can’t perform that action at this time.
0 commit comments