@@ -49,6 +49,7 @@ static KNOWN_FEATURES: &'static [(&'static str, Status)] = &[
49
49
( "trace_macros" , Active ) ,
50
50
( "simd" , Active ) ,
51
51
( "default_type_params" , Active ) ,
52
+ ( "quote" , Active ) ,
52
53
53
54
// These are used to test this portion of the compiler, they don't actually
54
55
// mean anything
@@ -189,24 +190,35 @@ impl Visitor<()> for Context {
189
190
190
191
fn visit_mac ( & mut self , macro : & ast:: Mac , _: ( ) ) {
191
192
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" ;
192
197
193
- if path. segments . last ( ) . unwrap ( ) . identifier == self . sess . ident_of ( "macro_rules" ) {
198
+
199
+ if id == self . sess . ident_of ( "macro_rules" ) {
194
200
self . gate_feature ( "macro_rules" , path. span , "macro definitions are \
195
201
not stable enough for use and are subject to change") ;
196
202
}
197
203
198
- else if path . segments . last ( ) . unwrap ( ) . identifier == self . sess . ident_of ( "asm" ) {
204
+ else if id == self . sess . ident_of ( "asm" ) {
199
205
self . gate_feature ( "asm" , path. span , "inline assembly is not \
200
206
stable enough for use and is subject to change") ;
201
207
}
202
208
203
- else if path . segments . last ( ) . unwrap ( ) . identifier == self . sess . ident_of ( "log_syntax" ) {
209
+ else if id == self . sess . ident_of ( "log_syntax" ) {
204
210
self . gate_feature ( "log_syntax" , path. span , "`log_syntax!` is not \
205
211
stable enough for use and is subject to change") ;
206
212
}
207
- else if path . segments . last ( ) . unwrap ( ) . identifier == self . sess . ident_of ( "trace_macros" ) {
213
+ else if id == self . sess . ident_of ( "trace_macros" ) {
208
214
self . gate_feature ( "trace_macros" , path. span , "`trace_macros` is not \
209
215
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
+ }
210
222
}
211
223
}
212
224
0 commit comments