Skip to content

Commit 0baa925

Browse files
authored
put back the workarounds for #60846
based on #61754 (comment) I am adding `bootstrap` to the cfg-preconditions for the two manual `unsafe impls`'s of `Send` and `Sync` for `TokenTree`.
1 parent bb97fe0 commit 0baa925

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/libsyntax/tokenstream.rs

+11
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,17 @@ where
5959
TokenStream: Send + Sync,
6060
{}
6161

62+
// These are safe since we ensure that they hold for all fields in the `_dummy` function.
63+
//
64+
// These impls are only here because the compiler takes forever to compute the Send and Sync
65+
// bounds without them.
66+
// FIXME: Remove these impls when the compiler can compute the bounds quickly again.
67+
// See https://github.com/rust-lang/rust/issues/60846
68+
#[cfg(all(bootstrap, parallel_compiler))]
69+
unsafe impl Send for TokenTree {}
70+
#[cfg(all(bootstrap, parallel_compiler))]
71+
unsafe impl Sync for TokenTree {}
72+
6273
impl TokenTree {
6374
/// Use this token tree as a matcher to parse given tts.
6475
pub fn parse(cx: &base::ExtCtxt<'_>, mtch: &[quoted::TokenTree], tts: TokenStream)

0 commit comments

Comments
 (0)