Closed
Description
(This is related to #7661. It is in fact the second case there, but moved into a new issue as it languished there with the rest fixed.)
fn require_send<T: Send>(_: T){}
trait TragicallySelfIsNotSend: Send {
fn x(self) {
require_send(self);
}
}
fn main(){}
This does not compile, though it should:
<anon>:5:8: 5:20 error: instantiating a type parameter with an incompatible type `Self`, which does not fulfill `Send`
<anon>:5 require_send(self);
^~~~~~~~~~~~
error: aborting due to previous error
I need this to be able to refer to self
inside a spawn
closure, and that will only work if it's Send, and so there I sadly cannot provide a default method implementation of the trait at present.
(buzzwords for search: built-in trait inheritance.)