From 8500fb9c6995379027bc2e5b98dcdee00d37ddd1 Mon Sep 17 00:00:00 2001 From: David Teller Date: Thu, 7 Dec 2017 16:04:59 +0100 Subject: [PATCH] Issue #46555 - Making IndexVec Send if its contents are Send --- src/librustc_data_structures/indexed_vec.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/librustc_data_structures/indexed_vec.rs b/src/librustc_data_structures/indexed_vec.rs index e2f50c8c8891b..19528a1403828 100644 --- a/src/librustc_data_structures/indexed_vec.rs +++ b/src/librustc_data_structures/indexed_vec.rs @@ -330,6 +330,10 @@ pub struct IndexVec { _marker: PhantomData } +// Whether `IndexVec` is `Send` depends only on the data, +// not the phantom data. +unsafe impl Send for IndexVec where T: Send {} + impl serialize::Encodable for IndexVec { fn encode(&self, s: &mut S) -> Result<(), S::Error> { serialize::Encodable::encode(&self.raw, s)