`wrap_comments=true` breaks inside inline links breaking it (part 2; inside lists and block quotes)
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 68/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.)
- Ngôn ngữ chính
- Rust
- Star
- 7.1k
- Fork
- 1.2k
- Merge trung bình
- 1 ngày 4 giờ
- Pull request đã merge (30 ngày)
- 20
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của rust-lang/rustfmt
-
A-config C-bug SO-print-config
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
Maintainer thường phản hồi trong vòng 1 ngày
-
A-Unicode C-bug P-low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
rust-lang/rustfmt#7210 · 5 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
A-imports C-bug E-hard I-non-idempotency X-impacts-stable-default-format
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
rust-lang/rustfmt#7173 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
A-comments C-bug only-with-option UO-indent_style
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Fix `first_line_width` to be tab-awareCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mởA-tabs A-whitespace C-bug SO-hard_tabs
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của rust-lang/rustfmt
Issue tương tự
-
bug P2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug core-lang
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Windows microphone listing treats words in a device name as DirectShow labelsCó thể đã có người làm @Sujal-chaudhary đã nhận hôm nay. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
clipy-recorder/clipy#447 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
nightly-cleanup
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
max-sixty/worktrunk#4939 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày