Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating a service named Service produces weird errors with tonic-build #676

Closed
Dentosal opened this issue Jun 4, 2021 · 0 comments · Fixed by #709 or #737
Closed

Creating a service named Service produces weird errors with tonic-build #676

Dentosal opened this issue Jun 4, 2021 · 0 comments · Fixed by #709 or #737
Labels
A-build C-bug Category: Something isn't working

Comments

@Dentosal
Copy link

Dentosal commented Jun 4, 2021

Bug Report

Version

tonic v0.4.3
tonic-build v0.4.2

Platform

Windows 10 (64bit) running WSL1 4.4.0-19041-Microsoft #488-Microsoft x86_64 GNU/Linux

Description

Creating a service named Service like this:

syntax = "proto3";
package example;

service Service {
    rpc Anything (Anything) returns (Anything);
}

produces errors like:

error[E0437]: type `Response` is not a member of trait `Service`
   --> /path/to/project/target/debug/build/t_common-fb7feb9559309b84/out/example.rs:123:3
    |
107 |         type Response = http::Response<tonic::body::BoxBody>;
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not a member of trait `Service`

error[E0437]: type `Error` is not a member of trait `Service`
   --> /path/to/project/target/debug/build/t_common-fb7feb9559309b84/out/example.rs:123:4
    |
108 |         type Error = Never;
    |         ^^^^^^^^^^^^^^^^^^^ not a member of trait `Service`

I would expect the code to work, or at least produce a proper error message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-build C-bug Category: Something isn't working
Projects
None yet
2 participants