Skip to content

Instantly share code, notes, and snippets.

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 DavidEichmann/51f561263a65fef886cc77dad2d48226 to your computer and use it in GitHub Desktop.
Save DavidEichmann/51f561263a65fef886cc77dad2d48226 to your computer and use it in GitHub Desktop.
PostgresML (44c9d7e5c2db6d60ca17b343ce7f3e5620f14bdd) dashboard build error
~/postgresml/pgml-dashboard$ rustc --version
rustc 1.72.0 (5680fa18f 2023-08-23)
~/postgresml/pgml-dashboard$ cargo run
Compiling pgml-dashboard v2.7.6 (/home/postgres/postgresml/pgml-dashboard)
error[E0308]: mismatched types
--> src/models.rs:490:12
|
490 | Ok(sqlx::query_as!(
| ____________^
491 | | Model,
492 | | "SELECT
493 | | id,
... |
510 | | project_id,
511 | | )
| |_________^ expected `i64`, found `Option<i64>`
|
= note: expected type `i64`
found enum `std::option::Option<i64>`
= note: this error originates in the macro `$crate::sqlx_macros::expand_query` which comes from the expansion of the macro `sqlx::query_as` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0308]: mismatched types
--> src/models.rs:463:12
|
463 | Ok(sqlx::query_as!(
| ____________^
464 | | Model,
465 | | "SELECT
466 | | id,
... |
483 | | id,
484 | | )
| |_________^ expected `i64`, found `Option<i64>`
|
= note: expected type `i64`
found enum `std::option::Option<i64>`
= note: this error originates in the macro `$crate::sqlx_macros::expand_query` which comes from the expansion of the macro `sqlx::query_as` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0308]: mismatched types
--> src/models.rs:517:12
|
517 | Ok(sqlx::query_as!(
| ____________^
518 | | Model,
519 | | "SELECT
520 | | id,
... |
537 | | snapshot_id,
538 | | )
| |_________^ expected `i64`, found `Option<i64>`
|
= note: expected type `i64`
found enum `std::option::Option<i64>`
= note: this error originates in the macro `$crate::sqlx_macros::expand_query` which comes from the expansion of the macro `sqlx::query_as` (in Nightly builds, run with -Z macro-backtrace for more info)
error: future cannot be sent between threads safely
--> src/lib.rs:61:1
|
61 | #[get("/projects/<id>")]
| ^^^^^^^^^^^^^^^^^^^^^^^^ future created by async block is not `Send`
|
note: opaque type is declared here
--> src/models.rs:489:71
|
489 | pub async fn get_by_project_id(pool: &PgPool, project_id: i64) -> anyhow::Result<Vec<Model>> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
note: this item depends on auto traits of the hidden type, but may also be registering the hidden type. This is not supported right now. You can try moving the opaque type and the item that actually registers a hidden type into a new submodule
--> src/lib.rs:61:1
|
61 | #[get("/projects/<id>")]
| ^^^^^^^^^^^^^^^^^^^^^^^^
note: future is not `Send` as it awaits another future which is not `Send`
--> src/lib.rs:64:18
|
64 | let models = models::Model::get_by_project_id(cluster.pool(), id).await?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ await occurs here on type `impl std::future::Future<Output = Result<std::vec::Vec<models::Model>, anyhow::Error>>`, which is not `Send`
= note: required for the cast from `Pin<std::boxed::Box<[async block@src/lib.rs:61:1: 61:25]>>` to `Pin<Box<dyn Future<Output = Outcome<Response<'__r>, Status, (Data<'__r>, Status)>> + Send>>`
= note: the full name for the target type has been written to '/home/postgres/postgresml/pgml-dashboard/target/debug/deps/pgml_dashboard-edf52437d95c520c.long-type-12377126653494860259.txt'
= note: this error originates in the attribute macro `get` (in Nightly builds, run with -Z macro-backtrace for more info)
error: future cannot be sent between threads safely
--> src/lib.rs:333:1
|
333 | #[get("/models")]
| ^^^^^^^^^^^^^^^^^ future created by async block is not `Send`
|
note: opaque type is declared here
--> src/models.rs:489:71
|
489 | pub async fn get_by_project_id(pool: &PgPool, project_id: i64) -> anyhow::Result<Vec<Model>> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
note: this item depends on auto traits of the hidden type, but may also be registering the hidden type. This is not supported right now. You can try moving the opaque type and the item that actually registers a hidden type into a new submodule
--> src/lib.rs:333:1
|
333 | #[get("/models")]
| ^^^^^^^^^^^^^^^^^
note: future is not `Send` as it awaits another future which is not `Send`
--> src/lib.rs:341:30
|
341 | let project_models = models::Model::get_by_project_id(cluster.pool(), project.id).await?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ await occurs here on type `impl std::future::Future<Output = Result<std::vec::Vec<models::Model>, anyhow::Error>>`, which is not `Send`
= note: required for the cast from `Pin<std::boxed::Box<[async block@src/lib.rs:333:1: 333:18]>>` to `Pin<Box<dyn Future<Output = Outcome<Response<'__r>, Status, (Data<'__r>, Status)>> + Send>>`
= note: the full name for the target type has been written to '/home/postgres/postgresml/pgml-dashboard/target/debug/deps/pgml_dashboard-edf52437d95c520c.long-type-2439125598169025127.txt'
= note: this error originates in the attribute macro `get` (in Nightly builds, run with -Z macro-backtrace for more info)
error: future cannot be sent between threads safely
--> src/lib.rs:366:1
|
366 | #[get("/models/<id>")]
| ^^^^^^^^^^^^^^^^^^^^^^ future created by async block is not `Send`
|
note: opaque type is declared here
--> src/models.rs:462:55
|
462 | pub async fn get_by_id(pool: &PgPool, id: i64) -> anyhow::Result<Model> {
| ^^^^^^^^^^^^^^^^^^^^^
note: this item depends on auto traits of the hidden type, but may also be registering the hidden type. This is not supported right now. You can try moving the opaque type and the item that actually registers a hidden type into a new submodule
--> src/lib.rs:366:1
|
366 | #[get("/models/<id>")]
| ^^^^^^^^^^^^^^^^^^^^^^
note: future is not `Send` as it awaits another future which is not `Send`
--> src/lib.rs:368:17
|
368 | let model = models::Model::get_by_id(cluster.pool(), id).await?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ await occurs here on type `impl std::future::Future<Output = Result<models::Model, anyhow::Error>>`, which is not `Send`
= note: required for the cast from `Pin<std::boxed::Box<[async block@src/lib.rs:366:1: 366:23]>>` to `Pin<Box<dyn Future<Output = Outcome<Response<'__r>, Status, (Data<'__r>, Status)>> + Send>>`
= note: the full name for the target type has been written to '/home/postgres/postgresml/pgml-dashboard/target/debug/deps/pgml_dashboard-edf52437d95c520c.long-type-18183773948761413418.txt'
= note: this error originates in the attribute macro `get` (in Nightly builds, run with -Z macro-backtrace for more info)
error: future cannot be sent between threads safely
--> src/lib.rs:393:1
|
393 | #[get("/snapshots/<id>")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ future created by async block is not `Send`
|
note: opaque type is declared here
--> src/models.rs:516:73
|
516 | pub async fn get_by_snapshot_id(pool: &PgPool, snapshot_id: i64) -> anyhow::Result<Vec<Model>> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
note: this item depends on auto traits of the hidden type, but may also be registering the hidden type. This is not supported right now. You can try moving the opaque type and the item that actually registers a hidden type into a new submodule
--> src/lib.rs:393:1
|
393 | #[get("/snapshots/<id>")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^
note: future is not `Send` as it awaits another future which is not `Send`
--> src/models.rs:783:9
|
783 | Model::get_by_snapshot_id(pool, self.id).await
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ await occurs here on type `impl std::future::Future<Output = Result<std::vec::Vec<models::Model>, anyhow::Error>>`, which is not `Send`
= note: required for the cast from `Pin<std::boxed::Box<[async block@src/lib.rs:393:1: 393:26]>>` to `Pin<Box<dyn Future<Output = Outcome<Response<'__r>, Status, (Data<'__r>, Status)>> + Send>>`
= note: the full name for the target type has been written to '/home/postgres/postgresml/pgml-dashboard/target/debug/deps/pgml_dashboard-edf52437d95c520c.long-type-17502180092503814531.txt'
= note: this error originates in the attribute macro `get` (in Nightly builds, run with -Z macro-backtrace for more info)
error: future cannot be sent between threads safely
--> src/lib.rs:439:1
|
439 | #[get("/deployments/<id>")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ future created by async block is not `Send`
|
note: opaque type is declared here
--> src/models.rs:462:55
|
462 | pub async fn get_by_id(pool: &PgPool, id: i64) -> anyhow::Result<Model> {
| ^^^^^^^^^^^^^^^^^^^^^
note: this item depends on auto traits of the hidden type, but may also be registering the hidden type. This is not supported right now. You can try moving the opaque type and the item that actually registers a hidden type into a new submodule
--> src/lib.rs:439:1
|
439 | #[get("/deployments/<id>")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: future is not `Send` as it awaits another future which is not `Send`
--> src/lib.rs:443:17
|
443 | let model = models::Model::get_by_id(cluster.pool(), deployment.model_id).await?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ await occurs here on type `impl std::future::Future<Output = Result<models::Model, anyhow::Error>>`, which is not `Send`
= note: required for the cast from `Pin<std::boxed::Box<[async block@src/lib.rs:439:1: 439:28]>>` to `Pin<Box<dyn Future<Output = Outcome<Response<'__r>, Status, (Data<'__r>, Status)>> + Send>>`
= note: the full name for the target type has been written to '/home/postgres/postgresml/pgml-dashboard/target/debug/deps/pgml_dashboard-edf52437d95c520c.long-type-16468339077187923860.txt'
= note: this error originates in the attribute macro `get` (in Nightly builds, run with -Z macro-backtrace for more info)
error: future cannot be sent between threads safely
--> src/lib.rs:505:1
|
505 | #[get("/?<tab>&<id>")]
| ^^^^^^^^^^^^^^^^^^^^^^ future created by async block is not `Send`
|
note: opaque type is declared here
--> src/models.rs:462:55
|
462 | pub async fn get_by_id(pool: &PgPool, id: i64) -> anyhow::Result<Model> {
| ^^^^^^^^^^^^^^^^^^^^^
note: this item depends on auto traits of the hidden type, but may also be registering the hidden type. This is not supported right now. You can try moving the opaque type and the item that actually registers a hidden type into a new submodule
--> src/lib.rs:505:1
|
505 | #[get("/?<tab>&<id>")]
| ^^^^^^^^^^^^^^^^^^^^^^
note: future is not `Send` as it awaits another future which is not `Send`
--> src/lib.rs:556:25
|
556 | let model = models::Model::get_by_id(cluster.pool(), id.unwrap()).await?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ await occurs here on type `impl std::future::Future<Output = Result<models::Model, anyhow::Error>>`, which is not `Send`
= note: required for the cast from `Pin<std::boxed::Box<[async block@src/lib.rs:505:1: 505:23]>>` to `Pin<Box<dyn Future<Output = Outcome<Response<'__r>, Status, (Data<'__r>, Status)>> + Send>>`
= note: the full name for the target type has been written to '/home/postgres/postgresml/pgml-dashboard/target/debug/deps/pgml_dashboard-edf52437d95c520c.long-type-584627789115965712.txt'
= note: this error originates in the attribute macro `get` (in Nightly builds, run with -Z macro-backtrace for more info)
For more information about this error, try `rustc --explain E0308`.
error: could not compile `pgml-dashboard` (lib) due to 9 previous errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment