Sha256: 504cf66f0d5b8e335be02f9ae8b0a355abc98c2c82eec0098bdf0988e662e260

Contents?: true

Size: 890 Bytes

Versions: 19

Compression:

Stored size: 890 Bytes

Contents

//! Workarounds for Rust 1.63 where some things in the `static_assertions`
//! crate do things that don't work in const contexts. We want to call them in
//! const contexts in Rust versions where that's supported so that problems are
//! caught at compile time, and fall back to dynamic asserts in Rust 1.63.

#![allow(unused_macros)]

macro_rules! assert_eq_size {
    ($x:ty, $y:ty) => {
        assert_eq!(core::mem::size_of::<$x>(), core::mem::size_of::<$y>());
    };
}

macro_rules! assert_eq_align {
    ($x:ty, $y:ty) => {
        assert_eq!(core::mem::align_of::<$x>(), core::mem::align_of::<$y>());
    };
}

macro_rules! const_assert_eq {
    ($x:expr, $y:expr) => {
        assert_eq!($x, $y);
    };
}

macro_rules! const_assert_ne {
    ($x:expr, $y:expr) => {
        assert_ne!($x, $y);
    };
}

macro_rules! const_assert {
    ($x:expr) => {
        assert!($x);
    };
}

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
wasmtime-29.0.0 ./ext/cargo-vendor/rustix-0.38.44/src/static_assertions.rs
wasmtime-28.0.0 ./ext/cargo-vendor/rustix-0.38.43/src/static_assertions.rs
wasmtime-27.0.0 ./ext/cargo-vendor/rustix-0.38.41/src/static_assertions.rs
wasmtime-26.0.0 ./ext/cargo-vendor/rustix-0.38.37/src/static_assertions.rs
wasmtime-25.0.2 ./ext/cargo-vendor/rustix-0.38.34/src/static_assertions.rs
wasmtime-25.0.1 ./ext/cargo-vendor/rustix-0.38.34/src/static_assertions.rs
wasmtime-25.0.0 ./ext/cargo-vendor/rustix-0.38.34/src/static_assertions.rs
wasmtime-24.0.0 ./ext/cargo-vendor/rustix-0.38.34/src/static_assertions.rs
wasmtime-23.0.2 ./ext/cargo-vendor/rustix-0.38.34/src/static_assertions.rs
wasmtime-22.0.0 ./ext/cargo-vendor/rustix-0.38.34/src/static_assertions.rs
wasmtime-21.0.1 ./ext/cargo-vendor/rustix-0.38.34/src/static_assertions.rs
wasmtime-20.0.2 ./ext/cargo-vendor/rustix-0.38.34/src/static_assertions.rs
wasmtime-20.0.0 ./ext/cargo-vendor/rustix-0.38.34/src/static_assertions.rs
wasmtime-18.0.3 ./ext/cargo-vendor/rustix-0.38.28/src/static_assertions.rs
wasmtime-17.0.1 ./ext/cargo-vendor/rustix-0.38.28/src/static_assertions.rs
wasmtime-17.0.0 ./ext/cargo-vendor/rustix-0.38.28/src/static_assertions.rs
wasmtime-16.0.0 ./ext/cargo-vendor/rustix-0.38.28/src/static_assertions.rs
wasmtime-15.0.1 ./ext/cargo-vendor/rustix-0.38.28/src/static_assertions.rs
wasmtime-15.0.0 ./ext/cargo-vendor/rustix-0.38.28/src/static_assertions.rs