Skip to content

Migrate format_args!() lints to to ast::FormatArgs #10233

Description

@m-ou-se

Now that rust-lang/rust#106745 is merged, Clippy has access to the original parsed/processed format_args!() invocation. This hopefully means that Clippy no longer needs to do anything that depends on the exact expansion of format_args!() and implementation details of fmt::Arguments (which will undergo changes in the (near!) future).

Details:

As of rust-lang/rust#106745, the format_args!() builtin macro expands to a special ast::FormatArgs AST node, which contains nothing that is specific to the standard library's fmt::Arguments implementation. During AST lowering, this node is expanded into HIR that is specific to how fmt::Arguments is implemented, and will change in the (near) future.)

Clippy's format_args lints are currently done in late passes that use the HIR. They should be changed to use the information from ast::FormatArgs instead. (Ideally by making them early passes, but that might not always be possible.)

This is part of rust-lang/rust#99012


Lints to migrate:

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions