1111use ast:: { self , Block , Ident , NodeId , PatKind , Path } ;
1212use ast:: { MacStmtStyle , StmtKind , ItemKind } ;
1313use attr:: { self , HasAttrs } ;
14- use codemap:: { ExpnInfo , NameAndSpan , MacroBang , MacroAttribute , dummy_spanned, respan} ;
14+ use codemap:: { ExpnInfo , MacroBang , MacroAttribute , dummy_spanned, respan} ;
1515use config:: { is_test_or_bench, StripUnconfigured } ;
1616use errors:: { Applicability , FatalError } ;
1717use ext:: base:: * ;
@@ -514,7 +514,7 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
514514 let suggested_limit = self . cx . ecfg . recursion_limit * 2 ;
515515 let mut err = self . cx . struct_span_err ( info. call_site ,
516516 & format ! ( "recursion limit reached while expanding the macro `{}`" ,
517- info. callee . name( ) ) ) ;
517+ info. format . name( ) ) ) ;
518518 err. help ( & format ! (
519519 "consider adding a `#![recursion_limit=\" {}\" ]` attribute to your crate" ,
520520 suggested_limit) ) ;
@@ -538,13 +538,11 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
538538 attr:: mark_used ( & attr) ;
539539 invoc. expansion_data . mark . set_expn_info ( ExpnInfo {
540540 call_site : attr. span ,
541- callee : NameAndSpan {
542- format : MacroAttribute ( Symbol :: intern ( & format ! ( "{}" , attr. path) ) ) ,
543- span : None ,
544- allow_internal_unstable : false ,
545- allow_internal_unsafe : false ,
546- edition : ext. edition ( ) ,
547- }
541+ def_site : None ,
542+ format : MacroAttribute ( Symbol :: intern ( & format ! ( "{}" , attr. path) ) ) ,
543+ allow_internal_unstable : false ,
544+ allow_internal_unsafe : false ,
545+ edition : ext. edition ( ) ,
548546 } ) ;
549547
550548 match * ext {
@@ -727,13 +725,11 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
727725 }
728726 mark. set_expn_info ( ExpnInfo {
729727 call_site : span,
730- callee : NameAndSpan {
731- format : macro_bang_format ( path) ,
732- span : def_site_span,
733- allow_internal_unstable,
734- allow_internal_unsafe,
735- edition,
736- } ,
728+ def_site : def_site_span,
729+ format : macro_bang_format ( path) ,
730+ allow_internal_unstable,
731+ allow_internal_unsafe,
732+ edition,
737733 } ) ;
738734 Ok ( ( ) )
739735 } ;
@@ -777,13 +773,11 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
777773 } else {
778774 invoc. expansion_data . mark . set_expn_info ( ExpnInfo {
779775 call_site : span,
780- callee : NameAndSpan {
781- format : macro_bang_format ( path) ,
782- span : tt_span,
783- allow_internal_unstable,
784- allow_internal_unsafe : false ,
785- edition : hygiene:: default_edition ( ) ,
786- }
776+ def_site : tt_span,
777+ format : macro_bang_format ( path) ,
778+ allow_internal_unstable,
779+ allow_internal_unsafe : false ,
780+ edition : hygiene:: default_edition ( ) ,
787781 } ) ;
788782
789783 let input: Vec < _ > = mac. node . stream ( ) . into_trees ( ) . collect ( ) ;
@@ -815,16 +809,14 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
815809 self . gate_proc_macro_expansion_kind ( span, kind) ;
816810 invoc. expansion_data . mark . set_expn_info ( ExpnInfo {
817811 call_site : span,
818- callee : NameAndSpan {
819- format : macro_bang_format ( path) ,
820- // FIXME procedural macros do not have proper span info
821- // yet, when they do, we should use it here.
822- span : None ,
823- // FIXME probably want to follow macro_rules macros here.
824- allow_internal_unstable,
825- allow_internal_unsafe : false ,
826- edition,
827- } ,
812+ // FIXME procedural macros do not have proper span info
813+ // yet, when they do, we should use it here.
814+ def_site : None ,
815+ format : macro_bang_format ( path) ,
816+ // FIXME probably want to follow macro_rules macros here.
817+ allow_internal_unstable,
818+ allow_internal_unsafe : false ,
819+ edition,
828820 } ) ;
829821
830822 let tok_result = expandfun. expand ( self . cx , span, mac. node . stream ( ) ) ;
@@ -894,13 +886,11 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
894886
895887 let mut expn_info = ExpnInfo {
896888 call_site : span,
897- callee : NameAndSpan {
898- format : MacroAttribute ( pretty_name) ,
899- span : None ,
900- allow_internal_unstable : false ,
901- allow_internal_unsafe : false ,
902- edition : ext. edition ( ) ,
903- }
889+ def_site : None ,
890+ format : MacroAttribute ( pretty_name) ,
891+ allow_internal_unstable : false ,
892+ allow_internal_unsafe : false ,
893+ edition : ext. edition ( ) ,
904894 } ;
905895
906896 match * ext {
@@ -916,7 +906,7 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
916906 Some ( invoc. fragment_kind . expect_from_annotatables ( items) )
917907 }
918908 BuiltinDerive ( func) => {
919- expn_info. callee . allow_internal_unstable = true ;
909+ expn_info. allow_internal_unstable = true ;
920910 invoc. expansion_data . mark . set_expn_info ( expn_info) ;
921911 let span = span. with_ctxt ( self . cx . backtrace ( ) ) ;
922912 let mut items = Vec :: new ( ) ;
0 commit comments