rust-lang / rust-lang/rust-mode
Bad indentation after "where" clause and "#[test]" attribute
Open
Nobody has claimed this yet.
indentation
- Dominant language
- Emacs Lisp
- Stars
- 1.3k
- Forks
- 198
- PR merge metrics
- No merged PRs in 30d
Description
A newline after the #[test] is indented:
impl <A, D> MyTrait<A, D> for YourType
where A: TraitB + TraitC,
D: TraitE + TraitF {}
#[test]
^
I expect format this as
impl <A, D> MyTrait<A, D> for YourType
where A: TraitB + TraitC,
D: TraitE + TraitF {}
#[test]
^
This is another result:
fn call_twice<F>(closure: F) where F: FnMut() {
closure();
closure();
}
#[test]
^
Expected indentation:
fn call_twice<F>(closure: F) where F: FnMut() {
closure();
closure();
}
#[test]
^
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No file or test is named in the issue. Reproduce the indentation results using the two Rust examples, then trace rust-mode's indentation behavior for where clauses and #[test] attributes; done means both examples indent the line after the attribute at the expected level.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- emacs-lisp, rust
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100