You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use tonic::{Request,Response,Status};use pb::*;pubmod pb {
tonic::include_proto!("example");}#[derive(Debug,Default)]structService;#[tonic::async_trait]impl example_service_server::ExampleServiceforService{asyncfnvoid(&self,_request:Request<Empty>) -> Result<Response<Empty>,Status>{todo!()}}fnmain(){}
When running cargo clippy, the following output prints:
error[E0433]: failed to resolve: could not find `foo` in the crate root
--> [...]/target/debug/build/tonic_bug_mre-913b1807619270b3/out/example.rs:88:60
|
88 | request: impl tonic::IntoRequest<super::super::foo::bar::Foo>,
| ^^^ could not find `foo` in the crate root
... many more similar error messages
It seems like tonic is not set up to handle packages with dotted names (i.e. foo.bar) in imports.
If the dotted package is 'standalone', that works. Is there anything I overlooked to make this work?
The text was updated successfully, but these errors were encountered:
Bug Report
Version
tonic v0.11.0
tonic-build v0.11.0
Platform
Darwin 23.2.0 Darwin Kernel Version 23.2.0: Wed Nov 15 21:55:06 PST 2023; root:xnu-10002.61.3~2/RELEASE_ARM64_T6020 arm64
Description
I have the following two proto files:
foobar.proto
example.proto
and a
main.rs
file:When running
cargo clippy
, the following output prints:It seems like tonic is not set up to handle packages with dotted names (i.e.
foo.bar
) in imports.If the dotted package is 'standalone', that works. Is there anything I overlooked to make this work?
The text was updated successfully, but these errors were encountered: