@@ -32,7 +32,6 @@ macro_rules! unexported_macro { () => (3) }
32
32
#[ plugin_registrar]
33
33
pub fn plugin_registrar ( reg : & mut Registry ) {
34
34
reg. register_macro ( "make_a_1" , expand_make_a_1) ;
35
- reg. register_macro ( "forged_ident" , expand_forged_ident) ;
36
35
reg. register_macro ( "identity" , expand_identity) ;
37
36
reg. register_syntax_extension (
38
37
token:: intern ( "into_foo" ) ,
@@ -104,29 +103,4 @@ fn expand_into_foo_multi(cx: &mut ExtCtxt,
104
103
}
105
104
}
106
105
107
- fn expand_forged_ident ( cx : & mut ExtCtxt , sp : Span , tts : & [ TokenTree ] ) -> Box < MacResult +' static > {
108
- use syntax:: ext:: quote:: rt:: * ;
109
-
110
- if !tts. is_empty ( ) {
111
- cx. span_fatal ( sp, "forged_ident takes no arguments" ) ;
112
- }
113
-
114
- // Most of this is modelled after the expansion of the `quote_expr!`
115
- // macro ...
116
- let parse_sess = cx. parse_sess ( ) ;
117
- let cfg = cx. cfg ( ) ;
118
-
119
- // ... except this is where we inject a forged identifier,
120
- // and deliberately do not call `cx.parse_tts_with_hygiene`
121
- // (because we are testing that this will be *rejected*
122
- // by the default parser).
123
-
124
- let expr = {
125
- let tt = cx. parse_tts ( "\x00 name_2,ctxt_0\x00 " . to_string ( ) ) ;
126
- let mut parser = new_parser_from_tts ( parse_sess, cfg, tt) ;
127
- parser. parse_expr ( )
128
- } ;
129
- MacEager :: expr ( expr)
130
- }
131
-
132
106
pub fn foo ( ) { }
0 commit comments