We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cat /etc/os-release:
cat /etc/os-release
NAME="Alpine Linux" ID=alpine VERSION_ID=3.12.1 PRETTY_NAME="Alpine Linux v3.12" HOME_URL="https://alpinelinux.org/" BUG_REPORT_URL="https://bugs.alpinelinux.org/"
rustc --version --verbose:
rustc --version --verbose
rustc 1.47.0 (18bf6b4f0 2020-10-07) binary: rustc commit-hash: 18bf6b4f01a6feaf7259ba7cdae58031af1b7b39 commit-date: 2020-10-07 host: x86_64-unknown-linux-musl release: 1.47.0 LLVM version: 11.0
I tried this code:
use std::io; fn main() { let mut user_input = String::new(); print!("Enter input: "); io::stdin() .read_line(&mut user_input) .expect("failed to read line"); println!("Your input: {}", user_input); }
I expected the program to first print a string to stdout, read a string from stdin, then print again to stdout.
Instead, this happened: The program reads from stdin first, then prints the two messages.
I noticed this only happens when using print!. With println! the order is respected.
print!
println!
The text was updated successfully, but these errors were encountered:
I think this is #23818?
Sorry, something went wrong.
Yeah, closing as a duplicate of that
No branches or pull requests
cat /etc/os-release
:rustc --version --verbose
:I tried this code:
I expected the program to first print a string to stdout, read a string from stdin, then print again to stdout.
Instead, this happened:
The program reads from stdin first, then prints the two messages.
I noticed this only happens when using
print!
.With
println!
the order is respected.The text was updated successfully, but these errors were encountered: