From 5255fc9d240e236a6ce2b2aaaf08915ede593328 Mon Sep 17 00:00:00 2001 From: Paul Dicker Date: Sat, 8 Jul 2023 08:25:42 +0200 Subject: [PATCH] Verify bounds at compile time in `test_datetime_is_send_and_copy` --- src/datetime/tests.rs | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/src/datetime/tests.rs b/src/datetime/tests.rs index 1874d968b2..9c73232885 100644 --- a/src/datetime/tests.rs +++ b/src/datetime/tests.rs @@ -1148,26 +1148,10 @@ fn test_datetime_format_with_local() { } #[test] -#[cfg(feature = "clock")] -fn test_datetime_is_copy() { - // UTC is known to be `Copy`. - let a = Utc::now(); - let b = a; - assert_eq!(a, b); -} - -#[test] -#[cfg(feature = "clock")] -fn test_datetime_is_send() { - use std::thread; - - // UTC is known to be `Send`. - let a = Utc::now(); - thread::spawn(move || { - let _ = a; - }) - .join() - .unwrap(); +fn test_datetime_is_send_and_copy() { + fn _assert_send_copy() {} + // UTC is known to be `Send + Copy`. + _assert_send_copy::>(); } #[test]