Skip to content

Instantly share code, notes, and snippets.

@compiler-errors
Created November 20, 2021 23:31
Show Gist options
  • Save compiler-errors/d6f12fb30079feb1ad1d5f1ab39a3a8d to your computer and use it in GitHub Desktop.
Save compiler-errors/d6f12fb30079feb1ad1d5f1ab39a3a8d to your computer and use it in GitHub Desktop.
error[E0601]: `main` function not found in crate `test2`
--> /home/michael/test2.rs:1:1
|
1 | / fn foo() -> impl std::future::Future<Output = ()> {
2 | | async { 1usize }
3 | | }
| |_^ consider adding a `main` function to `/home/michael/test2.rs`
error[E0271]: type mismatch resolving `<impl Future<Output = <[static generator@/home/michael/test2.rs:2:11: 2:21] as Generator<ResumeTy>>::Return> as Future>::Output == ()`
--> /home/michael/test2.rs:1:13
|
1 | fn foo() -> impl std::future::Future<Output = ()> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found `usize`
error: aborting due to 2 previous errors
Some errors have detailed explanations: E0271, E0601.
For more information about an error, try `rustc --explain E0271`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment