Skip to content
Myr

test_autotrait.rs

This file

Path

tests/test_autotrait.rs

34 lines · 631 bytes · Rust

Last changed by

Add more autotraits testsDavid Tolnaybefore adoptiona85e414

History of this file

Take it

1#![allow(clippy::extra_unused_type_parameters)]23use anyhow::Error;4use std::panic::{RefUnwindSafe, UnwindSafe};56#[test]7fn test_send() {8    fn assert_send<T: Send>() {}9    assert_send::<Error>();10}1112#[test]13fn test_sync() {14    fn assert_sync<T: Sync>() {}15    assert_sync::<Error>();16}1718#[test]19fn test_unwind_safe() {20    fn assert_unwind_safe<T: UnwindSafe>() {}21    assert_unwind_safe::<Error>();22}2324#[test]25fn test_ref_unwind_safe() {26    fn assert_ref_unwind_safe<T: RefUnwindSafe>() {}27    assert_ref_unwind_safe::<Error>();28}2930#[test]31fn test_unpin() {32    fn assert_unpin<T: Unpin>() {}33    assert_unpin::<Error>();34}