doomemacs / doomemacs/core

Rust formatting broken due to apheleia change

Open
#7,588 2 comments 4 reactions 0 assignees View on GitHub
is:bug needs-triage
Dominant language
Emacs Lisp
Stars
22.7k
Forks
3.1k
Avg merge
10h 46m
Merged PRs (30d)
4

Description

### I confirm that...

- [X] I have searched the [issue tracker](https://github.com/doomemacs/doomemacs/issues), [documentation](https://docs.doomemacs.org), [FAQ](https://docs.doomemacs.org/-/faq), [Discourse](https://discourse.doomemacs.org), and [Google](https://google.com), in case this issue has already been reported/resolved.

- [X] I have read "[How to Debug Issues](https://doomemacs.org/d/how2debug)", and will use it to provide as much information about this issue as possible.

- [X] The issue can be reproduced on the **latest** available commit of Doom.

- [X] The issue can be reproduced on a stable release of Emacs, such as 27, 28, or 29. *(Unstable versions end in .50, .60, or .9x)*

### Expected behavior

When trying to save a rust file in a normal Rust project (with edition 2018 or 2021), I'm expecting format-on-save to work correctly using either cargo fmt or rustfmt

### Current behavior

When I try to save a file, I get an error in the apheleia log buffer
```
$ rustfmt --quiet --emit stdout

error[E0670]: `async fn` is not permitted in Rust 2015
--> :54:1
|
54 | async fn main() -> anyhow::Result<()> {
| ^^^^^ to use `async fn`, switch to Rust 2018 or later
|
= help: pass `--edition 2021` to `rustc`
= note: for more on editions, read https://doc.rust-lang.org/edition-guide

Command succeeded with exit code 1.

```

### Steps to reproduce

1. Open emacs
2. Open a rust project
3. modify anything
4. save
5. observe the code not being formatted
6. go to apheleia logs

### System Information

https://pastebin.com/RDMQnN94

Contributor guide

Open the contributing guide

Research direction

Start with the Apheleia log output and the Rust formatting setup used when saving a Rust file; compare the cargo fmt and rustfmt paths for projects using Rust editions 2018 or 2021. Done means format-on-save succeeds without invoking Rust 2015 behavior, and the result can be reproduced using the listed save steps.

Written by the indexing model from the issue text.

Assessment

Tech stack
emacs, rust
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.