Repository navigation
Open
Labels
A-doc-commentsArea: doc comments `/** */`, `#[doc = "..."]`, `///` and `//!`.Area: doc comments `/** */`, `#[doc = "..."]`, `///` and `//!`.A-intra-doc-linksArea: Intra-doc links, the ability to link to items in docs by nameArea: Intra-doc links, the ability to link to items in docs by nameA-markdownArea: markdown formatting in doc commentsArea: markdown formatting in doc commentsC-bugCategory: this is a bug; use also I-* labels for specific bug kinds, e.g. I-non-idempotency or I-ICECategory: this is a bug; use also I-* labels for specific bug kinds, e.g. I-non-idempotency or I-ICEUO-wrap_commentsUnstable option: wrap_commentsUnstable option: wrap_comments
Description
Summary
More specific case of #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=truerustfmt 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 #7197 (I was reviewing it and noticed this.)
Reacted by Yacin Tmimi
Metadata
Metadata
Assignees
Labels
A-doc-commentsArea: doc comments `/** */`, `#[doc = "..."]`, `///` and `//!`.Area: doc comments `/** */`, `#[doc = "..."]`, `///` and `//!`.A-intra-doc-linksArea: Intra-doc links, the ability to link to items in docs by nameArea: Intra-doc links, the ability to link to items in docs by nameA-markdownArea: markdown formatting in doc commentsArea: markdown formatting in doc commentsC-bugCategory: this is a bug; use also I-* labels for specific bug kinds, e.g. I-non-idempotency or I-ICECategory: this is a bug; use also I-* labels for specific bug kinds, e.g. I-non-idempotency or I-ICEUO-wrap_commentsUnstable option: wrap_commentsUnstable option: wrap_comments
Activity