]> git.proxmox.com Git - rustc.git/blob - src/test/ui/rfc-2565-param-attrs/proc-macro-cannot-be-used.rs
New upstream version 1.50.0+dfsg1
[rustc.git] / src / test / ui / rfc-2565-param-attrs / proc-macro-cannot-be-used.rs
1 // aux-build:ident-mac.rs
2
3 #![feature(c_variadic)]
4
5 extern crate ident_mac;
6 use ident_mac::id;
7
8 struct W(u8);
9
10 extern "C" { fn ffi(#[id] arg1: i32, #[id] ...); }
11 //~^ ERROR expected non-macro attribute, found attribute macro
12 //~| ERROR expected non-macro attribute, found attribute macro
13
14 unsafe extern "C" fn cvar(arg1: i32, #[id] mut args: ...) {}
15 //~^ ERROR expected non-macro attribute, found attribute macro
16
17 type Alias = extern "C" fn(#[id] u8, #[id] ...);
18 //~^ ERROR expected non-macro attribute, found attribute macro
19 //~| ERROR expected non-macro attribute, found attribute macro
20
21 fn free(#[id] arg1: u8) {
22 //~^ ERROR expected non-macro attribute, found attribute macro
23 let lam = |#[id] W(x), #[id] y: usize| ();
24 //~^ ERROR expected non-macro attribute, found attribute macro
25 //~| ERROR expected non-macro attribute, found attribute macro
26 }
27
28 impl W {
29 fn inherent1(#[id] self, #[id] arg1: u8) {}
30 //~^ ERROR expected non-macro attribute, found attribute macro
31 //~| ERROR expected non-macro attribute, found attribute macro
32 fn inherent2(#[id] &self, #[id] arg1: u8) {}
33 //~^ ERROR expected non-macro attribute, found attribute macro
34 //~| ERROR expected non-macro attribute, found attribute macro
35 fn inherent3<'a>(#[id] &'a mut self, #[id] arg1: u8) {}
36 //~^ ERROR expected non-macro attribute, found attribute macro
37 //~| ERROR expected non-macro attribute, found attribute macro
38 fn inherent4<'a>(#[id] self: Box<Self>, #[id] arg1: u8) {}
39 //~^ ERROR expected non-macro attribute, found attribute macro
40 //~| ERROR expected non-macro attribute, found attribute macro
41 fn issue_64682_associated_fn<'a>(#[id] arg1: u8, #[id] arg2: u8) {}
42 //~^ ERROR expected non-macro attribute, found attribute macro
43 //~| ERROR expected non-macro attribute, found attribute macro
44 }
45
46 trait A {
47 fn trait1(#[id] self, #[id] arg1: u8);
48 //~^ ERROR expected non-macro attribute, found attribute macro
49 //~| ERROR expected non-macro attribute, found attribute macro
50 fn trait2(#[id] &self, #[id] arg1: u8);
51 //~^ ERROR expected non-macro attribute, found attribute macro
52 //~| ERROR expected non-macro attribute, found attribute macro
53 fn trait3<'a>(#[id] &'a mut self, #[id] arg1: u8);
54 //~^ ERROR expected non-macro attribute, found attribute macro
55 //~| ERROR expected non-macro attribute, found attribute macro
56 fn trait4<'a>(#[id] self: Box<Self>, #[id] arg1: u8, #[id] Vec<u8>);
57 //~^ ERROR expected non-macro attribute, found attribute macro
58 //~| ERROR expected non-macro attribute, found attribute macro
59 //~| ERROR expected non-macro attribute, found attribute macro
60 fn issue_64682_associated_fn<'a>(#[id] arg1: u8, #[id] arg2: u8);
61 //~^ ERROR expected non-macro attribute, found attribute macro
62 //~| ERROR expected non-macro attribute, found attribute macro
63 }
64
65 fn main() {}