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

rust 2018: local_inner_macros and stringify #55268

Closed
richard-uk1 opened this issue Oct 22, 2018 · 5 comments
Closed

rust 2018: local_inner_macros and stringify #55268

richard-uk1 opened this issue Oct 22, 2018 · 5 comments
Labels
C-feature-request Category: A feature request, i.e: not implemented / a PR. T-lang Relevant to the language team, which will review and decide on the PR/issue.

Comments

@richard-uk1
Copy link
Contributor

I am trying to update yew to work with the 2018 edition. I need to use the local_inner_macros feature, but it seems to clobber built-in macros like stringify and compile_error. Is is possible to just spot these particular macros and not add $crate:: to them?

@petrochenkov
Copy link
Contributor

Is is possible to just spot these particular macros and not add $crate:: to them?

Not without effort that would be disproportionally high for a transitional/deprecated-on-arrival feature like local_inner_macros.
(Built-in macros can be shadowed, so we can't detect them correctly just looking at their name in isolation, we'd basically need some insta-stable form of def-site hygiene.)

If you don't need compatibility with pre-1.30 versions of Rust, $crate is recommended for use instead of local_inner_macros.
If you need compatibility, then built-in macros can be used with local_inner_macros through one more level of indirection.

@Centril Centril added T-lang Relevant to the language team, which will review and decide on the PR/issue. C-feature-request Category: A feature request, i.e: not implemented / a PR. labels Oct 22, 2018
@Centril
Copy link
Contributor

Centril commented Oct 22, 2018

I'm inclined to agree with @petrochenkov here.

@richard-uk1
Copy link
Contributor Author

richard-uk1 commented Oct 22, 2018 via email

@richard-uk1
Copy link
Contributor Author

Made a doc PR for this: rust-lang/edition-guide#117

@petrochenkov
Copy link
Contributor

The doc PR has landed, so I'm closing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature-request Category: A feature request, i.e: not implemented / a PR. T-lang Relevant to the language team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants