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
If the buffer has not been initialized yet, that will not occur, so the print statement will initialize the buffer in the normal fashion and it will not be flushed.
I tried this code:
I expected to see this happen:
The code should print "hello, world!", which it does if any
print
statement occurred before it (see the test).Instead, this happened:
Nothing is printed to standard output.
The bug is in the cleanup function that disables buffering during shutdown:
rust/library/std/src/io/stdio.rs
Lines 613 to 625 in 9208625
If the buffer has not been initialized yet, that will not occur, so the
print
statement will initialize the buffer in the normal fashion and it will not be flushed.Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: