Formatting an `impl` with a trailing comment is impossible
Open
bug
dslx
dslx:fmt
- Dominant language
- C++
- Stars
- 1.9k
- Forks
- 283
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 135
Description
**Describe the bug**
If there is a comment between the end of the last function and the end of an impl, the impl cannot be formatted.
**To Reproduce**
Steps to reproduce the behavior:
1. Format
```
struct MyStruct{}
impl MyStruct {
fn my_function() -> u32 { u32:3 }
// Format
}
```
2. See error
```
Formatting failed: Error: INTERNAL: Formatting was skipped because a comment at (filename) would be deleted by the formatter: // Format
This is probably due to a bug (which may not have been reported yet). To complete formatting, try moving the comment to a different line.
```
**Expected behavior**
It formats it
Contributor guide
Assessment
This issue has not been assessed yet.