Skip to content

Commit e09e003

Browse files
authored
Disable "unused unsafe" warnings in the libc makedev code. (#1414)
* Disable "unused unsafe" warnings in the libc makedev code. The latest version of libc makes `makedev`, `major`, and `minor` safe functions; for now; disable the warning about unused unsafe blocks wrapped around those functions, to be compatible with older and newer libc versions. * Pin once_cell for the MSRV build.
1 parent 04e2a5a commit e09e003

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ jobs:
5656
cargo update --package=half --precise=2.2.1
5757
cargo update --package=flate2 --precise=1.0.35
5858
cargo update --package=textwrap --precise=0.16.1
59+
cargo update --package=once_cell --precise=1.20.3
5960
6061
- run: >
6162
rustup target add
@@ -533,6 +534,7 @@ jobs:
533534
cargo update --package=half --precise=2.2.1
534535
cargo update --package=flate2 --precise=1.0.35
535536
cargo update --package=textwrap --precise=0.16.1
537+
cargo update --package=once_cell --precise=1.20.3
536538
537539
- run: |
538540
cargo test --verbose --features=all-apis --release --workspace -- --nocapture

src/backend/libc/fs/makedev.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
// TODO: Remove the unsafe blocks. libc 0.2.171 removed `unsafe` from several
2+
// of these functions. Eventually we should depend on that version and remove
3+
// the `unsafe` blocks in the code, but for now, disable that warning so that
4+
// we're compatible with older libc versions.
5+
#![allow(unused_unsafe)]
6+
17
#[cfg(not(all(target_os = "android", target_pointer_width = "32")))]
28
use crate::backend::c;
39
use crate::fs::Dev;

0 commit comments

Comments
 (0)