Skip to content

Instantly share code, notes, and snippets.

@banool
Created March 18, 2023 23:24
Show Gist options
  • Save banool/52c92650a00b6ac2d7322e1220ac9588 to your computer and use it in GitHub Desktop.
Save banool/52c92650a00b6ac2d7322e1220ac9588 to your computer and use it in GitHub Desktop.
warning: unused import: `aptos_framework::natives::cryptography::algebra::AlgebraContext`
--> aptos-move/aptos-vm/src/natives.rs:5:5
|
5 | use aptos_framework::natives::cryptography::algebra::AlgebraContext;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
warning: `aptos-vm` (lib) generated 1 warning
Compiling aptos-api-v2 v2.0.1 (/Users/dport/a/core/crates/aptos-api/v2)
error[E0277]: the trait bound `Result<impl IntoEndpoint, anyhow::Error>: poem::Endpoint` is not satisfied
--> crates/aptos-api/v2/src/routes.rs:28:31
|
28 | let routes = Route::new().nest("/", api_service).with(cors);
| ^^^^ the trait `poem::Endpoint` is not implemented for `Result<impl IntoEndpoint, anyhow::Error>`
|
= help: the following other types implement trait `poem::Endpoint`:
&'impl0 T
AddDataEndpoint<E, T>
After<E, F>
AndThen<E, F>
Arc<T>
Around<E, F>
Before<E, F>
Box<T>
and 26 others
= note: required for `Result<impl IntoEndpoint, anyhow::Error>` to implement `IntoEndpoint`
error[E0277]: `(dyn axum::boxed::ErasedIntoRoute<(), tonic::transport::Body, Infallible> + 'static)` cannot be shared between threads safely
--> crates/aptos-api/v2/src/service.rs:29:25
|
29 | let tower_service = tower_service.compat();
| ^^^^^^^^^^^^^ ------ required by a bound introduced by this call
| |
| `(dyn axum::boxed::ErasedIntoRoute<(), tonic::transport::Body, Infallible> + 'static)` cannot be shared between threads safely
|
= help: the trait `Sync` is not implemented for `(dyn axum::boxed::ErasedIntoRoute<(), tonic::transport::Body, Infallible> + 'static)`
= note: required for `Unique<(dyn axum::boxed::ErasedIntoRoute<(), tonic::transport::Body, Infallible> + 'static)>` to implement `Sync`
= note: required because it appears within the type `Box<(dyn axum::boxed::ErasedIntoRoute<(), tonic::transport::Body, Infallible> + 'static)>`
= note: required because it appears within the type `axum::boxed::BoxedIntoRoute<(), tonic::transport::Body, Infallible>`
= note: required because it appears within the type `axum::routing::Fallback<(), tonic::transport::Body>`
= note: required because it appears within the type `axum::routing::Router`
= note: required because it appears within the type `Routes`
note: required by a bound in `poem::endpoint::TowerCompatExt::compat`
--> /Users/dport/.cargo/registry/src/github.com-1ecc6299db9ec823/poem-1.3.44/src/endpoint/tower_compat.rs:26:15
|
26 | + Sync
| ^^^^ required by this bound in `poem::endpoint::TowerCompatExt::compat`
error[E0277]: `(dyn tower::util::boxed_clone::CloneService<poem::http::Request<tonic::transport::Body>, Response = poem::http::Response<http_body::combinators::box_body::UnsyncBoxBody<tonic::codegen::Bytes, axum_core::error::Error>>, Future = Pin<Box<(dyn Future<Output = Result<poem::http::Response<http_body::combinators::box_body::UnsyncBoxBody<tonic::codegen::Bytes, axum_core::error::Error>>, Infallible>> + Send + 'static)>>, Error = Infallible> + Send + 'static)` cannot be shared between threads safely
--> crates/aptos-api/v2/src/service.rs:29:25
|
29 | let tower_service = tower_service.compat();
| ^^^^^^^^^^^^^ ------ required by a bound introduced by this call
| |
| `(dyn tower::util::boxed_clone::CloneService<poem::http::Request<tonic::transport::Body>, Response = poem::http::Response<http_body::combinators::box_body::UnsyncBoxBody<tonic::codegen::Bytes, axum_core::error::Error>>, Future = Pin<Box<(dyn Future<Output = Result<poem::http::Response<http_body::combinators::box_body::UnsyncBoxBody<tonic::codegen::Bytes, axum_core::error::Error>>, Infallible>> + Send + 'static)>>, Error = Infallible> + Send + 'static)` cannot be shared between threads safely
|
= help: the trait `Sync` is not implemented for `(dyn tower::util::boxed_clone::CloneService<poem::http::Request<tonic::transport::Body>, Response = poem::http::Response<http_body::combinators::box_body::UnsyncBoxBody<tonic::codegen::Bytes, axum_core::error::Error>>, Future = Pin<Box<(dyn Future<Output = Result<poem::http::Response<http_body::combinators::box_body::UnsyncBoxBody<tonic::codegen::Bytes, axum_core::error::Error>>, Infallible>> + Send + 'static)>>, Error = Infallible> + Send + 'static)`
= note: required for `Unique<(dyn tower::util::boxed_clone::CloneService<poem::http::Request<tonic::transport::Body>, Response = poem::http::Response<http_body::combinators::box_body::UnsyncBoxBody<tonic::codegen::Bytes, axum_core::error::Error>>, Future = Pin<Box<(dyn Future<Output = Result<poem::http::Response<http_body::combinators::box_body::UnsyncBoxBody<tonic::codegen::Bytes, axum_core::error::Error>>, Infallible>> + Send + 'static)>>, Error = Infallible> + Send + 'static)>` to implement `Sync`
= note: required because it appears within the type `Box<(dyn tower::util::boxed_clone::CloneService<poem::http::Request<tonic::transport::Body>, Response = poem::http::Response<http_body::combinators::box_body::UnsyncBoxBody<tonic::codegen::Bytes, axum_core::error::Error>>, Future = Pin<Box<(dyn Future<Output = Result<poem::http::Response<http_body::combinators::box_body::UnsyncBoxBody<tonic::codegen::Bytes, axum_core::error::Error>>, Infallible>> + Send + 'static)>>, Error = Infallible> + Send + 'static)>`
= note: required because it appears within the type `tower::util::boxed_clone::BoxCloneService<poem::http::Request<tonic::transport::Body>, poem::http::Response<http_body::combinators::box_body::UnsyncBoxBody<tonic::codegen::Bytes, axum_core::error::Error>>, Infallible>`
= note: required because it appears within the type `axum::routing::route::Route`
= note: required because it appears within the type `axum::routing::Fallback<(), tonic::transport::Body>`
= note: required because it appears within the type `axum::routing::Router`
= note: required because it appears within the type `Routes`
note: required by a bound in `poem::endpoint::TowerCompatExt::compat`
--> /Users/dport/.cargo/registry/src/github.com-1ecc6299db9ec823/poem-1.3.44/src/endpoint/tower_compat.rs:26:15
|
26 | + Sync
| ^^^^ required by this bound in `poem::endpoint::TowerCompatExt::compat`
error[E0277]: `(dyn axum::boxed::ErasedIntoRoute<(), tonic::transport::Body, Infallible> + 'static)` cannot be shared between threads safely
--> crates/aptos-api/v2/src/service.rs:31:31
|
31 | let routes = Route::new().nest("/", tower_service);
| ^^^^ `(dyn axum::boxed::ErasedIntoRoute<(), tonic::transport::Body, Infallible> + 'static)` cannot be shared between threads safely
|
= help: the trait `Sync` is not implemented for `(dyn axum::boxed::ErasedIntoRoute<(), tonic::transport::Body, Infallible> + 'static)`
= help: the trait `IntoEndpoint` is implemented for `poem_openapi::openapi::OpenApiService<T, W>`
= note: required for `Unique<(dyn axum::boxed::ErasedIntoRoute<(), tonic::transport::Body, Infallible> + 'static)>` to implement `Sync`
= note: required because it appears within the type `Box<(dyn axum::boxed::ErasedIntoRoute<(), tonic::transport::Body, Infallible> + 'static)>`
= note: required because it appears within the type `axum::boxed::BoxedIntoRoute<(), tonic::transport::Body, Infallible>`
= note: required because it appears within the type `axum::routing::Fallback<(), tonic::transport::Body>`
= note: required because it appears within the type `axum::routing::Router`
= note: required because it appears within the type `Routes`
= note: required for `endpoint::tower_compat::TowerCompatEndpoint<Routes>` to implement `poem::Endpoint`
= note: required for `endpoint::tower_compat::TowerCompatEndpoint<Routes>` to implement `IntoEndpoint`
error[E0277]: `(dyn tower::util::boxed_clone::CloneService<poem::http::Request<tonic::transport::Body>, Response = poem::http::Response<http_body::combinators::box_body::UnsyncBoxBody<tonic::codegen::Bytes, axum_core::error::Error>>, Future = Pin<Box<(dyn Future<Output = Result<poem::http::Response<http_body::combinators::box_body::UnsyncBoxBody<tonic::codegen::Bytes, axum_core::error::Error>>, Infallible>> + Send + 'static)>>, Error = Infallible> + Send + 'static)` cannot be shared between threads safely
--> crates/aptos-api/v2/src/service.rs:31:31
|
31 | let routes = Route::new().nest("/", tower_service);
| ^^^^ `(dyn tower::util::boxed_clone::CloneService<poem::http::Request<tonic::transport::Body>, Response = poem::http::Response<http_body::combinators::box_body::UnsyncBoxBody<tonic::codegen::Bytes, axum_core::error::Error>>, Future = Pin<Box<(dyn Future<Output = Result<poem::http::Response<http_body::combinators::box_body::UnsyncBoxBody<tonic::codegen::Bytes, axum_core::error::Error>>, Infallible>> + Send + 'static)>>, Error = Infallible> + Send + 'static)` cannot be shared between threads safely
|
= help: the trait `Sync` is not implemented for `(dyn tower::util::boxed_clone::CloneService<poem::http::Request<tonic::transport::Body>, Response = poem::http::Response<http_body::combinators::box_body::UnsyncBoxBody<tonic::codegen::Bytes, axum_core::error::Error>>, Future = Pin<Box<(dyn Future<Output = Result<poem::http::Response<http_body::combinators::box_body::UnsyncBoxBody<tonic::codegen::Bytes, axum_core::error::Error>>, Infallible>> + Send + 'static)>>, Error = Infallible> + Send + 'static)`
= help: the trait `IntoEndpoint` is implemented for `poem_openapi::openapi::OpenApiService<T, W>`
= note: required for `Unique<(dyn tower::util::boxed_clone::CloneService<poem::http::Request<tonic::transport::Body>, Response = poem::http::Response<http_body::combinators::box_body::UnsyncBoxBody<tonic::codegen::Bytes, axum_core::error::Error>>, Future = Pin<Box<(dyn Future<Output = Result<poem::http::Response<http_body::combinators::box_body::UnsyncBoxBody<tonic::codegen::Bytes, axum_core::error::Error>>, Infallible>> + Send + 'static)>>, Error = Infallible> + Send + 'static)>` to implement `Sync`
= note: required because it appears within the type `Box<(dyn tower::util::boxed_clone::CloneService<poem::http::Request<tonic::transport::Body>, Response = poem::http::Response<http_body::combinators::box_body::UnsyncBoxBody<tonic::codegen::Bytes, axum_core::error::Error>>, Future = Pin<Box<(dyn Future<Output = Result<poem::http::Response<http_body::combinators::box_body::UnsyncBoxBody<tonic::codegen::Bytes, axum_core::error::Error>>, Infallible>> + Send + 'static)>>, Error = Infallible> + Send + 'static)>`
= note: required because it appears within the type `tower::util::boxed_clone::BoxCloneService<poem::http::Request<tonic::transport::Body>, poem::http::Response<http_body::combinators::box_body::UnsyncBoxBody<tonic::codegen::Bytes, axum_core::error::Error>>, Infallible>`
= note: required because it appears within the type `axum::routing::route::Route`
= note: required because it appears within the type `axum::routing::Fallback<(), tonic::transport::Body>`
= note: required because it appears within the type `axum::routing::Router`
= note: required because it appears within the type `Routes`
= note: required for `endpoint::tower_compat::TowerCompatEndpoint<Routes>` to implement `poem::Endpoint`
= note: required for `endpoint::tower_compat::TowerCompatEndpoint<Routes>` to implement `IntoEndpoint`
warning: unused import: `Context`
--> crates/aptos-api/v2/src/service.rs:4:14
|
4 | use anyhow::{Context as AnyhowContext, Result};
| ^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
For more information about this error, try `rustc --explain E0277`.
warning: `aptos-api-v2` (lib) generated 1 warning
error: could not compile `aptos-api-v2` due to 5 previous errors; 1 warning emitted
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment