From 650918c5c19e19d58e620e8d2f6cee4e2c62a3d4 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Mon, 7 Nov 2022 13:38:01 -0800 Subject: [PATCH 1/3] Update to rustix 0.36. This is a minor update; the main change is that it uses io-lifetimes 1.0 internally, which means that on Rust 1.64 and later it's using the `OwnedFd` etc. from std instead of its own. This is not exposed in memfd's public API. --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 24faaed..4346515 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,7 @@ exclude = [".gitignore", ".travis.yml"] [dependencies] # Private dependencies. -rustix = { version = "0.35.6", features = ["fs"] } +rustix = { version = "0.36.0", features = ["fs"] } [package.metadata.release] disable-publish = true From 47dd2e768cf000e5eafca0905249a9821b05ff8c Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Mon, 7 Nov 2022 13:46:26 -0800 Subject: [PATCH 2/3] Use the new `From` instead of the old `FromFd`. --- src/memfd.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/memfd.rs b/src/memfd.rs index abe59c7..666085c 100644 --- a/src/memfd.rs +++ b/src/memfd.rs @@ -70,9 +70,7 @@ impl MemfdOptions { let fd = rustix::fs::memfd_create(name.as_ref(), flags) .map_err(Into::into) .map_err(crate::Error::Create)?; - Ok(Memfd { - file: rustix::fd::FromFd::from_fd(fd.into()), - }) + Ok(Memfd { file: fd.into() }) } } From aa726dfb5b4cff984cd7f894cac563b70d6f0a13 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Mon, 7 Nov 2022 13:53:48 -0800 Subject: [PATCH 3/3] Fix a clippy lint. --- src/memfd.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/memfd.rs b/src/memfd.rs index 666085c..c72bfea 100644 --- a/src/memfd.rs +++ b/src/memfd.rs @@ -248,5 +248,5 @@ fn is_memfd(fd: &F) -> bool { // is valid. Once `AsFd` is stabilized in std, we can use that instead of // `AsRawFd`, and eliminate this `unsafe` block. let fd = unsafe { rustix::fd::BorrowedFd::borrow_raw(fd.as_raw_fd()) }; - rustix::fs::fcntl_get_seals(&fd).is_ok() + rustix::fs::fcntl_get_seals(fd).is_ok() }