Registry / utility / static-assertions

static-assertions

JSON →
library1.1.0rscratesunverified

Compile-time assertions to ensure that invariants are met, such as type sizes or alignment.

# Cargo.toml [dependencies] static_assertions = "1.1.0"
INSTALL
IMPORT
SIG · STATIC-ASSERTIONS
S
static-assertions
utilityrustv1.1.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

assert_eq_size
use static_assertions::assert_eq_size;

Asserts that two types have the same size at compile time.

use static_assertions::assert_eq_size; assert_eq_size!([u8; 4], u32); fn main() { println!("Compile-time assertion passed"); }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
1.1.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
static-assertions — cargo add static-assertions · libregistry