When calling methods on Arc<MyService> where the method is also defined on Arc (e.g. drop and clone), calling handler_copy.method(o, p) will actually attempt to call the Arc method instead of the method on the service, resulting in a compiler error. This change removes the ambiguity by dereferencing the Arc.
// proto file:
message DropReq {}
message DropResp {}
service HelloService {
rpc Drop (DropReq) returns (DropResp);
rpc Clone (DropReq) returns (DropResp);
}
When calling methods on
Arc<MyService>
where the method is also defined on Arc (e.g.drop
andclone
), calling handler_copy.method(o, p) will actually attempt to call the Arc method instead of the method on the service, resulting in a compiler error. This change removes the ambiguity by dereferencing theArc
.An alternative fix would be to use the fully qualified syntax for method calls (https://github.com/yonran/grpc-rust/commit/d5d7f4cd9b5ae029d7305e98209510c6bc24c151). I believe that this change should be good enough because H is only known to be
H : HelloService + 'static + Sync + Send + 'static
, andSync
andSend
define no other methods.