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