`wrap_comments=true` breaks inside inline links breaking it (part 2; inside lists and block quotes)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
The reproducer is already in a tests/source file, though the payload does not name its path. Read the existing inline link wrapping cases and the comment wrapping logic for lists and block quotes, then run the relevant rustfmt test with wrap_comments=true. Done means these inline links remain unbroken across the listed contexts while the existing formatting tests still pass.
索引モデルが issue の本文から書いたものです。
説明
Summary
More specific case of https://github.com/rust-lang/rustfmt/issues/7177, for inline links inside lists and blockquotes.
I tried to format this code:
//@ rustfmt-wrap_comments: true
pub mod lists_and_block_quotes {
/// - [`queue_user_requested_email_otp`](fn@super::queue_user_requested_email_otp), over the channel.
pub fn a() {}
/// * [`queue_user_requested_email_otp`](struct@super::QueueUserRequestedEmailOtp), over the channel.
pub fn b() {}
/// 1. [`queue_user_requested_email_otp`](super::queue_user_requested_email_otp_abc), over the channel.
pub fn c() {}
/// > [`queue_user_requested_email_otp`](some/path/queue_user_requested_email_otp.html), over it.
pub fn d() {}
}
Expected behavior
I expected to see this happen: no breaking inside inline links
Actual behavior
Instead, this happened: breaking on rustdoc disambiguators and relative paths
Diff in $dev/foo.rs:1:
pub mod lists_and_block_quotes {
- /// - [`queue_user_requested_email_otp`](fn@super::queue_user_requested_email_otp), over the channel.
+ /// - [`queue_user_requested_email_otp`](fn@
+ /// super::queue_user_requested_email_otp), over the channel.
pub fn a() {}
- /// * [`queue_user_requested_email_otp`](struct@super::QueueUserRequestedEmailOtp), over the channel.
+ /// * [`queue_user_requested_email_otp`](struct@
+ /// super::QueueUserRequestedEmailOtp), over the channel.
pub fn b() {}
/// 1. [`queue_user_requested_email_otp`](super::queue_user_requested_email_otp_abc), over the channel.
Diff in /Users/joe.xu/Documents/repos/repro/foo.rs:9:
pub fn c() {}
- /// > [`queue_user_requested_email_otp`](some/path/queue_user_requested_email_otp.html), over it.
+ /// > [`queue_user_requested_email_otp`](some/path/
+ /// > queue_user_requested_email_otp.html), over it.
pub fn d() {}
}
Configuration
rustfmt cli options used (if applicable):
$ rustfmt +nightly foo.rs --check --config-path=/dev/null --config=wrap_comments=true
rustfmt configuration file (e.g. rustfmt.toml, if applicable): N/A
Reproduction Steps
Already a tests/source file.
Meta
rustfmt --version: rustfmt 1.12.0-nightly (2d20b42b88 2026-11-04)
Not fixed by https://github.com/rust-lang/rustfmt/pull/7197 (I was reviewing it and noticed this.)
- 主要言語
- 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 日以内に返信