Commit e0b5a82
committed
Make FilePermissions constructible from mode_t without requiring cast to u32
I didn't find anywhere that the previous impl is being used.
This should fix the following error on platforms where libc::mode_t != u32,
such as aarch64-apple-darwin (u16).
error[E0308]: mismatched types
--> library/std/src/sys/pal/unix/fs/tests.rs:61:64
|
61 | assert_eq!(format!("{:?}", FilePermissions::from_inner(libc::S_IFREG | mode)), expected);
| --------------------------- ^^^^^^^^^^^^^^^^^^^^ expected `u32`, found `u16`
| arguments to this function are incorrect
|
note: associated function defined here
--> library/std/src/sys_common/mod.rs:80:8
|
80 | fn from_inner(inner: Inner) -> Self;
| ^^^^^^^^^^
help: you can convert a `u16` to a `u32`
|
61 | assert_eq!(format!("{:?}", FilePermissions::from_inner((libc::S_IFREG | mode).into())), expected);1 parent aa4165b commit e0b5a82
1 file changed
+3
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
685 | 685 | | |
686 | 686 | | |
687 | 687 | | |
688 | | - | |
689 | | - | |
690 | | - | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
691 | 691 | | |
692 | 692 | | |
693 | 693 | | |
| |||
0 commit comments