Closed
Description
This happens on Windows 7, cannot test on newer Windows.
Basically, something wrong happens with file handles when using the println!
macro, not sure what exactly.
Minimal repro:
use std::io;
fn main() {
println!("{:?}", io::Error::last_os_error());
println!("{:?}", io::Error::last_os_error());
}
Actual output:
Os { code: 0, kind: Other, message: "Der Vorgang wurde erfolgreich beendet." }
Os { code: 6, kind: Other, message: "Das Handle ist ungültig." }
Expected output:
Os { code: 0, kind: Other, message: "Der Vorgang wurde erfolgreich beendet." }
Os { code: 0, kind: Other, message: "Der Vorgang wurde erfolgreich beendet." }
Sorry for German localization in the error messages.
I noticed this because of some obscure behaviour in the windows API (a function returned != 0, but LastError wasn't set accordingly).