-
Notifications
You must be signed in to change notification settings - Fork 54
MCP: pub(macro) #59
Copy link
Copy link
Closed
Labels
T-langdisposition-closeThe FCP starter wants to close thisThe FCP starter wants to close thisfinal-comment-periodThe FCP has started, most (if not all) team members are in agreementThe FCP has started, most (if not all) team members are in agreementmajor-changeMajor change proposalMajor change proposalto-announceNot yet announced MCP proposalsNot yet announced MCP proposals
Metadata
Metadata
Assignees
Labels
T-langdisposition-closeThe FCP starter wants to close thisThe FCP starter wants to close thisfinal-comment-periodThe FCP has started, most (if not all) team members are in agreementThe FCP has started, most (if not all) team members are in agreementmajor-changeMajor change proposalMajor change proposalto-announceNot yet announced MCP proposalsNot yet announced MCP proposals
Type
Fields
Give feedbackNo fields configured for issues without a type.
Proposal
Summary and problem statement
This idea came from this line of code from the
logcrate https://github.com/rust-lang/log/blob/master/src/lib.rs#L1441There is currently no way of keeping a function private while also using them in a public macro. This causes crate developers to resort to warning comments and function name prefixes.
With my feature, functions marked
pub(macro)would become public to macros defined in the same crate.Motivation, use-cases, and solution sketches
With my feature
would become
Prioritization
This fits with "Targeted ergonomic wins and extensions". Warning comments and function prefixes do not feel ergonomic.
Links and related work
I understand that hygienic macros could make this feature no longer needed in future. I hope this could act as a smaller, easier to implement incremental step.
rust-lang/rfcs#2968
Initial people involved
TBD
What happens now?
This issue is part of the experimental MCP process described in RFC 2936. Once this issue is filed, a Zulip topic will be opened for discussion, and the lang-team will review open MCPs in its weekly triage meetings. You should receive feedback within a week or two.
This issue is not meant to be used for technical discussion. There is a Zulip stream for that. Use this issue to leave procedural comments, such as volunteering to review, indicating that you second the proposal (or third, etc), or raising a concern that you would like to be addressed.