Skip to content

Try rethinking the format_args! macro #11838

Closed

Description

This macro was written when rvalue lifetimes were pretty short, so the first argument is a closure or a bare function taking a local as an argument (the local is restrained to an inserted scope).

With our newly minted rvalue lifetime rules, this macro should be re-evaluated. It really wants to look like this:

let args = format_args!("foo, {} {}", "bar", 3);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    A-syntaxextArea: Syntax extensions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions