Skip to content

Errors with the postgres todo exampleΒ #1819

@HarrisonHemstreet

Description

@HarrisonHemstreet

Here's the output after I run cargo run:

sqlx-practice on ξ‚  master [?] is πŸ“¦ v0.1.0 via πŸ¦€ v1.57.0 on ☁️   
❯ cargo run
   Compiling sqlx-practice v0.1.0 (/home/harry/rust-practice/sqlx-practice)
error[E0433]: failed to resolve: could not find `main` in `async_std`
  --> src/main.rs:17:14
   |
17 | #[async_std::main]
   |              ^^^^ could not find `main` in `async_std`

error[E0752]: `main` function is not allowed to be `async`
  --> src/main.rs:19:1
   |
18 | #[paw::main]
   | ------------ `main` function is not allowed to be `async`
19 | async fn main(args: Args) -> anyhow::Result<()> {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Some errors have detailed explanations: E0433, E0752.
For more information about an error, try `rustc --explain E0433`.
error: could not compile `sqlx-practice` due to 2 previous errors

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions