99// except according to those terms.
1010
1111pub use self :: Def :: * ;
12- pub use self :: MethodProvenance :: * ;
1312
1413use middle:: privacy:: LastPrivate ;
1514use middle:: subst:: ParamSpace ;
@@ -28,7 +27,7 @@ pub enum Def {
2827 DefForeignMod ( ast:: DefId ) ,
2928 DefStatic ( ast:: DefId , bool /* is_mutbl */ ) ,
3029 DefConst ( ast:: DefId ) ,
31- DefAssociatedConst ( ast:: DefId /* const */ , MethodProvenance ) ,
30+ DefAssociatedConst ( ast:: DefId ) ,
3231 DefLocal ( ast:: NodeId ) ,
3332 DefVariant ( ast:: DefId /* enum */ , ast:: DefId /* variant */ , bool /* is_structure */ ) ,
3433 DefTy ( ast:: DefId , bool /* is_enum */ ) ,
@@ -51,7 +50,7 @@ pub enum Def {
5150 DefStruct ( ast:: DefId ) ,
5251 DefRegion ( ast:: NodeId ) ,
5352 DefLabel ( ast:: NodeId ) ,
54- DefMethod ( ast:: DefId /* method */ , MethodProvenance ) ,
53+ DefMethod ( ast:: DefId ) ,
5554}
5655
5756/// The result of resolving a path.
@@ -112,23 +111,6 @@ pub struct Export {
112111 pub def_id : ast:: DefId , // The definition of the target.
113112}
114113
115- #[ derive( Clone , Copy , PartialEq , Eq , RustcEncodable , RustcDecodable , Hash , Debug ) ]
116- pub enum MethodProvenance {
117- FromTrait ( ast:: DefId ) ,
118- FromImpl ( ast:: DefId ) ,
119- }
120-
121- impl MethodProvenance {
122- pub fn map < F > ( self , f : F ) -> MethodProvenance where
123- F : FnOnce ( ast:: DefId ) -> ast:: DefId ,
124- {
125- match self {
126- FromTrait ( did) => FromTrait ( f ( did) ) ,
127- FromImpl ( did) => FromImpl ( f ( did) )
128- }
129- }
130- }
131-
132114impl Def {
133115 pub fn local_node_id ( & self ) -> ast:: NodeId {
134116 let def_id = self . def_id ( ) ;
@@ -141,7 +123,7 @@ impl Def {
141123 DefFn ( id, _) | DefMod ( id) | DefForeignMod ( id) | DefStatic ( id, _) |
142124 DefVariant ( _, id, _) | DefTy ( id, _) | DefAssociatedTy ( _, id) |
143125 DefTyParam ( _, _, id, _) | DefUse ( id) | DefStruct ( id) | DefTrait ( id) |
144- DefMethod ( id, _ ) | DefConst ( id) | DefAssociatedConst ( id, _ ) |
126+ DefMethod ( id) | DefConst ( id) | DefAssociatedConst ( id) |
145127 DefSelfTy ( Some ( id) , None ) => {
146128 id
147129 }
0 commit comments