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