diff options
| -rw-r--r-- | library/std/src/backtrace.rs | 7 | ||||
| -rw-r--r-- | library/std/tests/backtrace.rs | 10 |
2 files changed, 6 insertions, 11 deletions
diff --git a/library/std/src/backtrace.rs b/library/std/src/backtrace.rs index 18d5f3e9108..f0e199fac73 100644 --- a/library/std/src/backtrace.rs +++ b/library/std/src/backtrace.rs @@ -140,6 +140,11 @@ struct Capture { frames: Vec<BacktraceFrame>, } +fn _assert_send_sync() { + fn _assert<T: Send + Sync>() {} + _assert::<Backtrace>(); +} + /// 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 531c5f89cf6..00000000000 --- 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<T: Send + Sync>() {} - - assert::<Backtrace>(); -} |
