Skip to content

Use of incorrect width when rewriting nested doc comment can lead to doc comment exceeding the max width #5531

Open
@laralove143

Description

@laralove143

My config:

unstable_features = true
error_on_line_overflow = true
error_on_unformatted = true
format_code_in_doc_comments = true
format_strings = true
hex_literal_case = "Lower"
imports_granularity = "Crate"
normalize_comments = true
reorder_impl_items = true
reorder_imports = true
group_imports = "StdExternalCrate"
reorder_modules = true
use_field_init_shorthand = true
wrap_comments = true

Version: rustfmt 1.5.1-nightly (84f0c3f7 2022-09-03)

Hard to explain with text so here's a recording:
https://user-images.githubusercontent.com/82576556/188334072-8fb46dd0-e76c-46ce-8f03-8db6a08eb096.mov

It even "fixes" the string being split with \

Metadata

Metadata

Assignees

No one assigned

    Labels

    a-commentse-max widtherror[internal]: line formatted, but exceeded maximum widthonly-with-optionrequires a non-default option value to reproduce

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions