Repository: actix/actix (language: rust)

Issue:
Implement `Send` for `actix::message::Request` explicitly
## Expected Behavior
`actix::message::Request` explicitly (and unconditionally) implements `Send` regardless if it's `A` type-argument implements `Send`.

## Current Behavior

- `Request` contains `PhantomData<A>`
- `PhantomData<T>: Send` only when `T: Send`
- so, as a result, `Request` only implements `Send`, when it's `A` type-argument implements `Send`

As far as I can see, there is no real reason for that. `Request` does not ever directly interact with actor, only sends a message through a channel.

## Possible Solution

I've looked through the code, this seems to be enough:

```rust
unsafe impl<A, M> Send for Request<A, M> 
where
    A: Handler<M>,
    A::Context: ToEnvelope<A, M>,
    M: Message + Send,
    M::Result: Send,
{
}
```

## Context

I'm working on a web-service using `actix-web` and `juniper` (GraphQL implementation in Rust). Due to current shortcomings in `juniper` it requires `Send` futures. So, if I want to interact with my actors from inside my GraphQL handlers, I have to heavily bound all my actors to be `Send`.

## Your Environment

- Rust Version: 1.44.1
- Actix Version: 0.9, 0.10-*



Discussion / hints:
@ffuugoo there is no sense to provide `unsafe impl Send`. It's enough to use `PhantomData<std::thread::JoinHandle<T>>` instead of just `PhantomData<T>`. Better go with a PR.
@tyranron Opened #407, only made it `AtomicPtr` rather than `JoinHandle`, cause it seems better fitting (kinda like `*const A`).

Fix patch:
diff --git a/CHANGES.md b/CHANGES.md
index d711c080c..f6a2698c0 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -10,9 +10,13 @@
 
 * Update `parking_lot` to 0.11 [#404]
 
+* Remove unnecessary `PhantomData` field from `Request` making it `Send + Sync`
+  regardless if `Request`'s type-argument is `Send` or `Sync` [#407]
+
 [#384]: https://github.com/actix/actix/pull/384
 [#403]: https://github.com/actix/actix/pull/403
 [#404]: https://github.com/actix/actix/pull/404
+[#407]: https://github.com/actix/actix/pull/407
 
 ## [0.10.0-alpha.3] - 2020-05-13
 
diff --git a/src/address/message.rs b/src/address/message.rs
index 2d878cdaf..4a2b4304d 100644
--- a/src/address/message.rs
+++ b/src/address/message.rs
@@ -1,5 +1,4 @@
 use std::future::Future;
-use std::marker::PhantomData;
 use std::pin::Pin;
 use std::task::{self, Poll};
 use std::time::Duration;
@@ -27,7 +26,6 @@ where
     rx: Option<oneshot::Receiver<M::Result>>,
     info: Option<(AddressSender<A>, M)>,
     timeout: Option<Delay>,
-    act: PhantomData<A>,
 }
 
 impl<A, M> Request<A, M>
@@ -44,7 +42,6 @@ where
             rx,
             info,
             timeout: None,
-            act: PhantomData,
         }
     }
 


Test patch: