-
Notifications
You must be signed in to change notification settings - Fork 123
WIP Improved support for visibility restrictions #88
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
WIP Improved support for visibility restrictions #88
Conversation
__lazy_static_internal!(@MAKE TY, $VIS, $(#[$attr])*, $N); | ||
__lazy_static_internal!(@TAIL, $N : $T = $e); | ||
__lazy_static_internal!($($t)*); | ||
lazy_static!($($t)*); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if this is correct, and why previously call to __lazy_static_internal!
macro was put in here. This also somewhat duplicated the code. Can someone look at it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not aware of a deeper reason for the duplication. As far as I can remember, when the internal macro split from the public one, this just happend with the idea that the publich one acts as the entry point for the internal one, which then just keeps to itself during expansion.
However, there is no reason for why it couldn't do the mutual recursion back into the public one instead, as done in this PR.
The only thing I can imagine is macro 1.0 weirdness in regard to visibility. As in, depending on how its imported, the internal macro might not see the public one during expansion. Not sure if this can happen here though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the information. I think that you should decide whether or not you like current implementation better than the previous one. If you do then you can merge the PR, otherwise let me know and I'll revert some changes I made and adapt it so that it plays well with all possible visibility restrictions.
Also, is there a way to check for compiler errors in tests? I have added two cases which should result in compilation errors and I have manually confirmed that they do indeed yield those errors, but I'd rather have it automated. |
It looks like Windows build failed due to the wrong version of stable compiler:
Visibility restrictions have been introduced in |
Thanks @fuine! Sorry I don't think I can review this personally. It looks like there's a For the compile-fail tests, there is the @Kimundi what do you think? |
Thanks, I'm willing to implement tests using @KodrAus |
I'd love to have compile tests in this lib! I never got around to adding them myself - would be nice for checking the unused variable warning in the tests as well, and also #73. If something seems wrong with the appveyor setup feel free to open a PR for fixing it as well - I'm not to familiar with it myself. |
@fuine I've merged in your fix for the AppVeyor build, would you like to rebase this? |
Sure, but I want to land the |
Sounds good! Thanks @fuine! |
9d2f0a1
to
b861665
Compare
Once tests pass I think that it's good to go, but I still would like someone knowledgable to take a look at the change I commented under in the review - maybe there was some subtlety to the way previous code was designed which I didn't spot and my change breaks some corner cases |
Alright, looks good! Thanks for the contribution. :) |
I marked the PR WIP because I'm not 100% sure one change I introduced is correct.
Closes #87