@@ -49,6 +49,7 @@ static KNOWN_FEATURES: &'static [(&'static str, Status)] = &[
4949 ( "trace_macros" , Active ) ,
5050 ( "simd" , Active ) ,
5151 ( "default_type_params" , Active ) ,
52+ ( "quote" , Active ) ,
5253
5354 // These are used to test this portion of the compiler, they don't actually
5455 // mean anything
@@ -189,24 +190,35 @@ impl Visitor<()> for Context {
189190
190191 fn visit_mac ( & mut self , macro : & ast:: Mac , _: ( ) ) {
191192 let ast:: MacInvocTT ( ref path, _, _) = macro. node ;
193+ let id = path. segments . last ( ) . unwrap ( ) . identifier ;
194+ let quotes = [ "quote_tokens" , "quote_expr" , "quote_ty" ,
195+ "quote_item" , "quote_pat" , "quote_stmt" ] ;
196+ let msg = " is not stable enough for use and are subject to change" ;
192197
193- if path. segments . last ( ) . unwrap ( ) . identifier == self . sess . ident_of ( "macro_rules" ) {
198+
199+ if id == self . sess . ident_of ( "macro_rules" ) {
194200 self . gate_feature ( "macro_rules" , path. span , "macro definitions are \
195201 not stable enough for use and are subject to change") ;
196202 }
197203
198- else if path . segments . last ( ) . unwrap ( ) . identifier == self . sess . ident_of ( "asm" ) {
204+ else if id == self . sess . ident_of ( "asm" ) {
199205 self . gate_feature ( "asm" , path. span , "inline assembly is not \
200206 stable enough for use and is subject to change") ;
201207 }
202208
203- else if path . segments . last ( ) . unwrap ( ) . identifier == self . sess . ident_of ( "log_syntax" ) {
209+ else if id == self . sess . ident_of ( "log_syntax" ) {
204210 self . gate_feature ( "log_syntax" , path. span , "`log_syntax!` is not \
205211 stable enough for use and is subject to change") ;
206212 }
207- else if path . segments . last ( ) . unwrap ( ) . identifier == self . sess . ident_of ( "trace_macros" ) {
213+ else if id == self . sess . ident_of ( "trace_macros" ) {
208214 self . gate_feature ( "trace_macros" , path. span , "`trace_macros` is not \
209215 stable enough for use and is subject to change") ;
216+ } else {
217+ for & quote in quotes. iter ( ) {
218+ if id == self . sess . ident_of ( quote) {
219+ self . gate_feature ( "quote" , path. span , quote + msg) ;
220+ }
221+ }
210222 }
211223 }
212224
0 commit comments