Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

to use `async fn`, switch to Rust 2018 or later

I’m trying to compile a lib in rust and I get the following error:

to use `async fn`, switch to Rust 2018 or later

This is my cargo.toml:

[package]
name = "name"
version = "0.1.0"
edition = "2018"

and to compile I use the following command line (documentation here):

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

rustc --crate-type=lib src/apis/my_file.rs

does anyone have an idea?

>Solution :

As the name implies Cargo.toml is interpreted by cargo, not rustc if you want to compile with rustc you have to add the edition flag:

rustc --edition=2018 --crate-type=lib src/apis/my_file.rs
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading