-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
RFC: re-export stdlib macros from submodules #3365
base: master
Are you sure you want to change the base?
Conversation
4f65307
to
2a1428b
Compare
2a1428b
to
a41f7eb
Compare
Thanks for doing this work! Nit: I don't think Also, even for some of the unstable macros, we may want to provide them in the prelude if we're not providing them in the crate root. |
Yeah, that's fair. The first draft of this I shared on the libs Zulip had them under Though I do have a preference for |
ping @rust-lang/libs-api: I don't believe there should be anything major preventing this from being accepted? Whether to export |
This was discussed last week in the library API team meeting. We're generally on board with re-exporting macros in modules, but exactly which macro goes into which module still requires a lot of discussion. So while we do think we should do this in general, we don't think we can accept this RFC as is, since we don't think the the proposed categorization/modularization of the macros is the right one. It might be better to have smaller separate proposals for individual categories/modules. (E.g. a proposal to move the formatting related macros to std::fmt, with its own motivation.) We also briefly discussed what we would want to happen with new macros in the future. E.g. if we get a new formatting macro and all the existing ones are available in both std:: and std::fmt::, should the new one go in both or only in the latter, or both in the latter and reexported from the prelude, but not the crate root? The RFC currently doesn't mention anything about the subtle differnce between macros that we export in the prelude (e.g. In the long term, we thought it might be good to 'hide' the original exports from the crate root. We'll keep them there for backwards compatibility (because someone can do std::println!() today), but it would be nice if we can clean it up from the reference documentation. A |
This presumably refers to the use of
Is it something that can and should be dealt with using editions? This applies more to the prelude than macros explicitly used via |
Summary
This RFC proposed we start re-exporting macros currently exposed in
core::*
from submodules. We define a mapping of which macros to re-export from which submodules, though in some cases it makes most sense to keep the macros exported fromcore
.This RFC does not yet propose we deprecate or migrate any code, that is left up to future RFCs.
Rendered