Skip to content

Instantly share code, notes, and snippets.

@vegai
Created January 25, 2019 10:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vegai/d902bf71ea12da8a81c2268c04e69794 to your computer and use it in GitHub Desktop.
Save vegai/d902bf71ea12da8a81c2268c04e69794 to your computer and use it in GitHub Desktop.
Checking twobuy-grpc v0.1.0 (/Users/vegai/git/twobuy-grpc)
warning: unused import: `twobuy_grpc::models::*`
--> src/main.rs:13:5
|
13 | use twobuy_grpc::models::*;
| ^^^^^^^^^^^^^^^^^^^^^^
|
= note: #[warn(unused_imports)] on by default
warning: unused import: `twobuy_grpc::schema::category::dsl::*`
--> src/main.rs:44:9
|
44 | use twobuy_grpc::schema::category::dsl::*;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0277]: `diesel::PgConnection` doesn't implement `std::fmt::Debug`
--> src/main.rs:24:5
|
24 | db: &'a PgConnection
| ^^^^^^^^^^^^^^^^^^^^ `diesel::PgConnection` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
|
= help: the trait `std::fmt::Debug` is not implemented for `diesel::PgConnection`
= note: required because of the requirements on the impl of `std::fmt::Debug` for `&diesel::PgConnection`
= note: required because of the requirements on the impl of `std::fmt::Debug` for `&&diesel::PgConnection`
= note: required for the cast to the object type `dyn std::fmt::Debug`
error[E0308]: mismatched types
--> src/main.rs:50:29
|
50 | let greet = Greet { db: connection };
| ^^^^^^^^^^
| |
| expected reference, found struct `diesel::PgConnection`
| help: consider borrowing here: `&connection`
|
= note: expected type `&diesel::PgConnection`
found type `diesel::PgConnection`
error[E0277]: `std::ptr::NonNull<pq_sys::pg_conn>` cannot be shared between threads safely
--> src/main.rs:54:18
|
54 | let mut h2 = Server::new(new_service, h2_settings, DefaultExecutor::current());
| ^^^^^^^^^^^ `std::ptr::NonNull<pq_sys::pg_conn>` cannot be shared between threads safely
|
= help: within `diesel::PgConnection`, the trait `std::marker::Sync` is not implemented for `std::ptr::NonNull<pq_sys::pg_conn>`
= note: required because it appears within the type `diesel::pg::connection::raw::RawConnection`
= note: required because it appears within the type `diesel::PgConnection`
= note: required because of the requirements on the impl of `std::marker::Send` for `&diesel::PgConnection`
= note: required because it appears within the type `Greet<'_>`
= note: required because it appears within the type `hello_world::server::greeter::methods::SayHello<Greet<'_>>`
= note: required because it appears within the type `tower_grpc::generic::server::unary::Inner<hello_world::server::greeter::methods::SayHello<Greet<'_>>>`
= note: required because it appears within the type `tower_grpc::generic::server::server_streaming::Inner<tower_grpc::generic::server::unary::Inner<hello_world::server::greeter::methods::SayHello<Greet<'_>>>, tower_grpc::generic::codec::Streaming<tower_grpc::codec::Decoder<hello_world::HelloRequest>, tower_grpc::body::BoxBody>>`
= note: required because it appears within the type `tower_grpc::generic::server::streaming::ResponseFuture<tower_grpc::generic::server::server_streaming::Inner<tower_grpc::generic::server::unary::Inner<hello_world::server::greeter::methods::SayHello<Greet<'_>>>, tower_grpc::generic::codec::Streaming<tower_grpc::codec::Decoder<hello_world::HelloRequest>, tower_grpc::body::BoxBody>>, tower_grpc::codec::Encoder<hello_world::HelloReply>>`
= note: required because it appears within the type `tower_grpc::generic::server::server_streaming::ResponseFuture<tower_grpc::generic::server::unary::Inner<hello_world::server::greeter::methods::SayHello<Greet<'_>>>, tower_grpc::codec::Encoder<hello_world::HelloReply>, tower_grpc::generic::codec::Streaming<tower_grpc::codec::Decoder<hello_world::HelloRequest>, tower_grpc::body::BoxBody>>`
= note: required because it appears within the type `tower_grpc::generic::server::unary::ResponseFuture<hello_world::server::greeter::methods::SayHello<Greet<'_>>, tower_grpc::codec::Encoder<hello_world::HelloReply>, tower_grpc::generic::codec::Streaming<tower_grpc::codec::Decoder<hello_world::HelloRequest>, tower_grpc::body::BoxBody>>`
= note: required because it appears within the type `tower_grpc::server::unary::ResponseFuture<hello_world::server::greeter::methods::SayHello<Greet<'_>>, tower_grpc::body::BoxBody, hello_world::HelloRequest>`
= note: required because it appears within the type `hello_world::server::greeter::Kind<tower_grpc::server::unary::ResponseFuture<hello_world::server::greeter::methods::SayHello<Greet<'_>>, tower_grpc::body::BoxBody, hello_world::HelloRequest>>`
= note: required because it appears within the type `std::result::Result<hello_world::server::greeter::Kind<tower_grpc::server::unary::ResponseFuture<hello_world::server::greeter::methods::SayHello<Greet<'_>>, tower_grpc::body::BoxBody, hello_world::HelloRequest>>, tower_grpc::status::Status>`
= note: required because it appears within the type `hello_world::server::greeter::ResponseFuture<Greet<'_>>`
= note: required because it appears within the type `tower_h2::server::BackgroundState<hello_world::server::greeter::ResponseFuture<Greet<'_>>, hello_world::server::greeter::ResponseBody<Greet<'_>>>`
= note: required because it appears within the type `tower_h2::server::Background<hello_world::server::greeter::ResponseFuture<Greet<'_>>, hello_world::server::greeter::ResponseBody<Greet<'_>>>`
= note: required because of the requirements on the impl of `futures::future::Executor<tower_h2::server::Background<hello_world::server::greeter::ResponseFuture<Greet<'_>>, hello_world::server::greeter::ResponseBody<Greet<'_>>>>` for `tokio_executor::global::DefaultExecutor`
= note: required by `<tower_h2::server::Server<S, E, B>>::new`
error[E0277]: `std::cell::Cell<i32>` cannot be shared between threads safely
--> src/main.rs:54:18
|
54 | let mut h2 = Server::new(new_service, h2_settings, DefaultExecutor::current());
| ^^^^^^^^^^^ `std::cell::Cell<i32>` cannot be shared between threads safely
|
= help: within `diesel::PgConnection`, the trait `std::marker::Sync` is not implemented for `std::cell::Cell<i32>`
= note: required because it appears within the type `diesel::connection::AnsiTransactionManager`
= note: required because it appears within the type `diesel::PgConnection`
= note: required because of the requirements on the impl of `std::marker::Send` for `&diesel::PgConnection`
= note: required because it appears within the type `Greet<'_>`
= note: required because it appears within the type `hello_world::server::greeter::methods::SayHello<Greet<'_>>`
= note: required because it appears within the type `tower_grpc::generic::server::unary::Inner<hello_world::server::greeter::methods::SayHello<Greet<'_>>>`
= note: required because it appears within the type `tower_grpc::generic::server::server_streaming::Inner<tower_grpc::generic::server::unary::Inner<hello_world::server::greeter::methods::SayHello<Greet<'_>>>, tower_grpc::generic::codec::Streaming<tower_grpc::codec::Decoder<hello_world::HelloRequest>, tower_grpc::body::BoxBody>>`
= note: required because it appears within the type `tower_grpc::generic::server::streaming::ResponseFuture<tower_grpc::generic::server::server_streaming::Inner<tower_grpc::generic::server::unary::Inner<hello_world::server::greeter::methods::SayHello<Greet<'_>>>, tower_grpc::generic::codec::Streaming<tower_grpc::codec::Decoder<hello_world::HelloRequest>, tower_grpc::body::BoxBody>>, tower_grpc::codec::Encoder<hello_world::HelloReply>>`
= note: required because it appears within the type `tower_grpc::generic::server::server_streaming::ResponseFuture<tower_grpc::generic::server::unary::Inner<hello_world::server::greeter::methods::SayHello<Greet<'_>>>, tower_grpc::codec::Encoder<hello_world::HelloReply>, tower_grpc::generic::codec::Streaming<tower_grpc::codec::Decoder<hello_world::HelloRequest>, tower_grpc::body::BoxBody>>`
= note: required because it appears within the type `tower_grpc::generic::server::unary::ResponseFuture<hello_world::server::greeter::methods::SayHello<Greet<'_>>, tower_grpc::codec::Encoder<hello_world::HelloReply>, tower_grpc::generic::codec::Streaming<tower_grpc::codec::Decoder<hello_world::HelloRequest>, tower_grpc::body::BoxBody>>`
= note: required because it appears within the type `tower_grpc::server::unary::ResponseFuture<hello_world::server::greeter::methods::SayHello<Greet<'_>>, tower_grpc::body::BoxBody, hello_world::HelloRequest>`
= note: required because it appears within the type `hello_world::server::greeter::Kind<tower_grpc::server::unary::ResponseFuture<hello_world::server::greeter::methods::SayHello<Greet<'_>>, tower_grpc::body::BoxBody, hello_world::HelloRequest>>`
= note: required because it appears within the type `std::result::Result<hello_world::server::greeter::Kind<tower_grpc::server::unary::ResponseFuture<hello_world::server::greeter::methods::SayHello<Greet<'_>>, tower_grpc::body::BoxBody, hello_world::HelloRequest>>, tower_grpc::status::Status>`
= note: required because it appears within the type `hello_world::server::greeter::ResponseFuture<Greet<'_>>`
= note: required because it appears within the type `tower_h2::server::BackgroundState<hello_world::server::greeter::ResponseFuture<Greet<'_>>, hello_world::server::greeter::ResponseBody<Greet<'_>>>`
= note: required because it appears within the type `tower_h2::server::Background<hello_world::server::greeter::ResponseFuture<Greet<'_>>, hello_world::server::greeter::ResponseBody<Greet<'_>>>`
= note: required because of the requirements on the impl of `futures::future::Executor<tower_h2::server::Background<hello_world::server::greeter::ResponseFuture<Greet<'_>>, hello_world::server::greeter::ResponseBody<Greet<'_>>>>` for `tokio_executor::global::DefaultExecutor`
= note: required by `<tower_h2::server::Server<S, E, B>>::new`
error[E0277]: `std::cell::RefCell<std::collections::HashMap<diesel::connection::StatementCacheKey<diesel::pg::Pg>, diesel::pg::connection::stmt::Statement>>` cannot be shared between threads safely
--> src/main.rs:54:18
|
54 | let mut h2 = Server::new(new_service, h2_settings, DefaultExecutor::current());
| ^^^^^^^^^^^ `std::cell::RefCell<std::collections::HashMap<diesel::connection::StatementCacheKey<diesel::pg::Pg>, diesel::pg::connection::stmt::Statement>>` cannot be shared between threads safely
|
= help: within `diesel::PgConnection`, the trait `std::marker::Sync` is not implemented for `std::cell::RefCell<std::collections::HashMap<diesel::connection::StatementCacheKey<diesel::pg::Pg>, diesel::pg::connection::stmt::Statement>>`
= note: required because it appears within the type `diesel::connection::StatementCache<diesel::pg::Pg, diesel::pg::connection::stmt::Statement>`
= note: required because it appears within the type `diesel::PgConnection`
= note: required because of the requirements on the impl of `std::marker::Send` for `&diesel::PgConnection`
= note: required because it appears within the type `Greet<'_>`
= note: required because it appears within the type `hello_world::server::greeter::methods::SayHello<Greet<'_>>`
= note: required because it appears within the type `tower_grpc::generic::server::unary::Inner<hello_world::server::greeter::methods::SayHello<Greet<'_>>>`
= note: required because it appears within the type `tower_grpc::generic::server::server_streaming::Inner<tower_grpc::generic::server::unary::Inner<hello_world::server::greeter::methods::SayHello<Greet<'_>>>, tower_grpc::generic::codec::Streaming<tower_grpc::codec::Decoder<hello_world::HelloRequest>, tower_grpc::body::BoxBody>>`
= note: required because it appears within the type `tower_grpc::generic::server::streaming::ResponseFuture<tower_grpc::generic::server::server_streaming::Inner<tower_grpc::generic::server::unary::Inner<hello_world::server::greeter::methods::SayHello<Greet<'_>>>, tower_grpc::generic::codec::Streaming<tower_grpc::codec::Decoder<hello_world::HelloRequest>, tower_grpc::body::BoxBody>>, tower_grpc::codec::Encoder<hello_world::HelloReply>>`
= note: required because it appears within the type `tower_grpc::generic::server::server_streaming::ResponseFuture<tower_grpc::generic::server::unary::Inner<hello_world::server::greeter::methods::SayHello<Greet<'_>>>, tower_grpc::codec::Encoder<hello_world::HelloReply>, tower_grpc::generic::codec::Streaming<tower_grpc::codec::Decoder<hello_world::HelloRequest>, tower_grpc::body::BoxBody>>`
= note: required because it appears within the type `tower_grpc::generic::server::unary::ResponseFuture<hello_world::server::greeter::methods::SayHello<Greet<'_>>, tower_grpc::codec::Encoder<hello_world::HelloReply>, tower_grpc::generic::codec::Streaming<tower_grpc::codec::Decoder<hello_world::HelloRequest>, tower_grpc::body::BoxBody>>`
= note: required because it appears within the type `tower_grpc::server::unary::ResponseFuture<hello_world::server::greeter::methods::SayHello<Greet<'_>>, tower_grpc::body::BoxBody, hello_world::HelloRequest>`
= note: required because it appears within the type `hello_world::server::greeter::Kind<tower_grpc::server::unary::ResponseFuture<hello_world::server::greeter::methods::SayHello<Greet<'_>>, tower_grpc::body::BoxBody, hello_world::HelloRequest>>`
= note: required because it appears within the type `std::result::Result<hello_world::server::greeter::Kind<tower_grpc::server::unary::ResponseFuture<hello_world::server::greeter::methods::SayHello<Greet<'_>>, tower_grpc::body::BoxBody, hello_world::HelloRequest>>, tower_grpc::status::Status>`
= note: required because it appears within the type `hello_world::server::greeter::ResponseFuture<Greet<'_>>`
= note: required because it appears within the type `tower_h2::server::BackgroundState<hello_world::server::greeter::ResponseFuture<Greet<'_>>, hello_world::server::greeter::ResponseBody<Greet<'_>>>`
= note: required because it appears within the type `tower_h2::server::Background<hello_world::server::greeter::ResponseFuture<Greet<'_>>, hello_world::server::greeter::ResponseBody<Greet<'_>>>`
= note: required because of the requirements on the impl of `futures::future::Executor<tower_h2::server::Background<hello_world::server::greeter::ResponseFuture<Greet<'_>>, hello_world::server::greeter::ResponseBody<Greet<'_>>>>` for `tokio_executor::global::DefaultExecutor`
= note: required by `<tower_h2::server::Server<S, E, B>>::new`
error[E0599]: no method named `map_err` found for type `tower_h2::server::Connection<tokio_tcp::stream::TcpStream, hello_world::server::GreeterServer<Greet<'_>>, tokio_executor::global::DefaultExecutor, hello_world::server::greeter::ResponseBody<Greet<'_>>, ()>` in the current scope
--> src/main.rs:67:32
|
67 | tokio::spawn(serve.map_err(|e| error!("h2 error: {:?}", e)));
| ^^^^^^^
|
= note: the method `map_err` exists but the following trait bounds were not satisfied:
`tower_h2::server::Connection<tokio_tcp::stream::TcpStream, hello_world::server::GreeterServer<Greet<'_>>, tokio_executor::global::DefaultExecutor, hello_world::server::greeter::ResponseBody<Greet<'_>>, ()> : futures::future::Future`
`&mut tower_h2::server::Connection<tokio_tcp::stream::TcpStream, hello_world::server::GreeterServer<Greet<'_>>, tokio_executor::global::DefaultExecutor, hello_world::server::greeter::ResponseBody<Greet<'_>>, ()> : futures::future::Future`
`&mut tower_h2::server::Connection<tokio_tcp::stream::TcpStream, hello_world::server::GreeterServer<Greet<'_>>, tokio_executor::global::DefaultExecutor, hello_world::server::greeter::ResponseBody<Greet<'_>>, ()> : futures::stream::Stream`
error: aborting due to 6 previous errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment