mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +00:00
Issue #46555 - Making IndexVec Send if its contents are Send
This commit is contained in:
parent
d1364a65c0
commit
8500fb9c69
@ -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…
Reference in New Issue
Block a user