| Crates.io | dyn_safe-proc_macros |
| lib.rs | dyn_safe-proc_macros |
| version | 0.1.0 |
| created_at | 2020-11-20 20:27:25.741114+00 |
| updated_at | 2025-08-20 20:52:27.040163+00 |
| description | `::dyn_safe`'s internal crate. |
| homepage | https://crates.io/crates/dyn_safe |
| repository | https://github.com/danielhenrymantilla/dyn_safe.rs |
| max_upload_size | |
| id | 314447 |
| size | 11,998 |
::dyn_safedyn safety of your traits!cargo add dyn_safe, or add the following to your Cargo.toml file:
[dependencies]
dyn_safe = "x.y.z"
cargo search dyn_safeAdd the following to your lib.rs file:
#[macro_use]
extern crate dyn_safe;
Use #[dyn_safe(true)] or #[dyn_safe(false)] to, respectively,
assert that the trait object is dyn-safe or that the trait
object should not be dyn-safe.
#[macro_use]
extern crate dyn_safe;
#[dyn_safe(true)]
trait Foo {
fn whoops ();
}
#[macro_use]
extern crate dyn_safe;
#[dyn_safe(false)]
trait Foo {
// …
}
let _: dyn Foo; // Whoops