Support for additional access specifiers #126
No reviewers
Labels
No labels
bug
good first issue
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-bitflags/bitflags!126
Loading…
Reference in a new issue
No description provided.
Delete branch "pub-restricted"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This pull request adds support for new access specifiers like
pub (crate)orpub (in some_module).This is currently a
nightlyonly feature, so this pull request should not currently be merged.It breaks all doctests and integration tests, since they'd need to manually enable
#![feature(macro_vis_matcher)].Fixes #72 (once merged).
Nice work! Thanks @GabrielMajeri. I'm not sure if we've got an idea of when
macro_vis_matchershould stabilise yet, but hopefully there shouldn't be much churn here so I think it's safe to keep this around for a bit.Also worth noting that once it does stabilise and we do merge then the minimum
rustcversion will be bumped.This can go in behind a cargo feature, right?
@tamird yes it can, I've now placed it behind the
visibilityCargo feature.Hmm, I'm not personally sold on the need for a
cargofeature, at least not long-term. I get that bumping the minimumrustcversion is potentially breaking, especially if we bump it to the latest stable right away. But sincepub(restricted)is a fundamental language feature it seems weird to need a cargo feature to support a language feature in another language feature. So if we did want one now to minimise breakage then I'd be happy if we had a plan to make it the status-quo down the track.Do you have any thoughts @alexcrichton?
I don't follow, @KodrAus. Using a cargo feature allows this to merge before the necessary bits are stabilized upstream. Bumping the minimum rust version is a separate discussion - there's no reason to hold this up on that decision.
Yep, sorry @tamird I was getting ahead of myself 😅 Feel free to ignore all of that until
visstabilises.Oh I figured we'd just add support when this is in stable rust, but I don't think it is?
Yeh it looks like it's still unstable.
I was originally thinking we shouldn't release with a cargo feature because then we'd have to maintain a fork of the macro, and people shouldn't need to use a feature to get
pub(restricted)once it's stable.But I think we could use a feature, and then when it does stabilise we could just make that feature a no-op, since the
:vismacro version is essentially more general.I guess the alternative is not use a feature and let this PR sit here waiting until it can work on stable, but I don't know when that would be.
That's true yeah, I'd also be ok landing it behind an off-by-default feature.
I would prefer to do this in a way that immediately works on stable. Would something like this be possible?
Neat! What do you think @GabrielMajeri?
@KodrAus I have created a new pull request for that (#135), and will keep this updated for when
visstabilizes.Superseded by #135.
Pull request closed