@@ -766,30 +766,6 @@ pub trait PostExpansionMethod {
766766 fn pe_vis ( & self ) -> ast:: Visibility ;
767767}
768768
769-
770- /// can't use the standard cfg(stage0) tricks here, because the error occurs in
771- /// parsing, before cfg gets a chance to save the day. (yes, interleaved parsing
772- /// / expansion / configuring would solve this problem...)
773-
774- // NOTE: remove after next snapshot
775- /// to be more specific: after a snapshot, swap out the "PRE" stuff, and
776- // swap in the "POST" stuff.
777-
778- /// PRE
779- macro_rules! mf_method_body{
780- ( $slf: ident, $field_pat: pat, $result: ident) => {
781- match $slf. node {
782- $field_pat => $result,
783- MethMac ( _) => {
784- fail!( "expected an AST without macro invocations" ) ;
785- }
786- }
787- }
788- }
789-
790- /// POST
791- /*
792- #[cfg(not(stage0))]
793769macro_rules! mf_method{
794770 ( $meth_name: ident, $field_ty: ty, $field_pat: pat, $result: ident) => {
795771 fn $meth_name<' a>( & ' a self ) -> $field_ty {
@@ -801,52 +777,21 @@ macro_rules! mf_method{
801777 }
802778 }
803779 }
804- }*/
805-
806-
807- // PRE
808- impl PostExpansionMethod for Method {
809- fn pe_ident ( & self ) -> ast:: Ident {
810- mf_method_body ! ( self , MethDecl ( ident, _, _, _, _, _, _, _) , ident)
811- }
812- fn pe_generics < ' a > ( & ' a self ) -> & ' a ast:: Generics {
813- mf_method_body ! ( self , MethDecl ( _, ref generics, _, _, _, _, _, _) , generics)
814- }
815- fn pe_abi ( & self ) -> Abi {
816- mf_method_body ! ( self , MethDecl ( _, _, abi, _, _, _, _, _) , abi)
817- }
818- fn pe_explicit_self < ' a > ( & ' a self ) -> & ' a ast:: ExplicitSelf {
819- mf_method_body ! ( self , MethDecl ( _, _, _, ref explicit_self, _, _, _, _) , explicit_self)
820- }
821- fn pe_fn_style ( & self ) -> ast:: FnStyle {
822- mf_method_body ! ( self , MethDecl ( _, _, _, _, fn_style, _, _, _) , fn_style)
823- }
824- fn pe_fn_decl ( & self ) -> P < ast:: FnDecl > {
825- mf_method_body ! ( self , MethDecl ( _, _, _, _, _, decl, _, _) , decl)
826- }
827- fn pe_body ( & self ) -> P < ast:: Block > {
828- mf_method_body ! ( self , MethDecl ( _, _, _, _, _, _, body, _) , body)
829- }
830- fn pe_vis ( & self ) -> ast:: Visibility {
831- mf_method_body ! ( self , MethDecl ( _, _, _, _, _, _, _, vis) , vis)
832- }
833780}
834781
835- // POST
836- /*
837- #[cfg(not(stage0))]
782+
838783impl PostExpansionMethod for Method {
839- mf_method!(pe_ident,ast::Ident,MethDecl(ident,_,_,_,_,_,_),ident)
784+ mf_method ! ( pe_ident, ast:: Ident , MethDecl ( ident, _, _, _, _, _, _, _ ) , ident)
840785 mf_method ! ( pe_generics, & ' a ast:: Generics ,
841- MethDecl(_,ref generics,_,_,_,_,_),generics)
786+ MethDecl ( _, ref generics, _, _, _, _, _, _) , generics)
787+ mf_method ! ( pe_abi, Abi , MethDecl ( _, _, abi, _, _, _, _, _) , abi)
842788 mf_method ! ( pe_explicit_self, & ' a ast:: ExplicitSelf ,
843- MethDecl(_,_,ref explicit_self,_,_,_,_),explicit_self)
844- mf_method!(pe_fn_style,ast::FnStyle,MethDecl(_,_,_,fn_style,_,_,_),fn_style)
845- mf_method!(pe_fn_decl,P<ast::FnDecl>,MethDecl(_,_,_,_,decl,_,_),decl)
846- mf_method!(pe_body,P<ast::Block>,MethDecl(_,_,_,_,_,body,_),body)
847- mf_method!(pe_vis,ast::Visibility,MethDecl(_,_,_,_,_,_,vis),vis)
789+ MethDecl ( _, _, _ , ref explicit_self, _, _, _, _) , explicit_self)
790+ mf_method ! ( pe_fn_style, ast:: FnStyle , MethDecl ( _, _, _, _ , fn_style, _, _, _) , fn_style)
791+ mf_method ! ( pe_fn_decl, P <ast:: FnDecl >, MethDecl ( _, _, _, _, _ , decl, _, _) , decl)
792+ mf_method ! ( pe_body, P <ast:: Block >, MethDecl ( _, _, _, _, _, _ , body, _) , body)
793+ mf_method ! ( pe_vis, ast:: Visibility , MethDecl ( _, _, _, _, _, _, _ , vis) , vis)
848794}
849- */
850795
851796#[ cfg( test) ]
852797mod test {
0 commit comments