-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed as not planned
Labels
A-ioArea: `std::io`, `std::fs`, `std::net` and `std::path`Area: `std::io`, `std::fs`, `std::net` and `std::path`C-bugCategory: This is a bug.Category: This is a bug.O-windowsOperating system: WindowsOperating system: WindowsP-lowLow priorityLow priorityT-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Description
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
Metadata
Metadata
Assignees
Labels
A-ioArea: `std::io`, `std::fs`, `std::net` and `std::path`Area: `std::io`, `std::fs`, `std::net` and `std::path`C-bugCategory: This is a bug.Category: This is a bug.O-windowsOperating system: WindowsOperating system: WindowsP-lowLow priorityLow priorityT-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.