rustfmt gives legal length comments a ragged edge in argument lists
メンテナーはふだん 1 日以内に返信
@matthewhughes934 がすでに取り組んでいます。
2026年10月9日 から。
評価
調査の方向性
Start by reproducing the reported output with the nested Rust argument-list example and the shown rustfmt configuration (wrap_comments = true, comment_width = 100). Read rustfmt's comment-wrapping implementation and its tests for comments in argument lists; the issue does not name specific files. Done means formatting preserves the reported legal-length comment without producing the ragged reflow shown.
索引モデルが issue の本文から書いたものです。
説明
Here is a Rust file with no line longer than 100 bytes, and one line equal to 100 bytes:
fn main() {
if true {
if true {
if true {
if true {
if true {
if true {
foo(
// Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
// eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut
// enim ad minim veniam, quis nostrud exercitation ullamco laboris
// nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
// reprehenderit in voluptate velit esse cillum dolore eu fugiat
// nulla pariatur.
1,
);
}
}
}
}
}
}
}
The comment shouldn't be changed by rustfmt, but it does change it, giving it a very ragged edge:
> cat config.toml
wrap_comments = true
comment_width = 100
> rustfmt +nightly --version
rustfmt 1.11.0-nightly (1d81eb4ad9 2026-10-07)
> rustfmt +nightly --emit=stdout --config-path config.toml foo.rs
fn main() {
if true {
if true {
if true {
if true {
if true {
if true {
foo(
// Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
// eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut
// enim ad minim veniam, quis nostrud exercitation ullamco laboris
// nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor
// in reprehenderit in voluptate
// velit esse cillum dolore eu fugiat
// nulla pariatur.
1,
);
}
}
}
}
}
}
}
- 主要言語
- Rust
- スター
- 7.1k
- フォーク
- 1.2k
- 平均マージ
- 1日 4時間
- マージ済み PR(30日)
- 20
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
rust-lang/rustfmt のほかの issue
-
A-config C-bug SO-print-config
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
メンテナーはふだん 1 日以内に返信
-
A-Unicode C-bug P-low
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
rust-lang/rustfmt#7210 · コメント 5 件 ·
メンテナーはふだん 1 日以内に返信
-
A-imports C-bug E-hard I-non-idempotency X-impacts-stable-default-format
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
rust-lang/rustfmt#7173 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
A-comments C-bug only-with-option UO-indent_style
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
Fix `first_line_width` to be tab-aware再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープンA-tabs A-whitespace C-bug SO-hard_tabs
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
rust-lang/rustfmt の issue をすべて見る
似ている issue
-
bug P2
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
bug core-lang
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
Windows microphone listing treats words in a device name as DirectShow labels対応中かも @Sujal-chaudhary が今日担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
clipy-recorder/clipy#447 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
nightly-cleanup
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
max-sixty/worktrunk#4939 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信