Closed
Description
This code does not compile (playpen), though it should:
#![feature(macro_rules)]
macro_rules! self_call(
($name:ident) => (self.$name())
)
struct X;
impl X {
fn x(&self) {
self_call!(y)
}
fn y(&self) {
println!("Called y()");
}
}
fn main() {
X.x();
}
This is the error:
<anon>:4:23: 4:27 error: `self` is not available in a static method. Maybe a `self` argument is missing?
<anon>:4 ($name:ident) => (self.$name())
^~~~
<anon>:3:1: 5:2 note: in expansion of self_call!
<anon>:11:9: 12:6 note: expansion site
error: aborting due to previous error
This worked previously (it certainly did on June, 8th - this is the last time I compiled my code which used such macro).
Metadata
Metadata
Assignees
Labels
No labels