dtolnay/cargo-expand

format_args

Vzz1c opened this issue · 4 comments

Vzz1c commented
let x = String::from("Hello!");
println!("{}", x);

let x = String::from("Hello!");
{
    ::std::io::_print(format_args!("{0}\n", x));
};

After expanding there is still a macro =>format_args!
, you can't see the actual expanded code

This is working correctly. format_args does not expand to Rust code. (In the past it used to.)

@dtolnay
Is there any more detail information/reason about special point of format_args?
I am thinking about something like idea of rust2c, and want to use cargo expand to expand all macros as a start point of transforming.

Farzy commented

Hi @dtolnay, could you please update the description on https://crates.io/crates/cargo-expand, because it gives the impression that println! would be fully expanded, which is not the case anymore?

This is the reason why I found this issue by searching the reason why format_args! is not expanded as in your description 😄