@@ -324,16 +324,16 @@ pub trait BangProcMacro {
324324
325325impl < F > BangProcMacro for F
326326where
327- F : Fn ( TokenStream ) -> TokenStream ,
327+ F : Fn ( & mut ExtCtxt < ' _ > , Span , TokenStream ) -> Result < TokenStream , ErrorGuaranteed > ,
328328{
329329 fn expand < ' cx > (
330330 & self ,
331- _ecx : & ' cx mut ExtCtxt < ' _ > ,
332- _span : Span ,
331+ ecx : & ' cx mut ExtCtxt < ' _ > ,
332+ span : Span ,
333333 ts : TokenStream ,
334334 ) -> Result < TokenStream , ErrorGuaranteed > {
335335 // FIXME setup implicit context in TLS before calling self.
336- Ok ( self ( ts ) )
336+ self ( ecx , span , ts )
337337 }
338338}
339339
@@ -999,17 +999,14 @@ impl SyntaxExtension {
999999
10001000 /// A dummy bang macro `foo!()`.
10011001 pub fn dummy_bang ( edition : Edition ) -> SyntaxExtension {
1002- fn expander < ' cx > (
1003- cx : & ' cx mut ExtCtxt < ' _ > ,
1002+ fn expand (
1003+ ecx : & mut ExtCtxt < ' _ > ,
10041004 span : Span ,
1005- _: TokenStream ,
1006- ) -> MacroExpanderResult < ' cx > {
1007- ExpandResult :: Ready ( DummyResult :: any (
1008- span,
1009- cx. dcx ( ) . span_delayed_bug ( span, "expanded a dummy bang macro" ) ,
1010- ) )
1005+ _ts : TokenStream ,
1006+ ) -> Result < TokenStream , ErrorGuaranteed > {
1007+ Err ( ecx. dcx ( ) . span_delayed_bug ( span, "expanded a dummy bang macro" ) )
10111008 }
1012- SyntaxExtension :: default ( SyntaxExtensionKind :: LegacyBang ( Arc :: new ( expander ) ) , edition)
1009+ SyntaxExtension :: default ( SyntaxExtensionKind :: Bang ( Arc :: new ( expand ) ) , edition)
10131010 }
10141011
10151012 /// A dummy derive macro `#[derive(Foo)]`.
0 commit comments