macro_rules! println { () => { ... }; ($($arg:tt)*) => { ... };}Expand description
Prints to the standard output, with a newline.
On all platforms, the newline is the LINE FEED character (\n/U+000A) alone(no additional CARRIAGE RETURN (\r/U+000D)).
This macro uses the same syntax asformat!, but writes to the standard output instead.Seestd::fmt for more information.
Theprintln! macro will lock the standard output on each call. If you callprintln! within a hot loop, this behavior may be the bottleneck of the loop.To avoid this, lock stdout withio::stdout().lock():
Useprintln! only for the primary output of your program. Useeprintln! instead to print error and progress messages.
See the formatting documentation instd::fmtfor details of the macro argument syntax.
§Panics
Panics if writing toio::stdout fails.
Writing to non-blocking stdout can cause an error, which will leadthis macro to panic.