Some paren rewrite handling / `stmt_expr_attributes` formatting could be improved

Đang mở
#7,193 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

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
58/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
rust
Lĩnh vực
tooling

Hướng nghiên cứu

Read tests/source/issue_7190_remove_nested_parens_false.rs and tests/source/issue_7190_remove_nested_parens_true.rs to see the existing cases. Reproduce the shown formatting with the attribute inside nested parentheses, then trace how paren rewriting formats stmt_expr_attributes. Done when the output matches the example and the related formatting tests pass.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

A-attributes A-statements C-bug I-poor-formatting

Follow-up to #7192. See tests/source/issue_7190_remove_nested_parens_false.rs and tests/source/issue_7190_remove_nested_parens_true.rs. For instance,

fn f() {
    {
    (
        #[allow(arithmetic_overflow)]
        (1u8 + 255u8)
    )
    }
}

=>

fn f() {
    {
        (#[allow(arithmetic_overflow)]
        (1u8 + 255u8))
    }
}
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

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của rust-lang/rustfmt

Tất cả issue của rust-lang/rustfmt

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.