-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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 definitions escape from local scopes #4906
Comments
There is no scoping mechanism for syntax expander names at all (thus macro names). There should be. There always should have been, and we punted on it over and over while working on other "more important" issues. See also #3114 and #2247. This is work that remains to be done. It would be fantastic if you were to, say, propose and implement something here. Almost anything would be better than the current situation. |
I'm closing this now. Macros now escape only from modules that use the #[macro_escape] attribute. |
…nts, r=Manishearth,flip1995 Parse doctests in needless_doctest_main This switches from text-based search to running the parser to avoid false positives. Inspired by how [rustdoc](https://github.com/rust-lang/rust/blob/3f3250500fe152b5759c21453ba9a9129808d0d8/src/librustdoc/test.rs#L366) handles this and by rust-lang#4729. cc @llogiq changelog: Fix multiple false positives in [`needless_doctest_main`]. Fixes rust-lang#5879 Fixes rust-lang#4906 Fixes rust-lang#5103 Fixes rust-lang#4698
I think (hope) this is an easy fix; I'm creating the issue so I can refer to it in code.
Currently, macros defined by macro_rules! escape from the contexts in which they're defined; I'm assuming that's an accident. So, for instance,
...fails the test, because the bogus definition from the boring() function is still in effect.
The text was updated successfully, but these errors were encountered: