pub_template_semver_check!() { /* proc-macro */ }
Expand description

Check semver compatibility, for a crate which exports macros

Causes a compilation error if and only if the specified version of derive-deftly is prior to the last relevant change, compared to the currently-running one.

A relevant change is one which has semver implications for the API of a crate which exports derive-deftly templates.

§When and how to call this

If you export templates, with define_derive_deftly! { pub ..., call this macro too, once in your crate.

Pass it the version of derive-deftly that was current, when you last read the derive-deftly changelog and considered breaking changes.

(The argument must be a string literal, containing a 2- or 3-element version number.)

§Guarantee

You can upgrade your derive-deftly version, even across a semver-breaking change to derive-deftly, without making any consequential update to your crate’s own semver.

If a new version of derive-adhoc means your crate’s API has semver-relevant changes, this macro will throw an error. (Of course that will only happen across semver-breaking updates of derive-deftly.)

(Exporting a driver struct for derivation in downstream crates, #[derive_deftly_adhoc(pub)], is not covered by this promise.)

§Example

derive_deftly::pub_template_semver_check!("0.10.0");