Commit 492ac8b
committed
Improve warning suppressions in
- Make the conditional `unused_variable` suppression specific to
the `set_executable_after_creation` parameter, which is all that
needs it. This also makes it more immediately clear that nothing
along the lines of `chmod +x` is done (or relevant) on Windows.
- Allow `useless_conversion` for the conversion from `u32` to
`rustix::fs::RawMode`. The `RawMode` type is what `rustix::fs`
calls `mode_t` as used for the `st_mode` field of a `stat`
structure. On most operating systems, it is `u32`, but this is
not guaranteed by POSIX (which does not even guarantee that it is
unsigned). It is `u16` at least on macOS and possibly other
systems, and I am unsure if there are systems this code can run
on where it is some other type besides `u16` or `u32`.
For now, this does not attempt to make that suppression
conditional, even though it is only needed when `RawMode` is
already `u32`. I don't if there is a good way to express the
condition under which it should apply. If there is, then it could
be made conditional or, if it is truly reliable, then the
conversion itself could be made conditional (though I suspect it
is omitted when not needed in release builds, by optimization).finalize_entry
1 parent d476c06 commit 492ac8b
1 file changed
+5
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
275 | 275 | | |
276 | 276 | | |
277 | 277 | | |
278 | | - | |
279 | | - | |
| 278 | + | |
| 279 | + | |
280 | 280 | | |
281 | 281 | | |
282 | 282 | | |
283 | | - | |
| 283 | + | |
284 | 284 | | |
285 | 285 | | |
286 | 286 | | |
287 | 287 | | |
288 | 288 | | |
289 | 289 | | |
290 | | - | |
| 290 | + | |
291 | 291 | | |
| 292 | + | |
292 | 293 | | |
293 | 294 | | |
294 | 295 | | |
| |||
0 commit comments