revert change incorrectly identified as "hack"
put back negative impls to ensure `Span` is not `Send` nor `Sync`
This commit is contained in:
parent
cb8158d847
commit
bb97fe0bae
1 changed files with 8 additions and 0 deletions
|
@ -227,6 +227,14 @@ impl SpanData {
|
|||
}
|
||||
}
|
||||
|
||||
// The interner is pointed to by a thread local value which is only set on the main thread
|
||||
// with parallelization is disabled. So we don't allow `Span` to transfer between threads
|
||||
// to avoid panics and other errors, even though it would be memory safe to do so.
|
||||
#[cfg(not(parallel_compiler))]
|
||||
impl !Send for Span {}
|
||||
#[cfg(not(parallel_compiler))]
|
||||
impl !Sync for Span {}
|
||||
|
||||
impl PartialOrd for Span {
|
||||
fn partial_cmp(&self, rhs: &Self) -> Option<Ordering> {
|
||||
PartialOrd::partial_cmp(&self.data(), &rhs.data())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue