Skip to content

rustfmt doesn't see Cargo.toml file correctly ? #128

@alarsyo

Description

@alarsyo

in a newly created project, I have this in main.rs:

#[async_std::main]
async fn main() {
    println!("Hello, world!");
}

When saving the buffer, I get the following error:

error[E0670]: `async fn` is not permitted in the 2015 edition
 --> /home/alarsyo/work/more-jpeg/src/main.rs:2:1
  |
2 | async fn main() {
  | ^^^^^
  |
  = note: to use `async fn`, switch to Rust 2018
  = help: set `edition = "2018"` in `Cargo.toml`
  = note: for more on editions, read https://doc.rust-lang.org/edition-guide

This is a project I just created with cargo new, so it already has the 2018 edition setting. Running rustic-cargo-fmt doesn't have that problem, as it find the Cargo file correctly.

I'm on Doom emacs, if that helps.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions