::dyn_safe
Take control of the Semver hazard of the dyn
safety of your traits!
Usage
-
cargo add dyn_safe
, or add the following to yourCargo.toml
file:[] = "x.y.z"
- where you can find the version using
cargo search dyn_safe
- where you can find the version using
-
Add the following to your
lib.rs
file:extern crate dyn_safe;
-
Use
#[dyn_safe(true)]
or#[dyn_safe(false)]
to, respectively, assert that the trait object isdyn
-safe or that the trait object should not bedyn
-safe.-
extern crate dyn_safe;
-
extern crate dyn_safe; let _: dyn Foo; // Whoops
-