Skip to content

Commit

Permalink
Add more autotraits tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Sep 15, 2024
1 parent 139f266 commit a85e414
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/test_autotrait.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#![allow(clippy::extra_unused_type_parameters)]

use anyhow::Error;
use std::panic::{RefUnwindSafe, UnwindSafe};

#[test]
fn test_send() {
Expand All @@ -13,3 +14,21 @@ fn test_sync() {
fn assert_sync<T: Sync>() {}
assert_sync::<Error>();
}

#[test]
fn test_unwind_safe() {
fn assert_unwind_safe<T: UnwindSafe>() {}
assert_unwind_safe::<Error>();
}

#[test]
fn test_ref_unwind_safe() {
fn assert_ref_unwind_safe<T: RefUnwindSafe>() {}
assert_ref_unwind_safe::<Error>();
}

#[test]
fn test_unpin() {
fn assert_unpin<T: Unpin>() {}
assert_unpin::<Error>();
}

0 comments on commit a85e414

Please sign in to comment.