You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I check this file with rustc async.rs --crate-type lib, rust errors
--> async.rs:16:13
|
14 | async {
| ----- `async` blocks are only allowed in Rust 2018 or later
15 | //if false {
16 | return ();
| ^^^^^^ expected identifier, found keyword
|
= help: set `edition = "2021"` in `Cargo.toml`
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
Which is a bit confusing.
Does it want me to set edition = 2021 in Cargo.toml (as in "please set edition = 2021...")?
Why does it complain about a Cargo.toml when there isn't one (as I just checked the file directly with rustc x.rs).
For some other examples, the message is even more confusing
= note: to `.await` a `Future`, switch to Rust 2018 or later
= help: set `edition = "2021"` in `Cargo.toml`
because it is not clear if rustc want to say "2021 is set" or "2021 should be set"
The text was updated successfully, but these errors were encountered:
I tried this code:
When I check this file with
rustc async.rs --crate-type lib
, rust errorsWhich is a bit confusing.
Does it want me to set
edition = 2021
in Cargo.toml (as in "please set edition = 2021...")?Why does it complain about a Cargo.toml when there isn't one (as I just checked the file directly with rustc x.rs).
For some other examples, the message is even more confusing
because it is not clear if rustc want to say "2021 is set" or "2021 should be set"
The text was updated successfully, but these errors were encountered: