rust/tests/ui/parser/macro/pub-method-macro.rs
Josh Triplett 6d64306df1 Move macro tests in parser into macro directory
The `macro` directory contains most of the macro tests, but not all of
them; move the remainder into `macro`.
2025-07-05 16:52:59 -07:00

24 lines
480 B
Rust

// Issue #18317
mod bleh {
macro_rules! defn {
($n:ident) => (
fn $n (&self) -> i32 {
println!("{}", stringify!($n));
1
}
)
}
#[derive(Copy, Clone)]
pub struct S;
impl S {
pub defn!(f); //~ ERROR can't qualify macro invocation with `pub`
//~^ HELP remove the visibility
//~| HELP try adjusting the macro to put `pub` inside the invocation
}
}
fn main() {}