rust-lang / rust-lang/rust-mode

rustfmt should display errors

Open
#204 4 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

rustfmt
Dominant language
Emacs Lisp
Stars
1.3k
Forks
198
PR merge metrics
No merged PRs in 30d

Description

If you run rustfmt and it errors out, it currently just "beeps" and suggests you switch over to *rustfmt*. I think this should be treated like a failed compilation; we should split the frame into two windows, show the errors, and let you use M-x next-error to view them.

Example 1, which errors because it doesn't parse:

fn main() {
    let x &'static str = "aaa";
}

Example 2, undefined module:

mod a;

fn main() {
    let x: &'static str = "aaa";
}

Example 3, long lines:

fn main() {
    let x:
    &'static str = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
}

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how rustfmt errors are currently reported and how the rustfmt buffer is opened. Compare the requested behavior with Emacs's M-x next-error workflow, using the three Rust examples to check parse errors, undefined modules, and long-line errors. Done means errors are shown in a split frame and can be navigated with M-x next-error.

Written by the indexing model from the issue text.

Assessment

Tech stack
emacs-lisp, rust
Domain
developer-experience, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.