]>
git.proxmox.com Git - rustc.git/blob - src/test/compile-fail-fulldeps/rustc-macro/attribute.rs
1 // Copyright 2016 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 #![crate_type = "rustc-macro"]
12 #![feature(rustc_macro)]
14 extern crate rustc_macro
;
17 //~^ ERROR: attribute must be of form: #[rustc_macro_derive(TraitName)]
18 pub fn foo1(input
: rustc_macro
::TokenStream
) -> rustc_macro
::TokenStream
{
22 #[rustc_macro_derive = "foo"]
23 //~^ ERROR: attribute must be of form: #[rustc_macro_derive(TraitName)]
24 pub fn foo2(input
: rustc_macro
::TokenStream
) -> rustc_macro
::TokenStream
{
31 //~^^ ERROR: must only be one word
32 pub fn foo3(input
: rustc_macro
::TokenStream
) -> rustc_macro
::TokenStream
{
36 #[rustc_macro_derive(b, c)]
37 //~^ ERROR: attribute must only have one argument
38 pub fn foo4(input
: rustc_macro
::TokenStream
) -> rustc_macro
::TokenStream
{
42 #[rustc_macro_derive(d(e))]
43 //~^ ERROR: must only be one word
44 pub fn foo5(input
: rustc_macro
::TokenStream
) -> rustc_macro
::TokenStream
{