Closed as not planned
Description
openedon May 31, 2023
The Rust 1.69 update broke some fairly simple unit tests we have that runs on Windows7 SP1. Removing a file using std::fs::remove_file
, and subsequently checking if it exists using Path::exists
, will inexplicably return that the path still exists, instead of returning false.
Note that this behavior is not reproduced on Windows10, only on Windows7.
Code
use std::env;
use std::fs::File;
use std::path::Path;
fn main() {
let path = env::temp_dir().join("tempfile.txt");
let f = File::create(&path);
std::fs::remove_file(&path).unwrap();
assert!(!path.exists());
println!("Path does not exist anymore");
}
I expected to see this happen: The assertion succeeds, and "Path does not exist anymore" is printed.
Instead, this happened: The assertion fails, rust believes that the path still exists.
Version it worked on
It most recently worked on Rust 1.68.2
Version with regression
rustc --version --verbose
:
rustc 1.69.0 (84c898d65 2023-04-16)
binary: rustc
commit-hash: 84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc
commit-date: 2023-04-16
host: aarch64-apple-darwin
release: 1.69.0
LLVM version: 15.0.7
@rustbot modify labels: +regression-from-stable-to-stable -regression-untriaged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment