]> git.proxmox.com Git - rustc.git/blob - src/test/ui/parser/pub-method-macro.rs
New upstream version 1.67.1+dfsg1
[rustc.git] / src / test / 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() {}