`wrap_comments=true` breaks inside inline links breaking it (part 2; inside lists and block quotes)

オープン
#7,232 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
68/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
rust
領域
tooling

調査の方向性

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 の本文から書いたものです。

説明

A-doc-comments A-intra-doc-links A-markdown C-bug UO-wrap_comments

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

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

rust-lang/rustfmt のほかの issue

rust-lang/rustfmt の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。