Commit 27d5871
authored
Exclude where kw from comment following fn return type (#4175)
rustfmt tries to preserve the comment between a fn return type and the
start of the fn body if there are no where clauses following the return
type. However, even if there are no where clauses present, the "where"
keyword may be. To elide the "where" keyword in this context, just get
the comment snippet starting after the where clause span, which always
includes the "where" keyword if present.
Closes #40011 parent e0d2f0a commit 27d5871
File tree
3 files changed
+10
-2
lines changed- rustfmt-core/rustfmt-lib
- src
- tests
- source
- target
3 files changed
+10
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2403 | 2403 | | |
2404 | 2404 | | |
2405 | 2405 | | |
2406 | | - | |
2407 | | - | |
2408 | 2406 | | |
| 2407 | + | |
| 2408 | + | |
| 2409 | + | |
| 2410 | + | |
2409 | 2411 | | |
2410 | 2412 | | |
2411 | 2413 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
0 commit comments