From d72eac8465dd6a7f3bd8f5e59e8e2c8ad1151e22 Mon Sep 17 00:00:00 2001 From: yukang Date: Fri, 6 Feb 2026 23:03:19 +0800 Subject: [PATCH] add must_use for FileTimes --- library/std/src/fs.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/library/std/src/fs.rs b/library/std/src/fs.rs index a24baad61501..cf6f9594c002 100644 --- a/library/std/src/fs.rs +++ b/library/std/src/fs.rs @@ -277,6 +277,7 @@ pub struct OpenOptions(fs_imp::OpenOptions); /// Representation of the various timestamps on a file. #[derive(Copy, Clone, Debug, Default)] #[stable(feature = "file_set_times", since = "1.75.0")] +#[must_use = "must be applied to a file via `File::set_times` to have any effect"] pub struct FileTimes(fs_imp::FileTimes); /// Representation of the various permissions on a file.