diff options
| author | David Teller <D.O.Teller@gmail.com> | 2017-12-07 16:04:59 +0100 |
|---|---|---|
| committer | David Teller <D.O.Teller@gmail.com> | 2017-12-07 16:04:59 +0100 |
| commit | 8500fb9c6995379027bc2e5b98dcdee00d37ddd1 (patch) | |
| tree | be57d3b9c59e3bf2d6a8a8323f4878de0fc7ed30 /src/librustc_data_structures | |
| parent | d1364a65c0e064ee12aea8d58aceb403b8200682 (diff) | |
| download | rust-8500fb9c6995379027bc2e5b98dcdee00d37ddd1.tar.gz rust-8500fb9c6995379027bc2e5b98dcdee00d37ddd1.zip | |
Issue #46555 - Making IndexVec Send if its contents are Send
Diffstat (limited to 'src/librustc_data_structures')
| -rw-r--r-- | src/librustc_data_structures/indexed_vec.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/librustc_data_structures/indexed_vec.rs b/src/librustc_data_structures/indexed_vec.rs index e2f50c8c889..19528a14038 100644 --- a/src/librustc_data_structures/indexed_vec.rs +++ b/src/librustc_data_structures/indexed_vec.rs @@ -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) |
