Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

self in expanded macro erroneously talks about static methods #32792

Closed
TimNN opened this issue Apr 7, 2016 · 1 comment
Closed

self in expanded macro erroneously talks about static methods #32792

TimNN opened this issue Apr 7, 2016 · 1 comment

Comments

@TimNN
Copy link
Contributor

TimNN commented Apr 7, 2016

The following code (playpen):

macro_rules! slf { () => (self;) }

struct Foo;

impl Foo {
    fn bar(self) {
        slf!();
    }
}

causes the error:

`self` is not available in a static method. Maybe a `self` argument is missing?

which is obviously incorrect (and probably caused by a specialized error message if self is an unknown identifier, I would imagine).

@TimNN
Copy link
Contributor Author

TimNN commented Apr 7, 2016

Dupe of #26946.

@TimNN TimNN closed this as completed Apr 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant