Attribute Macro breaking

Source
#[breaking]
Expand description

Marks an item that will break the public API if it is changed.

This attribute takes a single argument, which must be a string literal of the url-safe base64- encoded hash of the token stream of the item marked by this attribute.

Changes to items marked with this attribute require updating the hash argument (which can be retrieved from the compile error generated by running it with a wrong hash) and most likely bumping the major version of the crate containing the item. At the very least, it must be explained in the commit message and any accompanying PR why the hash was updated without bumping the major version.

ยงHashers

Multiple hash functions are supported via feature flags.

use breaking_attr::breaking;

#[breaking(sha384 = "82y9Notlejn-Nfzl4SurR3m3Uqeaqt0jmN-wGHSAjNkHeywz1zYZeUJi-5-D0wo3")]
const SHA_384: &str = "This string must not change without updating the hash.";

#[breaking("IjrbZ-YsIRSb2v3ELtz-4zMqGvu5FVCkwotqCKMdhDE=")]
const DEFAULT: &str = "The default hasher is `blake3`";