#semver #version #macro #error #compilation #foo

nightly macro allow-until

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

2 unstable releases

0.2.0 Aug 25, 2023
0.1.0 Aug 23, 2023

#2607 in Development tools

MIT license

11KB
164 lines

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.

Dependencies

~74KB