Odd Send/Sync question

Is it possible that I will ever encounter a type T such that:

//Either
T: Send
[T]: !Send
//Or
T: Sync
[T]: !Sync
//Or
T: Send + Sync
[T]: !Send + !Sync

Because I've hit a bit of a snag in my library, where if this was possible, this could technically be exploited to get a [T] even when T: Send and [T]: !Send or another of the above, which would be unsafe.

I linked to beta, because the stable docs aren't showing this information, but I expect it has been the same for a long time. The auto-implementations for [T] are solely dependent on the same for T.

impl<T> Send for [T]
where
    T: Send, 
impl<T> Sync for [T]
where
    T: Sync, 
6 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.