1 // Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 // Test that `quote`-related macro are gated by `quote` feature gate.
13 // (To sanity-check the code, uncomment this.)
16 // FIXME the error message that is current emitted seems pretty bad.
20 #![feature(rustc_private)]
21 #![allow(dead_code, unused_imports, unused_variables)]
33 fn cfg(&self) -> ast::CrateConfig { loop { } }
34 fn parse_sess<'a>(&'a self) -> &'a parse::ParseSess { loop { } }
35 fn call_site(&self) -> Span { loop { } }
36 fn ident_of(&self, st: &str) -> ast::Ident { loop { } }
37 fn name_of(&self, st: &str) -> ast::Name { loop { } }
42 let x = quote_tokens!(ecx, 3); //~ ERROR macro undefined: 'quote_tokens!'
43 let x = quote_expr!(ecx, 3); //~ ERROR macro undefined: 'quote_expr!'
44 let x = quote_ty!(ecx, 3); //~ ERROR macro undefined: 'quote_ty!'
45 let x = quote_method!(ecx, 3); //~ ERROR macro undefined: 'quote_method!'
46 let x = quote_item!(ecx, 3); //~ ERROR macro undefined: 'quote_item!'
47 let x = quote_pat!(ecx, 3); //~ ERROR macro undefined: 'quote_pat!'
48 let x = quote_arm!(ecx, 3); //~ ERROR macro undefined: 'quote_arm!'
49 let x = quote_stmt!(ecx, 3); //~ ERROR macro undefined: 'quote_stmt!'
50 let x = quote_matcher!(ecx, 3); //~ ERROR macro undefined: 'quote_matcher!'
51 let x = quote_attr!(ecx, 3); //~ ERROR macro undefined: 'quote_attr!'
52 let x = quote_arg!(ecx, 3); //~ ERROR macro undefined: 'quote_arg!'
53 let x = quote_block!(ecx, 3); //~ ERROR macro undefined: 'quote_block!'
54 let x = quote_meta_item!(ecx, 3); //~ ERROR macro undefined: 'quote_meta_item!'
55 let x = quote_path!(ecx, 3); //~ ERROR macro undefined: 'quote_path!'