]> git.lizzy.rs Git - rust.git/blob - src/test/ui/rfc-2565-param-attrs/proc-macro-cannot-be-used.rs
Rollup merge of #103159 - cuviper:check_pow-final-try_opt, r=Mark-Simulacrum
[rust.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 #![allow(anonymous_parameters)]
5
6 extern crate ident_mac;
7 use ident_mac::id;
8
9 struct W(u8);
10
11 extern "C" { fn ffi(#[id] arg1: i32, #[id] ...); }
12 //~^ ERROR expected non-macro attribute, found attribute macro
13 //~| ERROR expected non-macro attribute, found attribute macro
14
15 unsafe extern "C" fn cvar(arg1: i32, #[id] mut args: ...) {}
16 //~^ ERROR expected non-macro attribute, found attribute macro
17
18 type Alias = extern "C" fn(#[id] u8, #[id] ...);
19     //~^ ERROR expected non-macro attribute, found attribute macro
20     //~| ERROR expected non-macro attribute, found attribute macro
21
22 fn free(#[id] arg1: u8) {
23     //~^ ERROR expected non-macro attribute, found attribute macro
24     let lam = |#[id] W(x), #[id] y: usize| ();
25     //~^ ERROR expected non-macro attribute, found attribute macro
26     //~| ERROR expected non-macro attribute, found attribute macro
27 }
28
29 impl W {
30     fn inherent1(#[id] self, #[id] arg1: u8) {}
31     //~^ ERROR expected non-macro attribute, found attribute macro
32     //~| ERROR expected non-macro attribute, found attribute macro
33     fn inherent2(#[id] &self, #[id] arg1: u8) {}
34     //~^ ERROR expected non-macro attribute, found attribute macro
35     //~| ERROR expected non-macro attribute, found attribute macro
36     fn inherent3<'a>(#[id] &'a mut self, #[id] arg1: u8) {}
37     //~^ ERROR expected non-macro attribute, found attribute macro
38     //~| ERROR expected non-macro attribute, found attribute macro
39     fn inherent4<'a>(#[id] self: Box<Self>, #[id] arg1: u8) {}
40     //~^ ERROR expected non-macro attribute, found attribute macro
41     //~| ERROR expected non-macro attribute, found attribute macro
42     fn issue_64682_associated_fn<'a>(#[id] arg1: u8, #[id] arg2: u8) {}
43     //~^ ERROR expected non-macro attribute, found attribute macro
44     //~| ERROR expected non-macro attribute, found attribute macro
45 }
46
47 trait A {
48     fn trait1(#[id] self, #[id] arg1: u8);
49     //~^ ERROR expected non-macro attribute, found attribute macro
50     //~| ERROR expected non-macro attribute, found attribute macro
51     fn trait2(#[id] &self, #[id] arg1: u8);
52     //~^ ERROR expected non-macro attribute, found attribute macro
53     //~| ERROR expected non-macro attribute, found attribute macro
54     fn trait3<'a>(#[id] &'a mut self, #[id] arg1: u8);
55     //~^ ERROR expected non-macro attribute, found attribute macro
56     //~| ERROR expected non-macro attribute, found attribute macro
57     fn trait4<'a>(#[id] self: Box<Self>, #[id] arg1: u8, #[id] Vec<u8>);
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
61     fn issue_64682_associated_fn<'a>(#[id] arg1: u8, #[id] arg2: u8);
62     //~^ ERROR expected non-macro attribute, found attribute macro
63     //~| ERROR expected non-macro attribute, found attribute macro
64 }
65
66 fn main() {}