Skip to content

core::fmt::Formatter does not mention write! macro #128713

Closed
@ErikMcClure

Description

@ErikMcClure

Location

Formatter::write_fmt

Summary

The docs for write_fmt in Formatter do not line up with the docs for write_fmt in the Write trait. The write trait warns you that you should be using the write! macro, but the method in Formatter doesn't. If you are implementing core::fmt::Debug and call write_fmt on the provided Formatter object directly, and use the wrong arguments, the rust-analyzer error will use Formatter docs, which will mislead the user into simply wrapping the arguments via format_args! instead of using a write! macro.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsT-libsRelevant to the library team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions