+12
| use core::ffi::c_void; | ||
| use core::mem::size_of; | ||
| extern "C" { | ||
| /// <https://github.com/gcc-mirror/gcc/blob/28219f7f99a80519d1c6ab5e5dc83b4c7f8d7251/libsanitizer/include/sanitizer/msan_interface.h#L40> | ||
| #[link_name = "__msan_unpoison"] | ||
| pub(crate) fn unpoison(a: *const c_void, size: usize); | ||
| } | ||
| pub(crate) fn unpoison_maybe_uninit<T>(t: &MaybeUninit<T>) { | ||
| unpoison(t.as_ptr(), size_of::<T>()) | ||
| } |
| { | ||
| "git": { | ||
| "sha1": "5245b8160d53a04c37164779cfb11d35e18f55b3" | ||
| "sha1": "38327261924aa71059a4cdeeea2286ec88bd9146" | ||
| }, | ||
| "path_in_vcs": "" | ||
| } |
+5
-2
| use std::env::var; | ||
| use std::io::Write as _; | ||
| use std::path::PathBuf; | ||
@@ -119,3 +120,3 @@ /// The directory for inline asm. | ||
| if libc { | ||
| if os != "android" && os == "linux" && !cfg_no_linux_raw { | ||
| if (os == "linux" || os == "android") && !cfg_no_linux_raw { | ||
| use_feature("linux_raw_dep"); | ||
@@ -257,2 +258,4 @@ } | ||
| let out_dir = var("OUT_DIR").unwrap(); | ||
| let out_file = PathBuf::from(out_dir).join("rustix_test_can_compile"); | ||
| cmd.arg("--crate-type=rlib") // Don't require `main`. | ||
@@ -263,3 +266,3 @@ .arg("--emit=metadata") // Do as little as possible but still parse. | ||
| .arg("-o") | ||
| .arg(std::env::temp_dir().join("rustix_test_can_compile")) | ||
| .arg(out_file) | ||
| .stdout(Stdio::null()); // We don't care about the output (only whether it builds or not) | ||
@@ -266,0 +269,0 @@ |
+115
-226
@@ -13,5 +13,5 @@ # This file is automatically @generated by Cargo. | ||
| name = "aho-corasick" | ||
| version = "1.1.3" | ||
| version = "1.1.4" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" | ||
| checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" | ||
| dependencies = [ | ||
@@ -62,5 +62,5 @@ "memchr", | ||
| name = "bumpalo" | ||
| version = "3.19.0" | ||
| version = "3.19.1" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" | ||
| checksum = "5dd9dc738b7a8311c7ade152424974d8115f2cdad61e8dab8dac9f2362298510" | ||
@@ -75,5 +75,5 @@ [[package]] | ||
| name = "cfg-if" | ||
| version = "1.0.3" | ||
| version = "1.0.4" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "2fd1289c04a9ea8cb22300a459a72a385d7c73d3259e2ed7dcb2af674838cfa9" | ||
| checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" | ||
@@ -231,5 +231,5 @@ [[package]] | ||
| name = "errno" | ||
| version = "0.3.13" | ||
| version = "0.3.14" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "778e2ac28f6c47af28e4907f13ffd1e1ddbd400980a9abd7c8df189bf578a5ad" | ||
| checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" | ||
| dependencies = [ | ||
@@ -248,5 +248,5 @@ "libc", | ||
| name = "flate2" | ||
| version = "1.1.2" | ||
| version = "1.1.5" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "4a3d7db9596fecd151c5f638c0ee5d5bd487b6e0ea232e5dc96d5250f6f94b1d" | ||
| checksum = "bfe33edd8e85a12a67454e37f8c75e730830d83e313556ab9ebf9ee7fbeb3bfb" | ||
| dependencies = [ | ||
@@ -336,5 +336,5 @@ "crc32fast", | ||
| name = "getrandom" | ||
| version = "0.3.3" | ||
| version = "0.3.4" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" | ||
| checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" | ||
| dependencies = [ | ||
@@ -344,3 +344,3 @@ "cfg-if", | ||
| "r-efi", | ||
| "wasi", | ||
| "wasip2", | ||
| ] | ||
@@ -350,8 +350,9 @@ | ||
| name = "half" | ||
| version = "2.6.0" | ||
| version = "2.7.1" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "459196ed295495a68f7d7fe1d84f6c4b7ff0e21fe3017b2f283c6fac3ad803c9" | ||
| checksum = "6ea2d84b969582b4b1864a92dc5d27cd2b77b622a8d79306834f1be5ba20d84b" | ||
| dependencies = [ | ||
| "cfg-if", | ||
| "crunchy", | ||
| "zerocopy", | ||
| ] | ||
@@ -401,11 +402,11 @@ | ||
| name = "itoa" | ||
| version = "1.0.15" | ||
| version = "1.0.16" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" | ||
| checksum = "7ee5b5339afb4c41626dde77b7a611bd4f2c202b897852b4bcf5d03eddc61010" | ||
| [[package]] | ||
| name = "js-sys" | ||
| version = "0.3.78" | ||
| version = "0.3.83" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "0c0b063578492ceec17683ef2f8c5e89121fbd0b172cbc280635ab7567db2738" | ||
| checksum = "464a3709c7f55f1f721e5389aa6ea4e3bc6aba669353300af094b29ffbdde1d8" | ||
| dependencies = [ | ||
@@ -424,14 +425,8 @@ "once_cell", | ||
| name = "libc" | ||
| version = "0.2.175" | ||
| version = "0.2.178" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "6a82ae493e598baaea5209805c49bbf2ea7de956d50d7da0da1164f9c6d28543" | ||
| checksum = "37c93d8daa9d8a012fd8ab92f088405fb202ea0b6ab73ee2482ae66af4f42091" | ||
| [[package]] | ||
| name = "linux-raw-sys" | ||
| version = "0.9.4" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" | ||
| [[package]] | ||
| name = "linux-raw-sys" | ||
| version = "0.11.0" | ||
@@ -446,7 +441,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| name = "lock_api" | ||
| version = "0.4.13" | ||
| version = "0.4.14" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765" | ||
| checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" | ||
| dependencies = [ | ||
| "autocfg", | ||
| "scopeguard", | ||
@@ -463,5 +457,5 @@ ] | ||
| name = "memchr" | ||
| version = "2.7.5" | ||
| version = "2.7.6" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" | ||
| checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" | ||
@@ -484,2 +478,3 @@ [[package]] | ||
| "adler2", | ||
| "simd-adler32", | ||
| ] | ||
@@ -516,5 +511,5 @@ | ||
| name = "parking_lot" | ||
| version = "0.12.4" | ||
| version = "0.12.5" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "70d58bf43669b5795d1576d0641cfb6fbb2057bf629506267a92807158584a13" | ||
| checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" | ||
| dependencies = [ | ||
@@ -527,5 +522,5 @@ "lock_api", | ||
| name = "parking_lot_core" | ||
| version = "0.9.11" | ||
| version = "0.9.12" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5" | ||
| checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" | ||
| dependencies = [ | ||
@@ -536,3 +531,3 @@ "cfg-if", | ||
| "smallvec", | ||
| "windows-targets 0.52.6", | ||
| "windows-link", | ||
| ] | ||
@@ -582,5 +577,5 @@ | ||
| name = "proc-macro2" | ||
| version = "1.0.101" | ||
| version = "1.0.103" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "89ae43fd86e4158d6db51ad8e2b80f313af9cc74f5c0e03ccb87de09998732de" | ||
| checksum = "5ee95bc4ef87b8d5ba32e8b7714ccc834865276eab0aed5c9958d00ec45f49e8" | ||
| dependencies = [ | ||
@@ -592,5 +587,5 @@ "unicode-ident", | ||
| name = "quote" | ||
| version = "1.0.40" | ||
| version = "1.0.42" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" | ||
| checksum = "a338cc41d27e6cc6dce6cefc13a0729dfbb81c262b1f519331575dd80ef3067f" | ||
| dependencies = [ | ||
@@ -628,5 +623,5 @@ "proc-macro2", | ||
| name = "redox_syscall" | ||
| version = "0.5.17" | ||
| version = "0.5.18" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "5407465600fb0548f1442edf71dd20683c6ed326200ace4b1ef0763521bb3b77" | ||
| checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" | ||
| dependencies = [ | ||
@@ -638,5 +633,5 @@ "bitflags 2.9.1", | ||
| name = "regex" | ||
| version = "1.11.2" | ||
| version = "1.12.2" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "23d7fd106d8c02486a8d64e778353d1cffe08ce79ac2e82f540c86d0facf6912" | ||
| checksum = "843bc0191f75f3e22651ae5f1e72939ab2f72a4bc30fa80a066bd66edefc24d4" | ||
| dependencies = [ | ||
@@ -651,5 +646,5 @@ "aho-corasick", | ||
| name = "regex-automata" | ||
| version = "0.4.10" | ||
| version = "0.4.13" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "6b9458fa0bfeeac22b5ca447c63aaf45f28439a709ccd244698632f9aa6394d6" | ||
| checksum = "5276caf25ac86c8d810222b3dbb938e512c55c6831a10f3e6ed1c93b84041f1c" | ||
| dependencies = [ | ||
@@ -663,5 +658,5 @@ "aho-corasick", | ||
| name = "regex-syntax" | ||
| version = "0.8.6" | ||
| version = "0.8.8" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "caf4aa5b0f434c91fe5c7f1ecb6a5ece2130b02ad2a590589dda5146df959001" | ||
| checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58" | ||
@@ -682,5 +677,5 @@ [[package]] | ||
| name = "rustix" | ||
| version = "1.0.8" | ||
| version = "1.1.2" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "11181fbabf243db407ef8df94a6ce0b2f9a733bd8be4ad02b4eda9602296cac8" | ||
| checksum = "cd15f8a2c5551a84d56efdc1cd049089e409ac19a3072d5037a17fd70719ff3e" | ||
| dependencies = [ | ||
@@ -690,3 +685,3 @@ "bitflags 2.9.1", | ||
| "libc", | ||
| "linux-raw-sys 0.9.4", | ||
| "linux-raw-sys", | ||
| "windows-sys", | ||
@@ -697,3 +692,3 @@ ] | ||
| name = "rustix" | ||
| version = "1.1.2" | ||
| version = "1.1.3" | ||
| dependencies = [ | ||
@@ -705,3 +700,3 @@ "bitflags 2.9.1", | ||
| "libc", | ||
| "linux-raw-sys 0.11.0", | ||
| "linux-raw-sys", | ||
| "memoffset", | ||
@@ -725,5 +720,5 @@ "once_cell", | ||
| name = "ryu" | ||
| version = "1.0.20" | ||
| version = "1.0.21" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" | ||
| checksum = "62049b2877bf12821e8f9ad256ee38fdc31db7387ec2d3b3f403024de2034aea" | ||
@@ -747,6 +742,7 @@ [[package]] | ||
| name = "serde" | ||
| version = "1.0.219" | ||
| version = "1.0.228" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" | ||
| checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" | ||
| dependencies = [ | ||
| "serde_core", | ||
| "serde_derive", | ||
@@ -756,6 +752,15 @@ ] | ||
| [[package]] | ||
| name = "serde_core" | ||
| version = "1.0.228" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" | ||
| dependencies = [ | ||
| "serde_derive", | ||
| ] | ||
| [[package]] | ||
| name = "serde_derive" | ||
| version = "1.0.219" | ||
| version = "1.0.228" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" | ||
| checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" | ||
| dependencies = [ | ||
@@ -769,5 +774,5 @@ "proc-macro2", | ||
| name = "serde_json" | ||
| version = "1.0.143" | ||
| version = "1.0.146" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "d401abef1d108fbd9cbaebc3e46611f4b1021f714a0597a71f41ee463f5f4a5a" | ||
| checksum = "217ca874ae0207aac254aa02c957ded05585a90892cc8d87f9e5fa49669dadd8" | ||
| dependencies = [ | ||
@@ -778,2 +783,3 @@ "itoa", | ||
| "serde", | ||
| "serde_core", | ||
| ] | ||
@@ -807,2 +813,8 @@ | ||
| [[package]] | ||
| name = "simd-adler32" | ||
| version = "0.3.8" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "e320a6c5ad31d271ad523dcf3ad13e2767ad8b1cb8f047f75a8aeaf8da139da2" | ||
| [[package]] | ||
| name = "slab" | ||
@@ -827,5 +839,5 @@ version = "0.4.11" | ||
| name = "syn" | ||
| version = "2.0.106" | ||
| version = "2.0.111" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "ede7c438028d4436d71104916910f5bb611972c5cfd7f89b8300a8186e6fada6" | ||
| checksum = "390cc9a294ab71bdb1aa2e99d13be9c753cd2d7bd6560c77118597410c4d2e87" | ||
| dependencies = [ | ||
@@ -839,5 +851,5 @@ "proc-macro2", | ||
| name = "tempfile" | ||
| version = "3.21.0" | ||
| version = "3.23.0" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "15b61f8f20e3a6f7e0649d825294eaf317edce30f82cf6026e7e4cb9222a7d1e" | ||
| checksum = "2d31c77bdf42a745371d260a26ca7163f1e0924b64afa0b688e61b5a9fa02f16" | ||
| dependencies = [ | ||
@@ -847,3 +859,3 @@ "fastrand", | ||
| "once_cell", | ||
| "rustix 1.0.8", | ||
| "rustix 1.1.2", | ||
| "windows-sys", | ||
@@ -870,5 +882,5 @@ ] | ||
| name = "unicode-ident" | ||
| version = "1.0.18" | ||
| version = "1.0.22" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" | ||
| checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" | ||
@@ -886,6 +898,6 @@ [[package]] | ||
| [[package]] | ||
| name = "wasi" | ||
| version = "0.14.4+wasi-0.2.4" | ||
| name = "wasip2" | ||
| version = "1.0.1+wasi-0.2.4" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "88a5f4a424faf49c3c2c344f166f0662341d470ea185e939657aaff130f0ec4a" | ||
| checksum = "0562428422c63773dad2c345a1882263bbf4d65cf3f42e90921f787ef5ad58e7" | ||
| dependencies = [ | ||
@@ -897,5 +909,5 @@ "wit-bindgen", | ||
| name = "wasm-bindgen" | ||
| version = "0.2.101" | ||
| version = "0.2.106" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "7e14915cadd45b529bb8d1f343c4ed0ac1de926144b746e2710f9cd05df6603b" | ||
| checksum = "0d759f433fa64a2d763d1340820e46e111a7a5ab75f993d1852d70b03dbb80fd" | ||
| dependencies = [ | ||
@@ -910,20 +922,6 @@ "cfg-if", | ||
| [[package]] | ||
| name = "wasm-bindgen-backend" | ||
| version = "0.2.101" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "e28d1ba982ca7923fd01448d5c30c6864d0a14109560296a162f80f305fb93bb" | ||
| dependencies = [ | ||
| "bumpalo", | ||
| "log", | ||
| "proc-macro2", | ||
| "quote", | ||
| "syn", | ||
| "wasm-bindgen-shared", | ||
| ] | ||
| [[package]] | ||
| name = "wasm-bindgen-macro" | ||
| version = "0.2.101" | ||
| version = "0.2.106" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "7c3d463ae3eff775b0c45df9da45d68837702ac35af998361e2c84e7c5ec1b0d" | ||
| checksum = "48cb0d2638f8baedbc542ed444afc0644a29166f1595371af4fecf8ce1e7eeb3" | ||
| dependencies = [ | ||
@@ -936,10 +934,10 @@ "quote", | ||
| name = "wasm-bindgen-macro-support" | ||
| version = "0.2.101" | ||
| version = "0.2.106" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "7bb4ce89b08211f923caf51d527662b75bdc9c9c7aab40f86dcb9fb85ac552aa" | ||
| checksum = "cefb59d5cd5f92d9dcf80e4683949f15ca4b511f4ac0a6e14d4e1ac60c6ecd40" | ||
| dependencies = [ | ||
| "bumpalo", | ||
| "proc-macro2", | ||
| "quote", | ||
| "syn", | ||
| "wasm-bindgen-backend", | ||
| "wasm-bindgen-shared", | ||
@@ -950,5 +948,5 @@ ] | ||
| name = "wasm-bindgen-shared" | ||
| version = "0.2.101" | ||
| version = "0.2.106" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "f143854a3b13752c6950862c906306adb27c7e839f7414cec8fea35beab624c1" | ||
| checksum = "cbc538057e648b67f72a982e708d485b2efa771e1ac05fec311f9f63e5800db4" | ||
| dependencies = [ | ||
@@ -960,5 +958,5 @@ "unicode-ident", | ||
| name = "web-sys" | ||
| version = "0.3.78" | ||
| version = "0.3.83" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "77e4b637749ff0d92b8fad63aa1f7cff3cbe125fd49c175cd6345e7272638b12" | ||
| checksum = "9b32828d774c412041098d182a8b38b16ea816958e07cf40eec2bc080ae137ac" | ||
| dependencies = [ | ||
@@ -1002,148 +1000,39 @@ "js-sys", | ||
| name = "windows-link" | ||
| version = "0.1.3" | ||
| version = "0.2.1" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" | ||
| checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" | ||
| [[package]] | ||
| name = "windows-sys" | ||
| version = "0.60.2" | ||
| version = "0.61.2" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" | ||
| checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" | ||
| dependencies = [ | ||
| "windows-targets 0.53.3", | ||
| "windows-link", | ||
| ] | ||
| [[package]] | ||
| name = "windows-targets" | ||
| version = "0.52.6" | ||
| name = "wit-bindgen" | ||
| version = "0.46.0" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" | ||
| dependencies = [ | ||
| "windows_aarch64_gnullvm 0.52.6", | ||
| "windows_aarch64_msvc 0.52.6", | ||
| "windows_i686_gnu 0.52.6", | ||
| "windows_i686_gnullvm 0.52.6", | ||
| "windows_i686_msvc 0.52.6", | ||
| "windows_x86_64_gnu 0.52.6", | ||
| "windows_x86_64_gnullvm 0.52.6", | ||
| "windows_x86_64_msvc 0.52.6", | ||
| ] | ||
| checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59" | ||
| [[package]] | ||
| name = "windows-targets" | ||
| version = "0.53.3" | ||
| name = "zerocopy" | ||
| version = "0.8.31" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "d5fe6031c4041849d7c496a8ded650796e7b6ecc19df1a431c1a363342e5dc91" | ||
| checksum = "fd74ec98b9250adb3ca554bdde269adf631549f51d8a8f8f0a10b50f1cb298c3" | ||
| dependencies = [ | ||
| "windows-link", | ||
| "windows_aarch64_gnullvm 0.53.0", | ||
| "windows_aarch64_msvc 0.53.0", | ||
| "windows_i686_gnu 0.53.0", | ||
| "windows_i686_gnullvm 0.53.0", | ||
| "windows_i686_msvc 0.53.0", | ||
| "windows_x86_64_gnu 0.53.0", | ||
| "windows_x86_64_gnullvm 0.53.0", | ||
| "windows_x86_64_msvc 0.53.0", | ||
| "zerocopy-derive", | ||
| ] | ||
| [[package]] | ||
| name = "windows_aarch64_gnullvm" | ||
| version = "0.52.6" | ||
| name = "zerocopy-derive" | ||
| version = "0.8.31" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" | ||
| [[package]] | ||
| name = "windows_aarch64_gnullvm" | ||
| version = "0.53.0" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" | ||
| [[package]] | ||
| name = "windows_aarch64_msvc" | ||
| version = "0.52.6" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" | ||
| [[package]] | ||
| name = "windows_aarch64_msvc" | ||
| version = "0.53.0" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" | ||
| [[package]] | ||
| name = "windows_i686_gnu" | ||
| version = "0.52.6" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" | ||
| [[package]] | ||
| name = "windows_i686_gnu" | ||
| version = "0.53.0" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" | ||
| [[package]] | ||
| name = "windows_i686_gnullvm" | ||
| version = "0.52.6" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" | ||
| [[package]] | ||
| name = "windows_i686_gnullvm" | ||
| version = "0.53.0" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" | ||
| [[package]] | ||
| name = "windows_i686_msvc" | ||
| version = "0.52.6" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" | ||
| [[package]] | ||
| name = "windows_i686_msvc" | ||
| version = "0.53.0" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" | ||
| [[package]] | ||
| name = "windows_x86_64_gnu" | ||
| version = "0.52.6" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" | ||
| [[package]] | ||
| name = "windows_x86_64_gnu" | ||
| version = "0.53.0" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" | ||
| [[package]] | ||
| name = "windows_x86_64_gnullvm" | ||
| version = "0.52.6" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" | ||
| [[package]] | ||
| name = "windows_x86_64_gnullvm" | ||
| version = "0.53.0" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" | ||
| [[package]] | ||
| name = "windows_x86_64_msvc" | ||
| version = "0.52.6" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" | ||
| [[package]] | ||
| name = "windows_x86_64_msvc" | ||
| version = "0.53.0" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" | ||
| [[package]] | ||
| name = "wit-bindgen" | ||
| version = "0.45.1" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "5c573471f125075647d03df72e026074b7203790d41351cd6edc96f46bcccd36" | ||
| checksum = "d8a8d209fdf45cf5138cbb5a506f6b52522a25afccc534d1475dad8e31105c6a" | ||
| dependencies = [ | ||
| "proc-macro2", | ||
| "quote", | ||
| "syn", | ||
| ] |
+8
-4
@@ -16,3 +16,3 @@ # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO | ||
| name = "rustix" | ||
| version = "1.1.2" | ||
| version = "1.1.3" | ||
| authors = [ | ||
@@ -195,3 +195,3 @@ "Dan Gohman <dev@sunfishcode.online>", | ||
| [target.'cfg(all(any(target_os = "linux"), any(rustix_use_libc, miri, not(all(target_os = "linux", any(target_endian = "little", any(target_arch = "s390x", target_arch = "powerpc")), any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc"), all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "s390x"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64")))))))'.dependencies.linux-raw-sys] | ||
| [target.'cfg(all(any(target_os = "linux", target_os = "android"), any(rustix_use_libc, miri, not(all(target_os = "linux", any(target_endian = "little", any(target_arch = "s390x", target_arch = "powerpc")), any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc"), all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "s390x"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64")))))))'.dependencies.linux-raw-sys] | ||
| version = "0.11.0" | ||
@@ -209,3 +209,3 @@ features = [ | ||
| [target.'cfg(all(not(rustix_use_libc), not(miri), target_os = "linux", any(target_endian = "little", any(target_arch = "s390x", target_arch = "powerpc")), any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc"), all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "s390x"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))'.dependencies.libc] | ||
| version = "0.2.171" | ||
| version = "0.2.177" | ||
| optional = true | ||
@@ -233,3 +233,3 @@ default-features = false | ||
| [target.'cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", any(target_endian = "little", any(target_arch = "s390x", target_arch = "powerpc")), any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc"), all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "s390x"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64")))))))'.dependencies.libc] | ||
| version = "0.2.171" | ||
| version = "0.2.177" | ||
| default-features = false | ||
@@ -280,2 +280,3 @@ | ||
| "cfg(lower_upper_exp_for_non_zero)", | ||
| "cfg(sanitize_memory)", | ||
| "cfg(netbsdlike)", | ||
@@ -294,1 +295,4 @@ "cfg(rustc_attrs)", | ||
| ] | ||
| [hints] | ||
| mostly-unused = true |
+0
-6
@@ -69,8 +69,2 @@ # Changes from 0.38.x to 1.x | ||
| [`rustix::io_uring::io_uring_register`] now has a [`IoringRegisterFlags`] | ||
| argument, and `rustix::io_uring::io_uring_register_with` is removed. | ||
| [`rustix::io_uring::io_uring_register`]: https://docs.rs/rustix/1/rustix/io_uring/fn.io_uring_register.html | ||
| [`IoringRegisterFlags`]: https://docs.rs/rustix/1/rustix/io_uring/struct.IoringRegisterFlags.html | ||
| Several structs in [`rustix::io_uring`] are now marked `#[non_exhaustive]` | ||
@@ -77,0 +71,0 @@ because they contain padding or reserved fields. Instead of constructing |
@@ -69,15 +69,2 @@ //! Libc and supplemental types and constants. | ||
| #[cfg(all( | ||
| linux_kernel, | ||
| any( | ||
| target_arch = "mips", | ||
| target_arch = "mips32r6", | ||
| target_arch = "mips64", | ||
| target_arch = "mips64r6", | ||
| target_arch = "sparc", | ||
| target_arch = "sparc64" | ||
| ) | ||
| ))] | ||
| pub(crate) const SIGEMT: c_int = linux_raw_sys::general::SIGEMT as _; | ||
| // TODO: Upstream these. | ||
@@ -520,2 +507,3 @@ #[cfg(all(linux_raw_dep, feature = "termios"))] | ||
| not(any( | ||
| target_os = "android", | ||
| target_os = "emscripten", | ||
@@ -522,0 +510,0 @@ target_env = "gnu", |
@@ -78,2 +78,23 @@ #[cfg(not(any( | ||
| /// Returns the file descriptor associated with the directory stream. | ||
| /// | ||
| /// The file descriptor is used internally by the directory stream. As a result, it is useful | ||
| /// only for functions which do not depend or alter the file position. | ||
| /// | ||
| /// # References | ||
| /// | ||
| /// - [POSIX] | ||
| /// | ||
| /// [POSIX]: https://pubs.opengroup.org/onlinepubs/9799919799/functions/dirfd.html | ||
| #[inline] | ||
| #[doc(alias = "dirfd")] | ||
| pub fn fd<'a>(&'a self) -> io::Result<BorrowedFd<'a>> { | ||
| let raw_fd = unsafe { c::dirfd(self.libc_dir.as_ptr()) }; | ||
| if raw_fd < 0 { | ||
| Err(io::Errno::last_os_error()) | ||
| } else { | ||
| Ok(unsafe { BorrowedFd::borrow_raw(raw_fd) }) | ||
| } | ||
| } | ||
| /// Borrow `fd` and construct a `Dir` that reads entries from the given | ||
@@ -80,0 +101,0 @@ /// directory file descriptor. |
@@ -17,2 +17,3 @@ // TODO: Remove the unsafe blocks. libc 0.2.171 removed `unsafe` from several | ||
| target_os = "emscripten", | ||
| target_os = "redox", | ||
| )))] | ||
@@ -48,2 +49,13 @@ #[inline] | ||
| #[cfg(target_os = "redox")] | ||
| #[inline] | ||
| pub(crate) fn makedev(maj: u32, min: u32) -> Dev { | ||
| // Redox's makedev is reportedly similar to 32-bit Android's but the return | ||
| // type is signed. | ||
| ((i64::from(maj) & 0xffff_f000_i64) << 32) | ||
| | ((i64::from(maj) & 0x0000_0fff_i64) << 8) | ||
| | ((i64::from(min) & 0xffff_ff00_i64) << 12) | ||
| | (i64::from(min) & 0x0000_00ff_i64) | ||
| } | ||
| #[cfg(target_os = "emscripten")] | ||
@@ -75,3 +87,4 @@ #[inline] | ||
| target_os = "emscripten", | ||
| target_os = "netbsd" | ||
| target_os = "netbsd", | ||
| target_os = "redox" | ||
| )))] | ||
@@ -95,3 +108,6 @@ #[inline] | ||
| #[cfg(all(target_os = "android", target_pointer_width = "32"))] | ||
| #[cfg(any( | ||
| all(target_os = "android", target_pointer_width = "32"), | ||
| target_os = "redox" | ||
| ))] | ||
| #[inline] | ||
@@ -116,3 +132,4 @@ pub(crate) fn major(dev: Dev) -> u32 { | ||
| target_os = "emscripten", | ||
| target_os = "netbsd" | ||
| target_os = "netbsd", | ||
| target_os = "redox", | ||
| )))] | ||
@@ -136,3 +153,6 @@ #[inline] | ||
| #[cfg(all(target_os = "android", target_pointer_width = "32"))] | ||
| #[cfg(any( | ||
| all(target_os = "android", target_pointer_width = "32"), | ||
| target_os = "redox" | ||
| ))] | ||
| #[inline] | ||
@@ -139,0 +159,0 @@ pub(crate) fn minor(dev: Dev) -> u32 { |
@@ -9,3 +9,2 @@ #[cfg(all(feature = "alloc", not(any(target_os = "espidf", target_os = "redox"))))] | ||
| target_os = "horizon", | ||
| target_os = "redox", | ||
| target_os = "vita", | ||
@@ -12,0 +11,0 @@ target_os = "wasi" |
@@ -112,3 +112,3 @@ //! The libc backend. | ||
| pub(crate) mod io; | ||
| #[cfg(linux_kernel)] | ||
| #[cfg(all(linux_kernel, not(target_os = "android")))] | ||
| #[cfg(feature = "io_uring")] | ||
@@ -115,0 +115,0 @@ pub(crate) mod io_uring; |
@@ -7,3 +7,2 @@ pub(crate) mod addr; | ||
| target_os = "horizon", | ||
| target_os = "redox", | ||
| target_os = "vita" | ||
@@ -10,0 +9,0 @@ )))] |
@@ -19,2 +19,3 @@ //! Utilities for dealing with message headers. | ||
| target_os = "android", | ||
| target_os = "redox", | ||
| all( | ||
@@ -34,11 +35,6 @@ target_os = "linux", | ||
| #[cfg(all( | ||
| not(any(windows, target_os = "espidf", target_os = "vita", target_os = "wasi")), | ||
| not(any( | ||
| windows, | ||
| target_os = "espidf", | ||
| target_os = "android", | ||
| target_os = "redox", | ||
| target_os = "vita", | ||
| target_os = "wasi" | ||
| )), | ||
| not(any( | ||
| target_os = "android", | ||
| all( | ||
@@ -88,3 +84,2 @@ target_os = "linux", | ||
| target_os = "nto", | ||
| target_os = "redox", | ||
| target_os = "vita", | ||
@@ -185,3 +180,3 @@ target_os = "wasi", | ||
| /// Create a zero-initialized message header struct value. | ||
| #[cfg(all(unix, not(target_os = "redox")))] | ||
| #[cfg(unix)] | ||
| pub(crate) fn zero_msghdr() -> c::msghdr { | ||
@@ -188,0 +183,0 @@ // SAFETY: We can't initialize all the fields by value because on some |
@@ -85,3 +85,3 @@ //! libc syscalls supporting `rustix::net::sockopt`. | ||
| use core::time::Duration; | ||
| #[cfg(linux_raw_dep)] | ||
| #[cfg(all(linux_raw_dep, target_os = "linux"))] | ||
| use linux_raw_sys::xdp::{xdp_mmap_offsets, xdp_statistics, xdp_statistics_v1}; | ||
@@ -1157,3 +1157,3 @@ | ||
| #[cfg(linux_raw_dep)] | ||
| #[cfg(all(linux_raw_dep, target_os = "linux"))] | ||
| #[inline] | ||
@@ -1245,3 +1245,3 @@ pub(crate) fn xdp_mmap_offsets(fd: BorrowedFd<'_>) -> io::Result<XdpMmapOffsets> { | ||
| #[cfg(linux_raw_dep)] | ||
| #[cfg(all(linux_raw_dep, target_os = "linux"))] | ||
| #[inline] | ||
@@ -1248,0 +1248,0 @@ pub(crate) fn xdp_statistics(fd: BorrowedFd<'_>) -> io::Result<XdpStatistics> { |
@@ -24,3 +24,2 @@ //! libc syscalls supporting `rustix::net`. | ||
| target_os = "horizon", | ||
| target_os = "redox", | ||
| target_os = "vita" | ||
@@ -191,3 +190,2 @@ )))] | ||
| target_os = "horizon", | ||
| target_os = "redox", | ||
| target_os = "vita" | ||
@@ -227,3 +225,2 @@ )))] | ||
| target_os = "horizon", | ||
| target_os = "redox", | ||
| target_os = "vita" | ||
@@ -251,3 +248,2 @@ )))] | ||
| target_os = "horizon", | ||
| target_os = "redox", | ||
| target_os = "vita" | ||
@@ -254,0 +250,0 @@ )))] |
@@ -37,2 +37,4 @@ //! powerpc Linux system calls. | ||
| lateout("cr0") _, | ||
| lateout("ctr") _, | ||
| lateout("xer") _, | ||
| options(nostack, preserves_flags, readonly) | ||
@@ -63,2 +65,4 @@ ); | ||
| lateout("cr0") _, | ||
| lateout("ctr") _, | ||
| lateout("xer") _, | ||
| options(nostack, preserves_flags) | ||
@@ -92,2 +96,4 @@ ); | ||
| lateout("cr0") _, | ||
| lateout("ctr") _, | ||
| lateout("xer") _, | ||
| options(nostack, preserves_flags, readonly) | ||
@@ -133,2 +139,4 @@ ); | ||
| lateout("cr0") _, | ||
| lateout("ctr") _, | ||
| lateout("xer") _, | ||
| options(nostack, preserves_flags) | ||
@@ -163,2 +171,4 @@ ); | ||
| lateout("cr0") _, | ||
| lateout("ctr") _, | ||
| lateout("xer") _, | ||
| options(nostack, preserves_flags, readonly) | ||
@@ -194,2 +204,4 @@ ); | ||
| lateout("cr0") _, | ||
| lateout("ctr") _, | ||
| lateout("xer") _, | ||
| options(nostack, preserves_flags) | ||
@@ -225,2 +237,4 @@ ); | ||
| lateout("cr0") _, | ||
| lateout("ctr") _, | ||
| lateout("xer") _, | ||
| options(nostack, preserves_flags, readonly) | ||
@@ -257,2 +271,4 @@ ); | ||
| lateout("cr0") _, | ||
| lateout("ctr") _, | ||
| lateout("xer") _, | ||
| options(nostack, preserves_flags) | ||
@@ -289,2 +305,4 @@ ); | ||
| lateout("cr0") _, | ||
| lateout("ctr") _, | ||
| lateout("xer") _, | ||
| options(nostack, preserves_flags, readonly) | ||
@@ -322,2 +340,4 @@ ); | ||
| lateout("cr0") _, | ||
| lateout("ctr") _, | ||
| lateout("xer") _, | ||
| options(nostack, preserves_flags) | ||
@@ -355,2 +375,4 @@ ); | ||
| lateout("cr0") _, | ||
| lateout("ctr") _, | ||
| lateout("xer") _, | ||
| options(nostack, preserves_flags, readonly) | ||
@@ -389,2 +411,4 @@ ); | ||
| lateout("cr0") _, | ||
| lateout("ctr") _, | ||
| lateout("xer") _, | ||
| options(nostack, preserves_flags) | ||
@@ -423,2 +447,4 @@ ); | ||
| lateout("cr0") _, | ||
| lateout("ctr") _, | ||
| lateout("xer") _, | ||
| options(nostack, preserves_flags, readonly) | ||
@@ -425,0 +451,0 @@ ); |
@@ -37,2 +37,4 @@ //! powerpc64le Linux system calls. | ||
| lateout("cr0") _, | ||
| lateout("ctr") _, | ||
| lateout("xer") _, | ||
| options(nostack, preserves_flags, readonly) | ||
@@ -63,2 +65,4 @@ ); | ||
| lateout("cr0") _, | ||
| lateout("ctr") _, | ||
| lateout("xer") _, | ||
| options(nostack, preserves_flags) | ||
@@ -92,2 +96,4 @@ ); | ||
| lateout("cr0") _, | ||
| lateout("ctr") _, | ||
| lateout("xer") _, | ||
| options(nostack, preserves_flags, readonly) | ||
@@ -133,2 +139,4 @@ ); | ||
| lateout("cr0") _, | ||
| lateout("ctr") _, | ||
| lateout("xer") _, | ||
| options(nostack, preserves_flags) | ||
@@ -163,2 +171,4 @@ ); | ||
| lateout("cr0") _, | ||
| lateout("ctr") _, | ||
| lateout("xer") _, | ||
| options(nostack, preserves_flags, readonly) | ||
@@ -194,2 +204,4 @@ ); | ||
| lateout("cr0") _, | ||
| lateout("ctr") _, | ||
| lateout("xer") _, | ||
| options(nostack, preserves_flags) | ||
@@ -225,2 +237,4 @@ ); | ||
| lateout("cr0") _, | ||
| lateout("ctr") _, | ||
| lateout("xer") _, | ||
| options(nostack, preserves_flags, readonly) | ||
@@ -257,2 +271,4 @@ ); | ||
| lateout("cr0") _, | ||
| lateout("ctr") _, | ||
| lateout("xer") _, | ||
| options(nostack, preserves_flags) | ||
@@ -289,2 +305,4 @@ ); | ||
| lateout("cr0") _, | ||
| lateout("ctr") _, | ||
| lateout("xer") _, | ||
| options(nostack, preserves_flags, readonly) | ||
@@ -322,2 +340,4 @@ ); | ||
| lateout("cr0") _, | ||
| lateout("ctr") _, | ||
| lateout("xer") _, | ||
| options(nostack, preserves_flags) | ||
@@ -355,2 +375,4 @@ ); | ||
| lateout("cr0") _, | ||
| lateout("ctr") _, | ||
| lateout("xer") _, | ||
| options(nostack, preserves_flags, readonly) | ||
@@ -389,2 +411,4 @@ ); | ||
| lateout("cr0") _, | ||
| lateout("ctr") _, | ||
| lateout("xer") _, | ||
| options(nostack, preserves_flags) | ||
@@ -423,2 +447,4 @@ ); | ||
| lateout("cr0") _, | ||
| lateout("ctr") _, | ||
| lateout("xer") _, | ||
| options(nostack, preserves_flags, readonly) | ||
@@ -425,0 +451,0 @@ ); |
@@ -53,2 +53,18 @@ use crate::fd::{AsFd, BorrowedFd, OwnedFd}; | ||
| /// Returns the file descriptor associated with the directory stream. | ||
| /// | ||
| /// The file descriptor is used internally by the directory stream. As a result, it is useful | ||
| /// only for functions which do not depend or alter the file position. | ||
| /// | ||
| /// # References | ||
| /// | ||
| /// - [POSIX] | ||
| /// | ||
| /// [POSIX]: https://pubs.opengroup.org/onlinepubs/9799919799/functions/dirfd.html | ||
| #[inline] | ||
| #[doc(alias = "dirfd")] | ||
| pub fn fd<'a>(&'a self) -> io::Result<BorrowedFd<'a>> { | ||
| Ok(self.fd.as_fd()) | ||
| } | ||
| /// Borrow `fd` and construct a `Dir` that reads entries from the given | ||
@@ -55,0 +71,0 @@ /// directory file descriptor. |
@@ -17,2 +17,6 @@ //! linux_raw syscalls supporting `rustix::fs`. | ||
| target_arch = "mips32r6", | ||
| all( | ||
| target_pointer_width = "32", | ||
| any(target_arch = "arm", target_arch = "powerpc"), | ||
| ) | ||
| ))] | ||
@@ -513,2 +517,6 @@ use crate::backend::conv::zero; | ||
| ret(syscall!(__NR_fstat, fd, &mut result))?; | ||
| #[cfg(sanitize_memory)] | ||
| crate::msan::unpoison_maybe_uninit(&result); | ||
| Ok(result.assume_init()) | ||
@@ -515,0 +523,0 @@ } |
@@ -32,3 +32,5 @@ //! linux_raw syscalls supporting `rustix::io_uring`. | ||
| ) -> io::Result<u32> { | ||
| ret_c_uint(syscall_readonly!( | ||
| // This is not `syscall_readonly` because when `opcode` is | ||
| // `IoringRegisterOp::RegisterRingFds`, `arg`'s pointee is mutated. | ||
| ret_c_uint(syscall!( | ||
| __NR_io_uring_register, | ||
@@ -50,3 +52,5 @@ fd, | ||
| ) -> io::Result<u32> { | ||
| ret_c_uint(syscall_readonly!( | ||
| // This is not `syscall_readonly` because when `opcode` is | ||
| // `IoringRegisterOp::RegisterRingFds`, `arg`'s pointee is mutated. | ||
| ret_c_uint(syscall!( | ||
| __NR_io_uring_register, | ||
@@ -53,0 +57,0 @@ fd, |
@@ -36,3 +36,10 @@ //! linux_raw syscalls supporting `rustix::io`. | ||
| pub(crate) unsafe fn read(fd: BorrowedFd<'_>, buf: (*mut u8, usize)) -> io::Result<usize> { | ||
| ret_usize(syscall!(__NR_read, fd, buf.0, pass_usize(buf.1))) | ||
| let r = ret_usize(syscall!(__NR_read, fd, buf.0, pass_usize(buf.1))); | ||
| #[cfg(sanitize_memory)] | ||
| if let Ok(len) = r { | ||
| crate::msan::unpoison(buf.0, len); | ||
| } | ||
| r | ||
| } | ||
@@ -56,13 +63,12 @@ | ||
| ))] | ||
| { | ||
| ret_usize(syscall!( | ||
| __NR_pread64, | ||
| fd, | ||
| buf.0, | ||
| pass_usize(buf.1), | ||
| zero(), | ||
| hi(pos), | ||
| lo(pos) | ||
| )) | ||
| } | ||
| let r = ret_usize(syscall!( | ||
| __NR_pread64, | ||
| fd, | ||
| buf.0, | ||
| pass_usize(buf.1), | ||
| zero(), | ||
| hi(pos), | ||
| lo(pos) | ||
| )); | ||
| #[cfg(all( | ||
@@ -77,14 +83,13 @@ target_pointer_width = "32", | ||
| ))] | ||
| { | ||
| ret_usize(syscall!( | ||
| __NR_pread64, | ||
| fd, | ||
| buf.0, | ||
| pass_usize(buf.1), | ||
| hi(pos), | ||
| lo(pos) | ||
| )) | ||
| } | ||
| let r = ret_usize(syscall!( | ||
| __NR_pread64, | ||
| fd, | ||
| buf.0, | ||
| pass_usize(buf.1), | ||
| hi(pos), | ||
| lo(pos) | ||
| )); | ||
| #[cfg(target_pointer_width = "64")] | ||
| ret_usize(syscall!( | ||
| let r = ret_usize(syscall!( | ||
| __NR_pread64, | ||
@@ -95,3 +100,10 @@ fd, | ||
| loff_t_from_u64(pos) | ||
| )) | ||
| )); | ||
| #[cfg(sanitize_memory)] | ||
| if let Ok(len) = r { | ||
| crate::msan::unpoison(buf.0, len); | ||
| } | ||
| r | ||
| } | ||
@@ -98,0 +110,0 @@ |
@@ -14,3 +14,10 @@ //! linux_raw syscalls supporting `rustix::rand`. | ||
| pub(crate) unsafe fn getrandom(buf: (*mut u8, usize), flags: GetRandomFlags) -> io::Result<usize> { | ||
| ret_usize(syscall!(__NR_getrandom, buf.0, pass_usize(buf.1), flags)) | ||
| let r = ret_usize(syscall!(__NR_getrandom, buf.0, pass_usize(buf.1), flags)); | ||
| #[cfg(sanitize_memory)] | ||
| if let Ok(len) = r { | ||
| crate::msan::unpoison(buf.0, len); | ||
| } | ||
| r | ||
| } |
+26
-3
@@ -39,4 +39,4 @@ /// A macro for [`CStr`] literals. | ||
| // constant-fold away. | ||
| assert!( | ||
| !$str.bytes().any(|b| b == b'\0'), | ||
| ::core::assert!( | ||
| !::core::iter::Iterator::any(&mut ::core::primitive::str::bytes($str), |b| b == b'\0'), | ||
| "cstr argument contains embedded NUL bytes", | ||
@@ -55,3 +55,5 @@ ); | ||
| unsafe { | ||
| $crate::ffi::CStr::from_bytes_with_nul_unchecked(concat!($str, "\0").as_bytes()) | ||
| $crate::ffi::CStr::from_bytes_with_nul_unchecked( | ||
| ::core::concat!($str, "\0").as_bytes(), | ||
| ) | ||
| } | ||
@@ -88,2 +90,23 @@ } | ||
| } | ||
| #[no_implicit_prelude] | ||
| mod hygiene { | ||
| #[allow(unused_macros)] | ||
| #[test] | ||
| fn macro_hygiene() { | ||
| macro_rules! assert { | ||
| ($($tt:tt)*) => { | ||
| ::core::panic!("cstr! called the wrong assert! macro"); | ||
| }; | ||
| } | ||
| macro_rules! concat { | ||
| ($($tt:tt)*) => {{ | ||
| let v: &str = ::core::panic!("cstr! called the wrong concat! macro"); | ||
| v | ||
| }}; | ||
| } | ||
| let _ = cstr!("foo"); | ||
| } | ||
| } | ||
| } |
+2
-2
@@ -18,3 +18,3 @@ //! POSIX-style filesystem functions which operate on bare paths. | ||
| use crate::fs::StatFs; | ||
| #[cfg(not(any(target_os = "haiku", target_os = "wasi")))] | ||
| #[cfg(not(any(target_os = "wasi")))] | ||
| use crate::fs::StatVfs; | ||
@@ -287,3 +287,3 @@ use crate::fs::{Mode, OFlags, Stat}; | ||
| /// [Linux]: https://man7.org/linux/man-pages/man2/statvfs.2.html | ||
| #[cfg(not(any(target_os = "haiku", target_os = "wasi")))] | ||
| #[cfg(not(any(target_os = "wasi")))] | ||
| #[inline] | ||
@@ -290,0 +290,0 @@ pub fn statvfs<P: path::Arg>(path: P) -> io::Result<StatVfs> { |
+0
-2
@@ -41,3 +41,2 @@ //! Filesystem operations. | ||
| target_os = "horizon", | ||
| target_os = "redox", | ||
| target_os = "vita", | ||
@@ -107,3 +106,2 @@ target_os = "wasi" | ||
| target_os = "horizon", | ||
| target_os = "redox", | ||
| target_os = "vita", | ||
@@ -110,0 +108,0 @@ target_os = "wasi" |
+14
-0
@@ -241,1 +241,15 @@ //! `RawDir` and `RawDirEntry`. | ||
| } | ||
| /// ```compile_fail | ||
| /// use rustix::fs::{CWD, Mode, OFlags, RawDir, openat}; | ||
| /// use std::mem::MaybeUninit; | ||
| /// | ||
| /// let mut buf = [MaybeUninit::uninit(); 47]; | ||
| /// let fd = openat(CWD, c".", OFlags::DIRECTORY, Mode::empty()).unwrap(); | ||
| /// let mut iter = RawDir::new(fd, &mut buf); | ||
| /// let item1 = iter.next().unwrap(); | ||
| /// let item2 = iter.next().unwrap(); | ||
| /// println!("{item2:?}"); | ||
| /// println!("{item1:?}"); | ||
| /// ``` | ||
| fn _doctest() {} |
+4
-4
@@ -21,3 +21,3 @@ //! Unsafe `ioctl` API. | ||
| #[cfg(any(linux_kernel, bsd))] | ||
| #[cfg(any(linux_kernel, bsd, target_os = "redox"))] | ||
| use core::mem; | ||
@@ -29,3 +29,3 @@ | ||
| #[cfg(linux_kernel)] | ||
| #[cfg(any(linux_kernel, target_os = "redox"))] | ||
| mod linux; | ||
@@ -36,3 +36,3 @@ | ||
| #[cfg(linux_kernel)] | ||
| #[cfg(any(linux_kernel, target_os = "redox"))] | ||
| use linux as platform; | ||
@@ -204,3 +204,3 @@ | ||
| /// recommended to use these functions to compute them. | ||
| #[cfg(any(linux_kernel, bsd))] | ||
| #[cfg(any(linux_kernel, bsd, target_os = "redox"))] | ||
| pub mod opcode { | ||
@@ -207,0 +207,0 @@ use super::*; |
+3
-2
@@ -181,2 +181,4 @@ //! `rustix` provides efficient memory-safe and [I/O-safe] wrappers to | ||
| pub(crate) mod bitcast; | ||
| #[cfg(sanitize_memory)] | ||
| pub(crate) mod msan; | ||
@@ -198,3 +200,2 @@ // linux_raw: Weak symbols are used by the use-libc-auxv feature for | ||
| #[cfg_attr(linux_raw, path = "backend/linux_raw/mod.rs")] | ||
| #[cfg_attr(wasi, path = "backend/wasi/mod.rs")] | ||
| mod backend; | ||
@@ -229,3 +230,3 @@ | ||
| pub mod io; | ||
| #[cfg(linux_kernel)] | ||
| #[cfg(all(linux_kernel, not(target_os = "android")))] | ||
| #[cfg(feature = "io_uring")] | ||
@@ -232,0 +233,0 @@ #[cfg_attr(docsrs, doc(cfg(feature = "io_uring")))] |
@@ -18,3 +18,2 @@ //! `recv`, `send`, and variants. | ||
| target_os = "horizon", | ||
| target_os = "redox", | ||
| target_os = "vita" | ||
@@ -28,3 +27,2 @@ )))] | ||
| target_os = "horizon", | ||
| target_os = "redox", | ||
| target_os = "vita" | ||
@@ -31,0 +29,0 @@ )))] |
@@ -71,3 +71,3 @@ //! [`recvmsg`], [`sendmsg`], and related functions. | ||
| $crate::net::__cmsg_space( | ||
| $len * ::core::mem::size_of::<u64>(), | ||
| $len * ::core::mem::size_of::<::core::primitive::u64>(), | ||
| ) | ||
@@ -105,3 +105,3 @@ }; | ||
| $crate::net::__cmsg_aligned_space( | ||
| $len * ::core::mem::size_of::<u64>(), | ||
| $len * ::core::mem::size_of::<::core::primitive::u64>(), | ||
| ) | ||
@@ -112,5 +112,5 @@ }; | ||
| ($firstid:ident($firstex:expr), $($restid:ident($restex:expr)),*) => {{ | ||
| let sum = cmsg_aligned_space!($firstid($firstex)); | ||
| let sum = $crate::cmsg_aligned_space!($firstid($firstex)); | ||
| $( | ||
| let sum = sum + cmsg_aligned_space!($restid($restex)); | ||
| let sum = sum + $crate::cmsg_aligned_space!($restid($restex)); | ||
| )* | ||
@@ -991,1 +991,40 @@ sum | ||
| } | ||
| #[cfg(test)] | ||
| mod tests { | ||
| #[no_implicit_prelude] | ||
| mod hygiene { | ||
| #[allow(unused_macros)] | ||
| #[test] | ||
| fn macro_hygiene() { | ||
| // This `u64` is `!Sized`, so `cmsg_space!` will fail if it tries to get its size with | ||
| // `size_of()`. | ||
| #[allow(dead_code, non_camel_case_types)] | ||
| struct u64([u8]); | ||
| // Ensure that when `cmsg*_space!` calls itself recursively, it really calls itself and | ||
| // not these macros. | ||
| macro_rules! cmsg_space { | ||
| ($($tt:tt)*) => {{ | ||
| let v: usize = ::core::panic!("Wrong cmsg_space! macro called"); | ||
| v | ||
| }}; | ||
| } | ||
| macro_rules! cmsg_aligned_space { | ||
| ($($tt:tt)*) => {{ | ||
| let v: usize = ::core::panic!("Wrong cmsg_aligned_space! macro called"); | ||
| v | ||
| }}; | ||
| } | ||
| crate::cmsg_space!(ScmRights(1)); | ||
| crate::cmsg_space!(TxTime(1)); | ||
| #[cfg(linux_kernel)] | ||
| { | ||
| crate::cmsg_space!(ScmCredentials(1)); | ||
| crate::cmsg_space!(ScmRights(1), ScmCredentials(1), TxTime(1)); | ||
| crate::cmsg_aligned_space!(ScmRights(1), ScmCredentials(1), TxTime(1)); | ||
| } | ||
| } | ||
| } | ||
| } |
@@ -1777,3 +1777,3 @@ //! `getsockopt` and `setsockopt` functions. | ||
| /// [Linux]: https://www.kernel.org/doc/html/next/networking/af_xdp.html | ||
| #[cfg(linux_raw_dep)] | ||
| #[cfg(all(linux_raw_dep, target_os = "linux"))] | ||
| #[doc(alias = "XDP_MMAP_OFFSETS")] | ||
@@ -1790,3 +1790,3 @@ pub fn xdp_mmap_offsets<Fd: AsFd>(fd: Fd) -> io::Result<XdpMmapOffsets> { | ||
| /// [Linux]: https://www.kernel.org/doc/html/next/networking/af_xdp.html#xdp-statistics-getsockopt | ||
| #[cfg(linux_raw_dep)] | ||
| #[cfg(all(linux_raw_dep, target_os = "linux"))] | ||
| #[doc(alias = "XDP_STATISTICS")] | ||
@@ -1793,0 +1793,0 @@ pub fn xdp_statistics<Fd: AsFd>(fd: Fd) -> io::Result<XdpStatistics> { |
@@ -300,3 +300,2 @@ //! Documentation about unimplemented functions. | ||
| not_implemented!(fanotify_mark); | ||
| not_implemented!(getifaddrs); | ||
| not_implemented!(signalfd); | ||
@@ -303,0 +302,0 @@ not_implemented!(mount_setattr); |
+47
-94
@@ -232,3 +232,2 @@ //! Convenient and efficient string argument passing. | ||
| #[cfg(feature = "std")] | ||
| #[cfg(any(not(target_os = "wasi"), not(target_env = "p2"), wasip2))] | ||
| impl Arg for &OsStr { | ||
@@ -247,5 +246,3 @@ #[inline] | ||
| fn as_cow_c_str(&self) -> io::Result<Cow<'_, CStr>> { | ||
| Ok(Cow::Owned( | ||
| CString::new(self.as_bytes()).map_err(|_cstr_err| io::Errno::INVAL)?, | ||
| )) | ||
| self.into_c_str() | ||
| } | ||
@@ -258,5 +255,6 @@ | ||
| { | ||
| Ok(Cow::Owned( | ||
| CString::new(self.as_bytes()).map_err(|_cstr_err| io::Errno::INVAL)?, | ||
| )) | ||
| #[cfg(all(target_os = "wasi", target_env = "p2", not(wasip2)))] | ||
| return self.to_str().ok_or(io::Errno::INVAL)?.into_c_str(); | ||
| #[cfg(any(wasip2, not(all(target_os = "wasi", target_env = "p2"))))] | ||
| return self.as_bytes().into_c_str(); | ||
| } | ||
@@ -270,3 +268,7 @@ | ||
| { | ||
| with_c_str(self.as_bytes(), f) | ||
| #[cfg(all(target_os = "wasi", target_env = "p2", not(wasip2)))] | ||
| return self.as_str()?.into_with_c_str(f); | ||
| #[cfg(any(wasip2, not(all(target_os = "wasi", target_env = "p2"))))] | ||
| return self.as_bytes().into_with_c_str(f); | ||
| } | ||
@@ -276,3 +278,2 @@ } | ||
| #[cfg(feature = "std")] | ||
| #[cfg(any(not(target_os = "wasi"), not(target_env = "p2"), wasip2))] | ||
| impl Arg for &OsString { | ||
@@ -291,6 +292,3 @@ #[inline] | ||
| fn as_cow_c_str(&self) -> io::Result<Cow<'_, CStr>> { | ||
| Ok(Cow::Owned( | ||
| CString::new(OsString::as_os_str(self).as_bytes()) | ||
| .map_err(|_cstr_err| io::Errno::INVAL)?, | ||
| )) | ||
| self.as_os_str().into_c_str() | ||
| } | ||
@@ -312,3 +310,3 @@ | ||
| { | ||
| with_c_str(self.as_bytes(), f) | ||
| self.as_os_str().into_with_c_str(f) | ||
| } | ||
@@ -318,3 +316,2 @@ } | ||
| #[cfg(feature = "std")] | ||
| #[cfg(any(not(target_os = "wasi"), not(target_env = "p2"), wasip2))] | ||
| impl Arg for OsString { | ||
@@ -333,5 +330,3 @@ #[inline] | ||
| fn as_cow_c_str(&self) -> io::Result<Cow<'_, CStr>> { | ||
| Ok(Cow::Owned( | ||
| CString::new(self.as_bytes()).map_err(|_cstr_err| io::Errno::INVAL)?, | ||
| )) | ||
| self.as_os_str().into_c_str() | ||
| } | ||
@@ -344,5 +339,9 @@ | ||
| { | ||
| Ok(Cow::Owned( | ||
| CString::new(self.into_vec()).map_err(|_cstr_err| io::Errno::INVAL)?, | ||
| )) | ||
| #[cfg(all(target_os = "wasi", target_env = "p2", not(wasip2)))] | ||
| return self | ||
| .into_string() | ||
| .map_err(|_strng_err| io::Errno::INVAL)? | ||
| .into_c_str(); | ||
| #[cfg(any(wasip2, not(all(target_os = "wasi", target_env = "p2"))))] | ||
| self.into_vec().into_c_str() | ||
| } | ||
@@ -356,3 +355,3 @@ | ||
| { | ||
| f(&CString::new(self.into_vec()).map_err(|_cstr_err| io::Errno::INVAL)?) | ||
| f(&self.into_c_str()?) | ||
| } | ||
@@ -362,3 +361,2 @@ } | ||
| #[cfg(feature = "std")] | ||
| #[cfg(any(not(target_os = "wasi"), not(target_env = "p2"), wasip2))] | ||
| impl Arg for &Path { | ||
@@ -377,5 +375,3 @@ #[inline] | ||
| fn as_cow_c_str(&self) -> io::Result<Cow<'_, CStr>> { | ||
| Ok(Cow::Owned( | ||
| CString::new(self.as_os_str().as_bytes()).map_err(|_cstr_err| io::Errno::INVAL)?, | ||
| )) | ||
| self.as_os_str().into_c_str() | ||
| } | ||
@@ -388,5 +384,3 @@ | ||
| { | ||
| Ok(Cow::Owned( | ||
| CString::new(self.as_os_str().as_bytes()).map_err(|_cstr_err| io::Errno::INVAL)?, | ||
| )) | ||
| self.as_os_str().into_c_str() | ||
| } | ||
@@ -400,3 +394,3 @@ | ||
| { | ||
| with_c_str(self.as_os_str().as_bytes(), f) | ||
| self.as_os_str().into_with_c_str(f) | ||
| } | ||
@@ -406,10 +400,6 @@ } | ||
| #[cfg(feature = "std")] | ||
| #[cfg(any(not(target_os = "wasi"), not(target_env = "p2"), wasip2))] | ||
| impl Arg for &PathBuf { | ||
| #[inline] | ||
| fn as_str(&self) -> io::Result<&str> { | ||
| PathBuf::as_path(self) | ||
| .as_os_str() | ||
| .to_str() | ||
| .ok_or(io::Errno::INVAL) | ||
| self.as_os_str().to_str().ok_or(io::Errno::INVAL) | ||
| } | ||
@@ -424,6 +414,3 @@ | ||
| fn as_cow_c_str(&self) -> io::Result<Cow<'_, CStr>> { | ||
| Ok(Cow::Owned( | ||
| CString::new(PathBuf::as_path(self).as_os_str().as_bytes()) | ||
| .map_err(|_cstr_err| io::Errno::INVAL)?, | ||
| )) | ||
| self.as_os_str().into_c_str() | ||
| } | ||
@@ -445,3 +432,3 @@ | ||
| { | ||
| with_c_str(self.as_os_str().as_bytes(), f) | ||
| self.as_os_str().into_with_c_str(f) | ||
| } | ||
@@ -451,3 +438,2 @@ } | ||
| #[cfg(feature = "std")] | ||
| #[cfg(any(not(target_os = "wasi"), not(target_env = "p2"), wasip2))] | ||
| impl Arg for PathBuf { | ||
@@ -466,5 +452,3 @@ #[inline] | ||
| fn as_cow_c_str(&self) -> io::Result<Cow<'_, CStr>> { | ||
| Ok(Cow::Owned( | ||
| CString::new(self.as_os_str().as_bytes()).map_err(|_cstr_err| io::Errno::INVAL)?, | ||
| )) | ||
| self.as_os_str().into_c_str() | ||
| } | ||
@@ -477,5 +461,3 @@ | ||
| { | ||
| Ok(Cow::Owned( | ||
| CString::new(self.into_os_string().into_vec()).map_err(|_cstr_err| io::Errno::INVAL)?, | ||
| )) | ||
| self.into_os_string().into_c_str() | ||
| } | ||
@@ -489,6 +471,3 @@ | ||
| { | ||
| f( | ||
| &CString::new(self.into_os_string().into_vec()) | ||
| .map_err(|_cstr_err| io::Errno::INVAL)?, | ||
| ) | ||
| self.into_os_string().into_with_c_str(f) | ||
| } | ||
@@ -538,3 +517,3 @@ } | ||
| fn as_str(&self) -> io::Result<&str> { | ||
| unimplemented!() | ||
| self.to_str().map_err(|_utf8_err| io::Errno::INVAL) | ||
| } | ||
@@ -544,3 +523,3 @@ | ||
| fn to_string_lossy(&self) -> Cow<'_, str> { | ||
| unimplemented!() | ||
| CStr::to_string_lossy(self) | ||
| } | ||
@@ -650,3 +629,2 @@ | ||
| #[cfg(feature = "std")] | ||
| #[cfg(any(not(target_os = "wasi"), not(target_env = "p2"), wasip2))] | ||
| impl<'a> Arg for Cow<'a, OsStr> { | ||
@@ -665,5 +643,3 @@ #[inline] | ||
| fn as_cow_c_str(&self) -> io::Result<Cow<'_, CStr>> { | ||
| Ok(Cow::Owned( | ||
| CString::new(self.as_bytes()).map_err(|_cstr_err| io::Errno::INVAL)?, | ||
| )) | ||
| (&**self).into_c_str() | ||
| } | ||
@@ -676,9 +652,6 @@ | ||
| { | ||
| Ok(Cow::Owned( | ||
| match self { | ||
| Cow::Owned(os) => CString::new(os.into_vec()), | ||
| Cow::Borrowed(os) => CString::new(os.as_bytes()), | ||
| } | ||
| .map_err(|_cstr_err| io::Errno::INVAL)?, | ||
| )) | ||
| match self { | ||
| Cow::Owned(os) => os.into_c_str(), | ||
| Cow::Borrowed(os) => os.into_c_str(), | ||
| } | ||
| } | ||
@@ -692,3 +665,3 @@ | ||
| { | ||
| with_c_str(self.as_bytes(), f) | ||
| (&*self).into_with_c_str(f) | ||
| } | ||
@@ -734,3 +707,2 @@ } | ||
| #[cfg(feature = "std")] | ||
| #[cfg(any(not(target_os = "wasi"), not(target_env = "p2"), wasip2))] | ||
| impl<'a> Arg for Component<'a> { | ||
@@ -749,5 +721,3 @@ #[inline] | ||
| fn as_cow_c_str(&self) -> io::Result<Cow<'_, CStr>> { | ||
| Ok(Cow::Owned( | ||
| CString::new(self.as_os_str().as_bytes()).map_err(|_cstr_err| io::Errno::INVAL)?, | ||
| )) | ||
| self.as_os_str().into_c_str() | ||
| } | ||
@@ -760,5 +730,3 @@ | ||
| { | ||
| Ok(Cow::Owned( | ||
| CString::new(self.as_os_str().as_bytes()).map_err(|_cstr_err| io::Errno::INVAL)?, | ||
| )) | ||
| self.as_os_str().into_c_str() | ||
| } | ||
@@ -772,3 +740,3 @@ | ||
| { | ||
| with_c_str(self.as_os_str().as_bytes(), f) | ||
| self.as_os_str().into_with_c_str(f) | ||
| } | ||
@@ -778,3 +746,2 @@ } | ||
| #[cfg(feature = "std")] | ||
| #[cfg(any(not(target_os = "wasi"), not(target_env = "p2"), wasip2))] | ||
| impl<'a> Arg for Components<'a> { | ||
@@ -793,6 +760,3 @@ #[inline] | ||
| fn as_cow_c_str(&self) -> io::Result<Cow<'_, CStr>> { | ||
| Ok(Cow::Owned( | ||
| CString::new(self.as_path().as_os_str().as_bytes()) | ||
| .map_err(|_cstr_err| io::Errno::INVAL)?, | ||
| )) | ||
| self.as_path().into_c_str() | ||
| } | ||
@@ -805,6 +769,3 @@ | ||
| { | ||
| Ok(Cow::Owned( | ||
| CString::new(self.as_path().as_os_str().as_bytes()) | ||
| .map_err(|_cstr_err| io::Errno::INVAL)?, | ||
| )) | ||
| self.as_path().into_c_str() | ||
| } | ||
@@ -818,3 +779,3 @@ | ||
| { | ||
| with_c_str(self.as_path().as_os_str().as_bytes(), f) | ||
| self.as_path().into_with_c_str(f) | ||
| } | ||
@@ -824,3 +785,2 @@ } | ||
| #[cfg(feature = "std")] | ||
| #[cfg(any(not(target_os = "wasi"), not(target_env = "p2"), wasip2))] | ||
| impl<'a> Arg for Iter<'a> { | ||
@@ -839,6 +799,3 @@ #[inline] | ||
| fn as_cow_c_str(&self) -> io::Result<Cow<'_, CStr>> { | ||
| Ok(Cow::Owned( | ||
| CString::new(self.as_path().as_os_str().as_bytes()) | ||
| .map_err(|_cstr_err| io::Errno::INVAL)?, | ||
| )) | ||
| self.as_path().into_c_str() | ||
| } | ||
@@ -851,6 +808,3 @@ | ||
| { | ||
| Ok(Cow::Owned( | ||
| CString::new(self.as_path().as_os_str().as_bytes()) | ||
| .map_err(|_cstr_err| io::Errno::INVAL)?, | ||
| )) | ||
| self.as_path().into_c_str() | ||
| } | ||
@@ -864,3 +818,3 @@ | ||
| { | ||
| with_c_str(self.as_path().as_os_str().as_bytes(), f) | ||
| self.as_path().into_with_c_str(f) | ||
| } | ||
@@ -953,3 +907,2 @@ } | ||
| #[cfg(feature = "alloc")] | ||
| #[cfg(any(not(target_os = "wasi"), not(target_env = "p2"), wasip2))] | ||
| impl Arg for Vec<u8> { | ||
@@ -956,0 +909,0 @@ #[inline] |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display