diff --git a/library/std/src/backtrace.rs b/library/std/src/backtrace.rs index 18d5f3e910838..f0e199fac737c 100644 --- a/library/std/src/backtrace.rs +++ b/library/std/src/backtrace.rs @@ -140,6 +140,11 @@ struct Capture { frames: Vec, } +fn _assert_send_sync() { + fn _assert() {} + _assert::(); +} + /// A single frame of a backtrace. #[unstable(feature = "backtrace_frames", issue = "79676")] pub struct BacktraceFrame { @@ -422,7 +427,7 @@ impl fmt::Display for Backtrace { } } -type LazyResolve = impl FnOnce() -> Capture; +type LazyResolve = impl (FnOnce() -> Capture) + Send + Sync; fn lazy_resolve(mut capture: Capture) -> LazyResolve { move || { diff --git a/library/std/tests/backtrace.rs b/library/std/tests/backtrace.rs deleted file mode 100644 index 531c5f89cf67f..0000000000000 --- a/library/std/tests/backtrace.rs +++ /dev/null @@ -1,10 +0,0 @@ -use std::backtrace::Backtrace; - -// Unfortunately, this cannot be a unit test because that causes problems -// with type-alias-impl-trait (the assert counts as a defining use). -#[test] -fn assert_send_sync() { - fn assert() {} - - assert::(); -}