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

compilation is failing on importing internal proto files #767

Closed
3olkin opened this issue Sep 18, 2021 · 1 comment
Closed

compilation is failing on importing internal proto files #767

3olkin opened this issue Sep 18, 2021 · 1 comment
Labels
A-build C-bug Category: Something isn't working
Milestone

Comments

@3olkin
Copy link

3olkin commented Sep 18, 2021

Bug Report

Version

└──tonic v0.5.2
└── tonic-build v0.5.2

Platform

Linux 5.11.0-34-generic #36~20.04.1-Ubuntu SMP Fri Aug 27 08:06:32 UTC 2021 x86_64

Description

I tried to import local proto, but cargo check failed.

Compiler output:

error[E0433]: failed to resolve: there are too many leading `super` keywords
  --> /home/z4rx/Code/projects/tonic_issue/target/debug/build/tonic_issue-6b3a7d73b6aa2eac/out/service.rs:69:44
   |
69 |         ) -> Result<tonic::Response<super::super::domain::User>, tonic::Status> {
   |                                            ^^^^^ there are too many leading `super` keywords

error[E0433]: failed to resolve: there are too many leading `super` keywords
  --> /home/z4rx/Code/projects/tonic_issue/target/debug/build/tonic_issue-6b3a7d73b6aa2eac/out/service.rs:92:44
   |
92 |         ) -> Result<tonic::Response<super::super::domain::User>, tonic::Status>;
   |                                            ^^^^^ there are too many leading `super` keywords

error[E0433]: failed to resolve: there are too many leading `super` keywords
   --> /home/z4rx/Code/projects/tonic_issue/target/debug/build/tonic_issue-6b3a7d73b6aa2eac/out/service.rs:137:48
    |
137 |                         type Response = super::super::domain::User;
    |                                                ^^^^^ there are too many leading `super` keywords

error[E0698]: type inside `async fn` body must be known in this context
  --> /home/z4rx/Code/projects/tonic_issue/target/debug/build/tonic_issue-6b3a7d73b6aa2eac/out/service.rs:76:25
   |
76 |             let codec = tonic::codec::ProstCodec::default();
   |                         ^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type for type parameter `U`
   |
note: the type is part of the `async fn` body because of this `await`
  --> /home/z4rx/Code/projects/tonic_issue/target/debug/build/tonic_issue-6b3a7d73b6aa2eac/out/service.rs:78:13
   |
78 |             self.inner.unary(request.into_request(), path, codec).await
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Repository for reproduce this error: https://github.com/Z4RX/tonic_issue

@LucioFranco LucioFranco added A-build C-bug Category: Something isn't working labels Oct 13, 2021
@LucioFranco LucioFranco modified the milestones: 0.6, 0.7 Oct 13, 2021
@DerekStrickland
Copy link
Contributor

I think you want include_file. Check out this PR for an example.

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
Development

No branches or pull requests

3 participants