Rename "pub" to "export"
Todo list
-
make d-d accept export
as well aspub
(!389 (merged)) -
make template_export_semver_check
an alias forpub_template_semver_check
(!390 (merged)) -
document export
as primary (!389 (merged)) -
update guide examples (!412 (merged)) -
update arti.git tpo/core/arti!2209 (merged) -
update @nickm's experimental serde and builder branches nickm/serde-deftly!1 nickm/build-deftly!1 -
bump "template export semver" minimum !429 (merged) !430 (merged) -
update affected tests -
remove support for pub
andpub_template_semver_check
!402 (merged) -
remove the ad-hoc export parsing tests in tests/expand/ (ie, I think,revert ed5bea16 and 52c8692a) !432 (merged)
Original discussion
Currently, pub
applies #[macro_export]
to our macro, which is necessary for using the template in another crate.
It is not necessary for using the template in the same crate, which can be done with pub(scope) use
.
While trying to rewrite the parts of the user guide, I found this a bit confusing. I think it would be clearer if instead of calling this option "pub", we called it "export" or "macro_export".
If we really wanted, we could also define pub()
as follows:
pub Template
expands to #[macro_export]
and pub use <template>;
.
pub(scope) Template
expands to pub(scope) use <template>;
only.
This would give semantics much closer to actual pub declarations.
Calling this a 1.0 blocker, since it would be a breaking change.
Edited by Ian Jackson