You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
rustfmt with wrap_comments enabled is mangling reference-style intra-doc links by line wrapping them.
A comment like this:
/// Check out [my other struct] ([`Bananas`]) and [the method it has].////// [my other struct]: a_long_name::b_long_name::c_long_name::d_long_name::e_long_name::f_long_name::Apples/// [`Bananas`]: a_long_name::b_long_name::c_long_name::d_long_name::e_long_name::Bananas::fantastic()/// [the method it has]: a_long_name::b_long_name::c_long_name::d_long_name::e_long_name::Bananas::fantastic()pubstructA;
Is wrapped into:
/// Check out [my other struct] ([`Bananas`]) and [the method it has].////// [my other struct]:/// a_long_name::b_long_name::c_long_name::d_long_name::e_long_name::/// f_long_name::Apples [`Bananas`]:/// a_long_name::b_long_name::c_long_name::d_long_name::e_long_name::Bananas::/// fantastic() [the method it has]:/// a_long_name::b_long_name::c_long_name::d_long_name::e_long_name::Bananas::/// fantastic()pubstructA;
I would have expected rustfmt to leave the reference links alone, the wrapped comment makes cargo doc unhappy.
cargo doc output
doctest % cargo doc Documenting doctest v0.1.0 (/Users/dom/Desktop/doctest)warning: unresolved link to `Bananas` --> src/lib.rs:20:36 |20 | /// Check out [my other struct] ([`Bananas`]) and [the method it has]. | ^^^^^^^ no item named `Bananas` in scope | = note: `#[warn(rustdoc::broken_intra_doc_links)]` on by default = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`warning: unresolved link to `a_long_name::b_long_name::c_long_name::d_long_name::e_long_name::` --> src/lib.rs:23:5 |23 | /// a_long_name::b_long_name::c_long_name::d_long_name::e_long_name:: | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no item named `` in module `e_long_name`warning: unresolved link to `Bananas` --> src/lib.rs:24:27 |24 | /// f_long_name::Apples [`Bananas`]: | ^^^^^^^ no item named `Bananas` in scope | = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`warning: `doctest` (lib doc) generated 3 warnings
The text was updated successfully, but these errors were encountered:
rustfmt with
wrap_comments
enabled is mangling reference-style intra-doc links by line wrapping them.A comment like this:
Is wrapped into:
I would have expected rustfmt to leave the reference links alone, the wrapped comment makes
cargo doc
unhappy.cargo doc output
The text was updated successfully, but these errors were encountered: