-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Macro declarations do not work in impl blocks #37205
Comments
Triage: no change |
Triage: we now emit:
@KiChjang do you expect the example to compile successfully? If not, I think we can close. |
It should compile, yes. I haven't heard a specific reason why we shouldn't allow macro declarations in impl blocks. |
I'm not sure exactly how such a thing would interact with resolve, if e.g., the impl has type parameters... is this macro only local to the impl, and what about if it is exported? |
Why should we? We could implement this only for |
This issue was created before macro items were introduced, so if that can introduce proper scoping so that it's able to be used in methods, then there's no need to have macro declarations in impl blocks. |
`error_bad_item_kind`: add help text For example, this adds: ``` = help: consider moving the `use` import out to a nearby module scope ``` r? @petrochenkov @estebank Fixes rust-lang#37205.
Minimal test case:
On stable it emits the following error:
And on beta or nightly, it emits the following instead:
The text was updated successfully, but these errors were encountered: