Rename "pub" to "export"

Todo list

  1. make d-d accept export as well as pub (!389 (merged))
  2. make template_export_semver_check an alias for pub_template_semver_check (!390 (merged))
  3. document export as primary (!389 (merged))
  4. update guide examples (!412 (merged))
  5. update arti.git tpo/core/arti!2209 (merged)
  6. update @nickm's experimental serde and builder branches nickm/serde-deftly!1 nickm/build-deftly!1
  7. bump "template export semver" minimum !429 (merged) !430 (merged)
  8. update affected tests
  9. remove support for pub and pub_template_semver_check !402 (merged)
  10. 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