tiberius icon indicating copy to clipboard operation
tiberius copied to clipboard

trivial: make `StmtStream` `Send`

Open agalakhov opened this issue 4 years ago • 3 comments

StmtStream was not Send due to pointer in PhantomData. This pointer makes no sense since PhantomData is already zero-sized.

This is likely to fix #103.

Signed-off-by: Alexey Galakhov [email protected]

agalakhov avatar Oct 17 '19 20:10 agalakhov

Technically this is related to dropchk, which is why a &'static R would be more appropriate.

I'm at this time not planning to cut another 0.3 release, since I'd like to get a preview of 0.4 (async/await) ready in a few weeks, with the goal of addressing most painpoints.

steffengy avatar Oct 17 '19 21:10 steffengy

Unfortunately &'static R won't work since it is not Send if R is not Sync. Only non-pointer type will do. Another possible solution would be unsafe impl Send.

agalakhov avatar Oct 17 '19 21:10 agalakhov

Yeah right, if I come accross something like this it on 0.4, which is substantially different, we likely just use PhantomData<R>.

On a more general note: Let me know in case you need this in 0.3 or if you want to wait a little longer until I get that ready.

Am 17.10.2019 23:55 schrieb Alexey Galakhov [email protected]:

Unfortunately &'static R won't work since it is not Send if R is not Sync. Only non-pointer type will do. Another possible solution would be unsafe impl Send.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/steffengy/tiberius/pull/105?email_source=notifications&email_token=AAJDWZ5N3T26AKMWGMNCIYTQPDNLVA5CNFSM4JB62Q52YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBRUUKQ#issuecomment-543377962, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAJDWZ6EQQUTAWWVPICGXF3QPDNLVANCNFSM4JB62Q5Q.

steffengy avatar Oct 18 '19 04:10 steffengy