-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Cannot use Self
to construct a tuple struct in a macro
#57523
Comments
This also applies to type aliases. struct T;
type B = T;
macro_rules! a {
() => {
impl T {
fn b() -> B {
B()
}
}
}
}
a!(); I suspect this is to do with rust/src/librustc_resolve/lib.rs Lines 3557 to 3558 in b439861
cc @alexreg |
Yes, I think @varkor is right. @petrochenkov Maybe you could elaborate on this FIXME? What's stopping us from resolving paths in the macro NS here? |
That FIXME is unrelated to the issue. Regarding type aliases, |
Fixed in #57560 |
@petrochenkov Ahh, that makes perfect sense. Feel free (but not obliged) to r? me for that PR. |
hygiene: Do not treat `Self` ctor as a local variable Fixes rust-lang#57523
Reproduced on both on beta and nightly (not tested on stable since #51994 wasn't stabilized in 1.31).
This is particularly troublesome on nightly since
clippy::use_self
is recently upgraded to emit the lint in a local macro thanks to rust-lang/rust-clippy#3627, but the suggestion failed to compile.The text was updated successfully, but these errors were encountered: