Issue #46555 - Making IndexVec Send if its contents are Send
This commit is contained in:
parent
d1364a65c0
commit
8500fb9c69
1 changed files with 4 additions and 0 deletions
|
|
@ -330,6 +330,10 @@ pub struct IndexVec<I: Idx, T> {
|
|||
_marker: PhantomData<Fn(&I)>
|
||||
}
|
||||
|
||||
// Whether `IndexVec` is `Send` depends only on the data,
|
||||
// not the phantom data.
|
||||
unsafe impl<I: Idx, T> Send for IndexVec<I, T> where T: Send {}
|
||||
|
||||
impl<I: Idx, T: serialize::Encodable> serialize::Encodable for IndexVec<I, T> {
|
||||
fn encode<S: serialize::Encoder>(&self, s: &mut S) -> Result<(), S::Error> {
|
||||
serialize::Encodable::encode(&self.raw, s)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue