std: add auto traits to TAIT bound

This commit is contained in:
joboet 2023-07-26 12:30:52 +02:00
parent 6776af529a
commit 29e3f8b793
No known key found for this signature in database
GPG Key ID: 704E0149B0194B3C
2 changed files with 6 additions and 11 deletions

View File

@ -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 || {

View File

@ -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>();
}