Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upWIP Improved support for visibility restrictions #88
Conversation
fuine
reviewed
Nov 5, 2017
| __lazy_static_internal!(@MAKE TY, $VIS, $(#[$attr])*, $N); | ||
| __lazy_static_internal!(@TAIL, $N : $T = $e); | ||
| __lazy_static_internal!($($t)*); | ||
| lazy_static!($($t)*); |
This comment has been minimized.
This comment has been minimized.
fuine
Nov 5, 2017
Author
Contributor
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?
This comment has been minimized.
This comment has been minimized.
Kimundi
Nov 12, 2017
Contributor
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.
This comment has been minimized.
This comment has been minimized.
fuine
Nov 13, 2017
Author
Contributor
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.
This comment has been minimized.
This comment has been minimized.
|
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. |
This comment has been minimized.
This comment has been minimized.
|
It looks like Windows build failed due to the wrong version of stable compiler:
Visibility restrictions have been introduced in |
This comment has been minimized.
This comment has been minimized.
|
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? |
This comment has been minimized.
This comment has been minimized.
|
Thanks, I'm willing to implement tests using @KodrAus |
This comment has been minimized.
This comment has been minimized.
|
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. |
This comment has been minimized.
This comment has been minimized.
|
@fuine I've merged in your fix for the AppVeyor build, would you like to rebase this? |
This comment has been minimized.
This comment has been minimized.
|
Sure, but I want to land the |
This comment has been minimized.
This comment has been minimized.
|
Sounds good! Thanks @fuine! |
This comment has been minimized.
This comment has been minimized.
fuine
force-pushed the
fuine:improved-vis-restrictions
branch
from
9d2f0a1
to
b861665
Nov 12, 2017
This comment has been minimized.
This comment has been minimized.
|
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 |
This comment has been minimized.
This comment has been minimized.
|
Alright, looks good! Thanks for the contribution. :) |
fuine commentedNov 5, 2017
I marked the PR WIP because I'm not 100% sure one change I introduced is correct.
Closes #87