Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion library/std/src/fs/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1736,7 +1736,6 @@ fn fchmod_works() {
check!(file.set_permissions(p));
}

#[cfg(not(target_os = "android"))]

@asder8215 asder8215 Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty sure I wrote this test earlier and templated this off the chmod_works test (if you look at lines 1699-1719 above). It does look redundant with the set_get_permissions_nofollows test on how it creates a regular file and calls set_permissions_nofollow on that. However, the only difference I can say between the two is that this one is intentionally trying to use set_permissions_nofollow on a file that doesn't exist.

Looking at it now, it's more like set_get_permissions_nofollows (which I based off set_get_unix_permissions() earlier and somehow it evolved into being a cross-platform test instead of unix only) is a duplicate of this test since this test encapsulates that test's behavior and more. The ErrorKind::Unsupported error on a regular file should only be reachable by hermit, vxworks and vexos, but I don't think CI tests for those, right?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to, you can remove the set_get_permissions_nofollows test to reduce bloat.

#[test]
fn fchmodat_works() {
let tmpdir = tmpdir();
Expand Down
Loading