allow-until 0.2.0

Allows an item until a specified semver version, and then errors on compilation.
Documentation
  • Coverage
  • 100%
    3 out of 3 items documented3 out of 3 items with examples
  • Size
  • Source code size: 10.62 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 268.65 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • DexterHill0/allow-until
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • DexterHill0

allow-until

Allows an item until a specified semver version, and then errors on compilation.

githubcrates-iodocs-rs

#[allow_until(version = ">= 1.0.x", reason = "struct is deprecated from version 1.0.x onwards")]
struct MyStruct {
    //....
}

Or with the derive macro:

#[derive(AllowUntil)]
struct MyStruct {
    #[allow_until(version = ">= 1.0.x", reason = "member is deprecated from version 1.0.x onwards")]
    foo: usize
}

Once the CARGO_PKG_VERSION matches the given semver predicate, the macro will cause a compilation error, therefore reminding you to update/remove the code.