]> git.lizzy.rs Git - rust.git/blob - src/test/ui/parser/pub-method-macro.rs
Auto merge of #57129 - RalfJung:check-bounds, r=oli-obk
[rust.git] / src / test / ui / parser / pub-method-macro.rs
1 // Issue #18317
2
3 // compile-flags: -Z parse-only
4
5 mod bleh {
6     macro_rules! defn {
7         ($n:ident) => (
8             fn $n (&self) -> i32 {
9                 println!("{}", stringify!($n));
10                 1
11             }
12         )
13     }
14
15     #[derive(Copy, Clone)]
16     pub struct S;
17
18     impl S {
19         pub defn!(f); //~ ERROR can't qualify macro invocation with `pub`
20         //~^ HELP try adjusting the macro to put `pub` inside the invocation
21     }
22 }
23
24 fn main() {}