2018-04-27 23:32:00 -05:00
|
|
|
#![feature(decl_macro)]
|
2017-03-24 21:37:55 -05:00
|
|
|
|
|
|
|
mod foo {
|
|
|
|
struct S;
|
|
|
|
impl S {
|
|
|
|
fn f(&self) {}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub macro m() {
|
2022-09-21 10:57:30 -05:00
|
|
|
let _: () = S.f(); //~ ERROR type `for<'a> fn(&'a foo::S) {foo::S::f}` is private
|
2017-03-24 21:37:55 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
struct S;
|
|
|
|
|
|
|
|
macro m($f:ident) {
|
|
|
|
impl S {
|
|
|
|
fn f(&self) -> u32 { 0 }
|
|
|
|
fn $f(&self) -> i32 { 0 }
|
|
|
|
}
|
|
|
|
fn f() {
|
|
|
|
let _: u32 = S.f();
|
|
|
|
let _: i32 = S.$f();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
m!(f);
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let _: i32 = S.f();
|
|
|
|
foo::m!();
|
|
|
|
}
|