]> git.lizzy.rs Git - rust.git/blob - src/test/ui-fulldeps/proc-macro/invalid-attributes.rs
Account for --remap-path-prefix in save-analysis
[rust.git] / src / test / ui-fulldeps / proc-macro / invalid-attributes.rs
1 // Copyright 2018 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.
4 //
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.
10
11 // no-prefer-dynamic
12
13 #![crate_type = "proc-macro"]
14 #![feature(proc_macro)]
15
16 extern crate proc_macro;
17
18 use proc_macro::TokenStream;
19
20 #[proc_macro = "test"] //~ ERROR: does not take any arguments
21 pub fn a(a: TokenStream) -> TokenStream { a }
22
23 #[proc_macro()] //~ ERROR: does not take any arguments
24 pub fn c(a: TokenStream) -> TokenStream { a }
25
26 #[proc_macro(x)] //~ ERROR: does not take any arguments
27 pub fn d(a: TokenStream) -> TokenStream { a }
28
29 #[proc_macro_attribute = "test"] //~ ERROR: does not take any arguments
30 pub fn e(_: TokenStream, a: TokenStream) -> TokenStream { a }
31
32 #[proc_macro_attribute()] //~ ERROR: does not take any arguments
33 pub fn g(_: TokenStream, a: TokenStream) -> TokenStream { a }
34
35 #[proc_macro_attribute(x)] //~ ERROR: does not take any arguments
36 pub fn h(_: TokenStream, a: TokenStream) -> TokenStream { a }