`wrap_comments=true` breaks inside inline links breaking it (part 2; inside lists and block quotes)
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 68/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.)
- Lingua principale
- Rust
- Stelle
- 7.1k
- Fork
- 1.2k
- Merge medio
- 1g 4h
- PR unite (30g)
- 20
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di rust-lang/rustfmt
-
A-config C-bug SO-print-config
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
I maintainer di solito rispondono entro 1 giorno
-
A-Unicode C-bug P-low
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
rust-lang/rustfmt#7210 · 5 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
A-imports C-bug E-hard I-non-idempotency X-impacts-stable-default-format
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
rust-lang/rustfmt#7173 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
A-comments C-bug only-with-option UO-indent_style
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Fix `first_line_width` to be tab-awareForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. ApertaA-tabs A-whitespace C-bug SO-hard_tabs
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di rust-lang/rustfmt
Issue simili
-
bug P2
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
bug core-lang
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Windows microphone listing treats words in a device name as DirectShow labelsForse già presa @Sujal-chaudhary l’ha presa oggi. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
clipy-recorder/clipy#447 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
nightly-cleanup
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
max-sixty/worktrunk#4939 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno