Skip to content

build error #4

@dkhokhlov

Description

@dkhokhlov

@m1guelpf

I am using latest code:

commit 654a227224c90030d216dfe5fbc20c67cb10f451 (HEAD -> main, origin/main, origin/HEAD)
Author: Miguel Piedrafita <github@miguel.build>
Date:   Fri Dec 15 20:22:01 2023 +0100

with toolchain:

$ rustup --version
rustup 1.26.0 (5af9b9484 2023-04-05)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.74.1 (a28077b28 2023-12-04)`

$ rustup show | grep default
stable-x86_64-unknown-linux-gnu (default)
stable-x86_64-unknown-linux-gnu (default)

getting build errors:

   Compiling cog-core v0.2.0 (/home/dmitri/SOURCE/cog-rust/core)
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in trait method return types
  --> core/src/spec.rs:20:16
   |
20 |     fn setup() -> impl Future<Output = Result<Self>> + Send;
   |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information

error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in trait method return types
  --> core/src/spec.rs:33:46
   |
33 |     fn into_response(self, request: Request) -> impl Future<Output = Result<Value>> + Send;
   |                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information

error[E0706]: functions in traits cannot be declared `async`
  --> core/src/spec.rs:37:2
   |
37 |     async fn into_response(self, _: Request) -> Result<Value> {
   |     -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |     |
   |     `async` because of this
   |
   = note: `async` trait functions are not currently supported
   = note: consider using the `async-trait` crate: https://crates.io/crates/async-trait
   = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information

Some errors have detailed explanations: E0562, E0706.
For more information about an error, try `rustc --explain E0562`.
error: could not compile `cog-core` (lib) due to 3 previous errors
warning: build failed, waiting for other jobs to finish...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions