-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
Closed
Closed
Copy link
Labels
A-filesystemArea: `std::fs`Area: `std::fs`C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.D-lack-of-suggestionDiagnostics: Adding a (structured) suggestion would increase the quality of the diagnostic.Diagnostics: Adding a (structured) suggestion would increase the quality of the diagnostic.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Description
I tried this code:
https://doc.rust-lang.org/std/fs/struct.FileTimes.html#method.set_modified
let ft = FileTimes::new();
ft.set_modified(modified);I expected to see this happen: changed modified time.
Instead, this happened: nothing, because set_modified returns Self.
Maybe #[must_use] would prevent such bugs.
Meta
Related:
rustc --version --verbose:
rustc 1.95.0-nightly (db3e99bba 2026-02-04)
binary: rustc
commit-hash: db3e99bbab28c6ca778b13222becdea54533d908
commit-date: 2026-02-04
host: x86_64-pc-windows-msvc
release: 1.95.0-nightly
LLVM version: 22.1.0
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-filesystemArea: `std::fs`Area: `std::fs`C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.D-lack-of-suggestionDiagnostics: Adding a (structured) suggestion would increase the quality of the diagnostic.Diagnostics: Adding a (structured) suggestion would increase the quality of the diagnostic.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.