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
println! uses concat!($fmt, "\n") internally, which for literals converts $fmt into a string before concatenating. Because of this, println!(123) is accepted.
That said, rather than make println! as strict as print! and format!, it would be nice if format_args!(foo) could become shorthand for format_args!("{}", foo), somewhat similar to what panic! does.
The text was updated successfully, but these errors were encountered:
Oh, whoops, is this a dupe, then? That seems more about making a breaking change to println! (and writeln!) to be less permissive about what they accept, whereas I'd personally like format_args! to be more permissive.
I guess it's a duplicate, but the opinion in the other issue seemed to be that strictifying would be better than loosening. Loosening wouldn't be a breaking change, though. I guess an RFC would be required.
Ah yeah I think this is a dupe of #30143 so I'm going to close in favor of that (which was previously decided as a whelp-this-would-be-nice-to-fix-but-2.0 kind of thing)
println!
usesconcat!($fmt, "\n")
internally, which for literals converts$fmt
into a string before concatenating. Because of this,println!(123)
is accepted.That said, rather than make
println!
as strict asprint!
andformat!
, it would be nice ifformat_args!(foo)
could become shorthand forformat_args!("{}", foo)
, somewhat similar to whatpanic!
does.The text was updated successfully, but these errors were encountered: