Sha256: b3fa96b52a98b2111e845b59974910acb107a6526514c80fc5d9db7eed402682

Contents?: true

Size: 638 Bytes

Versions: 20

Compression:

Stored size: 638 Bytes

Contents

#![allow(clippy::extra_unused_type_parameters)]

mod drop;

use self::drop::{DetectDrop, Flag};
use anyhow::Error;
use std::marker::Unpin;
use std::mem;

#[test]
fn test_error_size() {
    assert_eq!(mem::size_of::<Error>(), mem::size_of::<usize>());
}

#[test]
fn test_null_pointer_optimization() {
    assert_eq!(mem::size_of::<Result<(), Error>>(), mem::size_of::<usize>());
}

#[test]
fn test_autotraits() {
    fn assert<E: Unpin + Send + Sync + 'static>() {}
    assert::<Error>();
}

#[test]
fn test_drop() {
    let has_dropped = Flag::new();
    drop(Error::new(DetectDrop::new(&has_dropped)));
    assert!(has_dropped.get());
}

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
wasmtime-18.0.3 ./ext/cargo-vendor/anyhow-1.0.79/tests/test_repr.rs
wasmtime-17.0.1 ./ext/cargo-vendor/anyhow-1.0.79/tests/test_repr.rs
wasmtime-17.0.0 ./ext/cargo-vendor/anyhow-1.0.79/tests/test_repr.rs
wasmtime-16.0.0 ./ext/cargo-vendor/anyhow-1.0.79/tests/test_repr.rs
wasmtime-15.0.1 ./ext/cargo-vendor/anyhow-1.0.79/tests/test_repr.rs
wasmtime-15.0.0 ./ext/cargo-vendor/anyhow-1.0.79/tests/test_repr.rs
wasmtime-14.0.4 ./ext/cargo-vendor/anyhow-1.0.75/tests/test_repr.rs
wasmtime-14.0.3 ./ext/cargo-vendor/anyhow-1.0.75/tests/test_repr.rs
wasmtime-14.0.1 ./ext/cargo-vendor/anyhow-1.0.75/tests/test_repr.rs
wasmtime-14.0.0 ./ext/cargo-vendor/anyhow-1.0.75/tests/test_repr.rs
wasmtime-13.0.0 ./ext/cargo-vendor/anyhow-1.0.75/tests/test_repr.rs
wasmtime-12.0.1 ./ext/cargo-vendor/anyhow-1.0.75/tests/test_repr.rs
wasmtime-12.0.0 ./ext/cargo-vendor/anyhow-1.0.75/tests/test_repr.rs
wasmtime-11.0.0 ./ext/cargo-vendor/anyhow-1.0.75/tests/test_repr.rs
wasmtime-10.0.1 ./ext/cargo-vendor/anyhow-1.0.72/tests/test_repr.rs
wasmtime-10.0.0 ./ext/cargo-vendor/anyhow-1.0.72/tests/test_repr.rs
wasmtime-9.0.4 ./ext/cargo-vendor/anyhow-1.0.72/tests/test_repr.rs
wasmtime-9.0.1 ./ext/cargo-vendor/anyhow-1.0.71/tests/test_repr.rs
wasmtime-8.0.0 ./ext/cargo-vendor/anyhow-1.0.70/tests/test_repr.rs
wasmtime-7.0.0 ./ext/cargo-vendor/anyhow-1.0.70/tests/test_repr.rs