https://bugs.gentoo.org/893996 https://github.com/sunfishcode/io-lifetimes/commit/7836dafaeeb5ec172a309ac1e5a0a6e45c3592fc https://github.com/sunfishcode/io-lifetimes/commit/105d597e998bc986455e4d1dfe8e5a27aa72af60 https://github.com/sunfishcode/io-lifetimes/commit/8e001dd0e1eccca566860dbe9027007d2df25b0d https://github.com/sunfishcode/io-lifetimes/commit/2009f8286ea4fff31949bebfc26506420ded5222 diff --git a/vendor/io-lifetimes/.cargo-checksum.json b/vendor/io-lifetimes/.cargo-checksum.json index 4b5ed4f4a..9626c792b 100644 --- a/vendor/io-lifetimes/.cargo-checksum.json +++ b/vendor/io-lifetimes/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"CODE_OF_CONDUCT.md":"e0bd80144c93b032dadb144d7cf8663c55d697ba2dd60382715c981dfc60e421","COPYRIGHT":"495c30b45120f8af07cfa26eb9cb1ebfe8324560dca2b3b1e76cad1b9b6b489a","Cargo.toml":"708c0224b000c9eafe3b7b1d7b7ecf86df5b7197974ad8a4475dfe71490ca9f8","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-Apache-2.0_WITH_LLVM-exception":"268872b9816f90fd8e85db5a28d33f8150ebb8dd016653fb39ef1f94f2686bc5","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","ORG_CODE_OF_CONDUCT.md":"a62b69bf86e605ee1bcbb2f0a12ba79e4cebb6983a7b6491949750aecc4f2178","README.md":"408d5965c87cc338493f67f638adea97dbd415f4e12638be1365096afa2b8ba3","build.rs":"5809e0c02e95c4e7ddc57a07090b7ae2254cbe1aef493c9a2d720c58e4424556","src/example_ffi.rs":"c369438f2c44b21a5b977d303d6d0f3069a44d56d8ef770da06ddc3dcc967bdf","src/impls_async_std.rs":"62f73e42a2e76a9287f72f1c3db322114d4a08a2d8e2715c04156df60df1f876","src/impls_fs_err.rs":"12333298a291377a8c24835c60dfa3338e413e6435576cede04ce780da84ebe6","src/impls_mio.rs":"32ba71c1912d7dedcb110cb91dd953bab05a039d576c55a7508fcdad1bebbc2b","src/impls_os_pipe.rs":"5075498711f2dfdd6795d3afdb81bd3aca26c033d2f8f7238de59016d3ead0a9","src/impls_socket2.rs":"deacb4dd2c1e19ef483c937b6a18034397d729c3df361de5e748d70f5457f48b","src/impls_std.rs":"4e73f3993f539b7fa22db0b878eb8845d9ecf79f1580382619c83e18cf384fa3","src/impls_tokio.rs":"4f5f3dbdfa9395cd7e5149658cbd3872fa6c3973e1c844b7f6b48ee2e39e9197","src/lib.rs":"02affec86a96402d922c91f27a4dabde12d8dc485f647ae7a847ea12ed394358","src/portability.rs":"3e9929c7c04524d99a481c646f708f29cd5e251bf44dad7115ae381c2bcaab78","src/raw.rs":"2fa1ea37da1cc993e36ce7950b3e2bc635b3ac268dacd5b5520e5bfc84741b4a","src/traits.rs":"7419b21302b5a633dddf6765af706c5c09840a55e004d839f418fdb5f8826b2b","src/types.rs":"ca3729538bcfd3f63379fd1db4cb635b84cc1380d96ec5072403570de062df9c","src/views.rs":"ecc38c14b08566cc1667d530804a86124d90480e7fdecc585b0e4cfff7312807"},"package":"e394faa0efb47f9f227f1cd89978f854542b318a6f64fa695489c9c993056656"} \ No newline at end of file +{"files":{},"package":"e394faa0efb47f9f227f1cd89978f854542b318a6f64fa695489c9c993056656"} diff --git a/vendor/io-lifetimes/build.rs b/vendor/io-lifetimes/build.rs index fd3c6ccce..f20fe9343 100644 --- a/vendor/io-lifetimes/build.rs +++ b/vendor/io-lifetimes/build.rs @@ -33,70 +33,65 @@ fn use_feature(feature: &str) { /// Test whether the rustc at `var("RUSTC")` supports the given feature. fn has_feature(feature: &str) -> bool { + can_compile(&format!( + "#![allow(stable_features)]\n#![feature({})]", + feature + )) +} + +/// Test whether the rustc at `var("RUSTC")` can compile the given code. +fn can_compile>(test: T) -> bool { + use std::process::Stdio; + let out_dir = var("OUT_DIR").unwrap(); let rustc = var("RUSTC").unwrap(); let target = var("TARGET").unwrap(); - let mut child = std::process::Command::new(rustc) - .arg("--crate-type=rlib") // Don't require `main`. + let mut cmd = if let Ok(wrapper) = var("CARGO_RUSTC_WRAPPER") { + let mut cmd = std::process::Command::new(wrapper); + // The wrapper's first argument is supposed to be the path to rustc. + cmd.arg(rustc); + cmd + } else { + std::process::Command::new(rustc) + }; + + cmd.arg("--crate-type=rlib") // Don't require `main`. .arg("--emit=metadata") // Do as little as possible but still parse. .arg("--target") .arg(target) .arg("--out-dir") - .arg(out_dir) // Put the output somewhere inconsequential. + .arg(out_dir); // Put the output somewhere inconsequential. + + // If Cargo wants to set RUSTFLAGS, use that. + if let Ok(rustflags) = var("CARGO_ENCODED_RUSTFLAGS") { + if !rustflags.is_empty() { + for arg in rustflags.split('\x1f') { + cmd.arg(arg); + } + } + } + + let mut child = cmd .arg("-") // Read from stdin. - .stdin(std::process::Stdio::piped()) // Stdin is a pipe. + .stdin(Stdio::piped()) // Stdin is a pipe. + .stderr(Stdio::null()) // Errors from feature detection aren't interesting and can be confusing. .spawn() .unwrap(); - writeln!(child.stdin.take().unwrap(), "#![feature({})]", feature).unwrap(); + writeln!(child.stdin.take().unwrap(), "{}", test.as_ref()).unwrap(); child.wait().unwrap().success() } /// Test whether the rustc at `var("RUSTC")` supports panic in `const fn`. fn has_panic_in_const_fn() -> bool { - let out_dir = var("OUT_DIR").unwrap(); - let rustc = var("RUSTC").unwrap(); - let target = var("TARGET").unwrap(); - - let mut child = std::process::Command::new(rustc) - .arg("--crate-type=rlib") // Don't require `main`. - .arg("--emit=metadata") // Do as little as possible but still parse. - .arg("--target") - .arg(target) - .arg("--out-dir") - .arg(out_dir) // Put the output somewhere inconsequential. - .arg("-") // Read from stdin. - .stdin(std::process::Stdio::piped()) // Stdin is a pipe. - .spawn() - .unwrap(); - - writeln!(child.stdin.take().unwrap(), "const fn foo() {{ panic!() }}").unwrap(); - - child.wait().unwrap().success() + can_compile("const fn foo() {{ panic!() }}") } /// Test whether the rustc at `var("RUSTC")` supports the I/O safety feature. fn has_io_safety() -> bool { - let out_dir = var("OUT_DIR").unwrap(); - let rustc = var("RUSTC").unwrap(); - let target = var("TARGET").unwrap(); - - let mut child = std::process::Command::new(rustc) - .arg("--crate-type=rlib") // Don't require `main`. - .arg("--emit=metadata") // Do as little as possible but still parse. - .arg("--target") - .arg(target) - .arg("--out-dir") - .arg(out_dir) // Put the output somewhere inconsequential. - .arg("-") // Read from stdin. - .stdin(std::process::Stdio::piped()) // Stdin is a pipe. - .spawn() - .unwrap(); - - writeln!( - child.stdin.take().unwrap(), + can_compile( "\ #[cfg(unix)]\n\ use std::os::unix::io::OwnedFd as Owned;\n\ @@ -106,9 +101,6 @@ fn has_io_safety() -> bool { use std::os::windows::io::OwnedHandle as Owned;\n\ \n\ pub type Success = Owned;\n\ - " + ", ) - .unwrap(); - - child.wait().unwrap().success() } diff --git a/vendor/io-lifetimes/src/lib.rs b/vendor/io-lifetimes/src/lib.rs index da5e740cf..d77954133 100644 --- a/vendor/io-lifetimes/src/lib.rs +++ b/vendor/io-lifetimes/src/lib.rs @@ -30,6 +30,8 @@ #![deny(missing_docs)] // Work around https://github.com/rust-lang/rust/issues/103306. #![cfg_attr(all(wasi_ext, target_os = "wasi"), feature(wasi_ext))] +// Currently supported platforms. +#![cfg(any(unix, windows, target_os = "wasi"))] mod portability; mod traits; diff --git a/vendor/io-lifetimes-1.0.1/.cargo-checksum.json b/vendor/io-lifetimes-1.0.1/.cargo-checksum.json index 42357c5d7..a8b4d3782 100644 --- a/vendor/io-lifetimes-1.0.1/.cargo-checksum.json +++ b/vendor/io-lifetimes-1.0.1/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"CODE_OF_CONDUCT.md":"e0bd80144c93b032dadb144d7cf8663c55d697ba2dd60382715c981dfc60e421","COPYRIGHT":"495c30b45120f8af07cfa26eb9cb1ebfe8324560dca2b3b1e76cad1b9b6b489a","Cargo.toml":"0c3d3968a0c2542eb050f842464f8d5c096844cee32e85e3e01a2a2665ee004a","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-Apache-2.0_WITH_LLVM-exception":"268872b9816f90fd8e85db5a28d33f8150ebb8dd016653fb39ef1f94f2686bc5","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","ORG_CODE_OF_CONDUCT.md":"a62b69bf86e605ee1bcbb2f0a12ba79e4cebb6983a7b6491949750aecc4f2178","README.md":"60c80ea4adbc7b64d49993a04a78626248a38f112f08d6f5411897ab965c34e8","build.rs":"39750efcc504bf0e96aa2bb3ffe3a7bfc806adaf7f8279186eaa61649a68903d","src/example_ffi.rs":"ab0e14396608f5f30cd6a2782413c8661d99ff6dc671eb83a5cf72b9e868d408","src/impls_async_std.rs":"62f73e42a2e76a9287f72f1c3db322114d4a08a2d8e2715c04156df60df1f876","src/impls_fs_err.rs":"12333298a291377a8c24835c60dfa3338e413e6435576cede04ce780da84ebe6","src/impls_mio.rs":"32ba71c1912d7dedcb110cb91dd953bab05a039d576c55a7508fcdad1bebbc2b","src/impls_os_pipe.rs":"5075498711f2dfdd6795d3afdb81bd3aca26c033d2f8f7238de59016d3ead0a9","src/impls_socket2.rs":"deacb4dd2c1e19ef483c937b6a18034397d729c3df361de5e748d70f5457f48b","src/impls_std.rs":"4e73f3993f539b7fa22db0b878eb8845d9ecf79f1580382619c83e18cf384fa3","src/impls_tokio.rs":"4f5f3dbdfa9395cd7e5149658cbd3872fa6c3973e1c844b7f6b48ee2e39e9197","src/lib.rs":"f2e4e26a26e44656ef4b18b06f42017b431dc20020c6572d0dec1887908a8b76","src/portability.rs":"3e9929c7c04524d99a481c646f708f29cd5e251bf44dad7115ae381c2bcaab78","src/raw.rs":"2fa1ea37da1cc993e36ce7950b3e2bc635b3ac268dacd5b5520e5bfc84741b4a","src/traits.rs":"8216c2a3436b9fb48345f4e0e88e1d7367de8609f8970b84e0c2126530cfad71","src/types.rs":"0985f60c8f5e6b1c4851d7b9edb51da48f917ee29501b90a71680aa340f24b85","src/views.rs":"ecc38c14b08566cc1667d530804a86124d90480e7fdecc585b0e4cfff7312807"},"package":"a7d367024b3f3414d8e01f437f704f41a9f64ab36f9067fa73e526ad4c763c87"} \ No newline at end of file +{"files":{},"package":"a7d367024b3f3414d8e01f437f704f41a9f64ab36f9067fa73e526ad4c763c87"} diff --git a/vendor/io-lifetimes-1.0.1/README.md b/vendor/io-lifetimes-1.0.1/README.md index b8c92271f..deca3b275 100644 --- a/vendor/io-lifetimes-1.0.1/README.md +++ b/vendor/io-lifetimes-1.0.1/README.md @@ -20,9 +20,6 @@ This is associated with [RFC 3128], the I/O Safety RFC, which is now merged. Work is now underway to move the `OwnedFd` and `BorrowedFd` types and `AsFd` trait developed here into `std`. -Some features currently require nightly Rust, as they depend on `rustc_attrs` -to perform niche optimizations needed for FFI use cases. - For a quick taste, check out the code examples: - [hello], a basic demo of this API, doing low-level I/O manually, using the diff --git a/vendor/io-lifetimes-1.0.1/build.rs b/vendor/io-lifetimes-1.0.1/build.rs index 42c1eb80c..f20fe9343 100644 --- a/vendor/io-lifetimes-1.0.1/build.rs +++ b/vendor/io-lifetimes-1.0.1/build.rs @@ -4,13 +4,9 @@ use std::io::Write; fn main() { // I/O safety is stabilized in Rust 1.63. if has_io_safety() { - use_feature("io_lifetimes_use_std") + use_feature("io_safety_is_in_std") } - // Niche optimizations for `Borrowed*` and `Owned*` depend on `rustc_attrs` - // which, outside of `std`, are only available on nightly. - use_feature_or_nothing("rustc_attrs"); - // Work around // https://github.com/rust-lang/rust/issues/103306. use_feature_or_nothing("wasi_ext"); @@ -37,70 +33,65 @@ fn use_feature(feature: &str) { /// Test whether the rustc at `var("RUSTC")` supports the given feature. fn has_feature(feature: &str) -> bool { + can_compile(&format!( + "#![allow(stable_features)]\n#![feature({})]", + feature + )) +} + +/// Test whether the rustc at `var("RUSTC")` can compile the given code. +fn can_compile>(test: T) -> bool { + use std::process::Stdio; + let out_dir = var("OUT_DIR").unwrap(); let rustc = var("RUSTC").unwrap(); let target = var("TARGET").unwrap(); - let mut child = std::process::Command::new(rustc) - .arg("--crate-type=rlib") // Don't require `main`. + let mut cmd = if let Ok(wrapper) = var("CARGO_RUSTC_WRAPPER") { + let mut cmd = std::process::Command::new(wrapper); + // The wrapper's first argument is supposed to be the path to rustc. + cmd.arg(rustc); + cmd + } else { + std::process::Command::new(rustc) + }; + + cmd.arg("--crate-type=rlib") // Don't require `main`. .arg("--emit=metadata") // Do as little as possible but still parse. .arg("--target") .arg(target) .arg("--out-dir") - .arg(out_dir) // Put the output somewhere inconsequential. + .arg(out_dir); // Put the output somewhere inconsequential. + + // If Cargo wants to set RUSTFLAGS, use that. + if let Ok(rustflags) = var("CARGO_ENCODED_RUSTFLAGS") { + if !rustflags.is_empty() { + for arg in rustflags.split('\x1f') { + cmd.arg(arg); + } + } + } + + let mut child = cmd .arg("-") // Read from stdin. - .stdin(std::process::Stdio::piped()) // Stdin is a pipe. + .stdin(Stdio::piped()) // Stdin is a pipe. + .stderr(Stdio::null()) // Errors from feature detection aren't interesting and can be confusing. .spawn() .unwrap(); - writeln!(child.stdin.take().unwrap(), "#![feature({})]", feature).unwrap(); + writeln!(child.stdin.take().unwrap(), "{}", test.as_ref()).unwrap(); child.wait().unwrap().success() } /// Test whether the rustc at `var("RUSTC")` supports panic in `const fn`. fn has_panic_in_const_fn() -> bool { - let out_dir = var("OUT_DIR").unwrap(); - let rustc = var("RUSTC").unwrap(); - let target = var("TARGET").unwrap(); - - let mut child = std::process::Command::new(rustc) - .arg("--crate-type=rlib") // Don't require `main`. - .arg("--emit=metadata") // Do as little as possible but still parse. - .arg("--target") - .arg(target) - .arg("--out-dir") - .arg(out_dir) // Put the output somewhere inconsequential. - .arg("-") // Read from stdin. - .stdin(std::process::Stdio::piped()) // Stdin is a pipe. - .spawn() - .unwrap(); - - writeln!(child.stdin.take().unwrap(), "const fn foo() {{ panic!() }}").unwrap(); - - child.wait().unwrap().success() + can_compile("const fn foo() {{ panic!() }}") } /// Test whether the rustc at `var("RUSTC")` supports the I/O safety feature. fn has_io_safety() -> bool { - let out_dir = var("OUT_DIR").unwrap(); - let rustc = var("RUSTC").unwrap(); - let target = var("TARGET").unwrap(); - - let mut child = std::process::Command::new(rustc) - .arg("--crate-type=rlib") // Don't require `main`. - .arg("--emit=metadata") // Do as little as possible but still parse. - .arg("--target") - .arg(target) - .arg("--out-dir") - .arg(out_dir) // Put the output somewhere inconsequential. - .arg("-") // Read from stdin. - .stdin(std::process::Stdio::piped()) // Stdin is a pipe. - .spawn() - .unwrap(); - - writeln!( - child.stdin.take().unwrap(), + can_compile( "\ #[cfg(unix)]\n\ use std::os::unix::io::OwnedFd as Owned;\n\ @@ -110,9 +101,6 @@ fn has_io_safety() -> bool { use std::os::windows::io::OwnedHandle as Owned;\n\ \n\ pub type Success = Owned;\n\ - " + ", ) - .unwrap(); - - child.wait().unwrap().success() } diff --git a/vendor/io-lifetimes-1.0.1/src/example_ffi.rs b/vendor/io-lifetimes-1.0.1/src/example_ffi.rs index 8f7c238ba..0b31b9ec2 100644 --- a/vendor/io-lifetimes-1.0.1/src/example_ffi.rs +++ b/vendor/io-lifetimes-1.0.1/src/example_ffi.rs @@ -1,6 +1,6 @@ //! This is just a sample of what FFI using this crate can look like. -#![cfg_attr(not(rustc_attrs), allow(unused_imports))] +#![cfg_attr(not(io_safety_is_in_std), allow(unused_imports))] #![allow(missing_docs)] #[cfg(any(unix, target_os = "wasi"))] @@ -23,7 +23,7 @@ use { }; // Declare a few FFI functions ourselves, to show off the FFI ergonomics. -#[cfg(all(rustc_attrs, any(unix, target_os = "wasi")))] +#[cfg(all(io_safety_is_in_std, any(unix, target_os = "wasi")))] extern "C" { pub fn open(pathname: *const c_char, flags: c_int, ...) -> Option; } diff --git a/vendor/io-lifetimes-1.0.1/src/lib.rs b/vendor/io-lifetimes-1.0.1/src/lib.rs index af66ccd21..d77954133 100644 --- a/vendor/io-lifetimes-1.0.1/src/lib.rs +++ b/vendor/io-lifetimes-1.0.1/src/lib.rs @@ -28,22 +28,23 @@ //! [from+into conversions]: FromFilelike::from_into_filelike #![deny(missing_docs)] -#![cfg_attr(rustc_attrs, feature(rustc_attrs))] // Work around https://github.com/rust-lang/rust/issues/103306. #![cfg_attr(all(wasi_ext, target_os = "wasi"), feature(wasi_ext))] +// Currently supported platforms. +#![cfg(any(unix, windows, target_os = "wasi"))] mod portability; mod traits; -#[cfg(not(io_lifetimes_use_std))] +#[cfg(not(io_safety_is_in_std))] mod types; -#[cfg(not(io_lifetimes_use_std))] +#[cfg(not(io_safety_is_in_std))] mod impls_std; -#[cfg(not(io_lifetimes_use_std))] +#[cfg(not(io_safety_is_in_std))] #[cfg(any(unix, target_os = "wasi"))] pub use traits::AsFd; -#[cfg(not(io_lifetimes_use_std))] +#[cfg(not(io_safety_is_in_std))] #[cfg(windows)] pub use traits::{AsHandle, AsSocket}; #[cfg(any(unix, target_os = "wasi"))] @@ -53,23 +54,23 @@ pub use traits::{FromFd, IntoFd}; #[allow(deprecated)] pub use traits::{FromHandle, FromSocket, IntoHandle, IntoSocket}; -#[cfg(not(io_lifetimes_use_std))] +#[cfg(not(io_safety_is_in_std))] #[cfg(any(unix, target_os = "wasi"))] pub use types::{BorrowedFd, OwnedFd}; -#[cfg(not(io_lifetimes_use_std))] +#[cfg(not(io_safety_is_in_std))] #[cfg(windows)] pub use types::{ BorrowedHandle, BorrowedSocket, HandleOrInvalid, InvalidHandleError, NullHandleError, OwnedHandle, OwnedSocket, }; -#[cfg(io_lifetimes_use_std)] +#[cfg(io_safety_is_in_std)] #[cfg(unix)] pub use std::os::unix::io::{AsFd, BorrowedFd, OwnedFd}; -#[cfg(io_lifetimes_use_std)] +#[cfg(io_safety_is_in_std)] #[cfg(target_os = "wasi")] pub use std::os::wasi::io::{AsFd, BorrowedFd, OwnedFd}; -#[cfg(io_lifetimes_use_std)] +#[cfg(io_safety_is_in_std)] #[cfg(windows)] pub use std::os::windows::io::{ AsHandle, AsSocket, BorrowedHandle, BorrowedSocket, HandleOrInvalid, InvalidHandleError, @@ -87,7 +88,7 @@ pub use std::os::windows::io::{ // // So we define `FromFd`/`IntoFd` traits, and implement them in terms of // `From`/`Into`, -#[cfg(io_lifetimes_use_std)] +#[cfg(io_safety_is_in_std)] #[cfg(any(unix, target_os = "wasi"))] #[allow(deprecated)] impl> FromFd for T { @@ -96,7 +97,7 @@ impl> FromFd for T { owned_fd.into() } } -#[cfg(io_lifetimes_use_std)] +#[cfg(io_safety_is_in_std)] #[cfg(any(unix, target_os = "wasi"))] #[allow(deprecated)] impl IntoFd for T @@ -109,7 +110,7 @@ where } } -#[cfg(io_lifetimes_use_std)] +#[cfg(io_safety_is_in_std)] #[cfg(windows)] #[allow(deprecated)] impl> FromHandle for T { @@ -118,7 +119,7 @@ impl> FromHandle for T { owned_handle.into() } } -#[cfg(io_lifetimes_use_std)] +#[cfg(io_safety_is_in_std)] #[cfg(windows)] #[allow(deprecated)] impl IntoHandle for T @@ -131,7 +132,7 @@ where } } -#[cfg(io_lifetimes_use_std)] +#[cfg(io_safety_is_in_std)] #[cfg(windows)] #[allow(deprecated)] impl> FromSocket for T { @@ -140,7 +141,7 @@ impl> FromSocket for T { owned_socket.into() } } -#[cfg(io_lifetimes_use_std)] +#[cfg(io_safety_is_in_std)] #[cfg(windows)] #[allow(deprecated)] impl IntoSocket for T @@ -165,22 +166,22 @@ pub mod views; // Ideally, we'd want crates to implement our traits themselves. But for now, // while we're prototyping, we provide a few impls on foreign types. -#[cfg(not(io_lifetimes_use_std))] +#[cfg(not(io_safety_is_in_std))] #[cfg(feature = "async-std")] mod impls_async_std; -#[cfg(not(io_lifetimes_use_std))] +#[cfg(not(io_safety_is_in_std))] #[cfg(feature = "fs-err")] mod impls_fs_err; -#[cfg(not(io_lifetimes_use_std))] +#[cfg(not(io_safety_is_in_std))] #[cfg(feature = "mio")] mod impls_mio; #[cfg(not(target_os = "wasi"))] -#[cfg(not(io_lifetimes_use_std))] +#[cfg(not(io_safety_is_in_std))] #[cfg(feature = "os_pipe")] mod impls_os_pipe; -#[cfg(not(io_lifetimes_use_std))] +#[cfg(not(io_safety_is_in_std))] #[cfg(feature = "socket2")] mod impls_socket2; -#[cfg(not(io_lifetimes_use_std))] +#[cfg(not(io_safety_is_in_std))] #[cfg(feature = "tokio")] mod impls_tokio; diff --git a/vendor/io-lifetimes-1.0.1/src/traits.rs b/vendor/io-lifetimes-1.0.1/src/traits.rs index 5e80b755f..7fb9a5bdb 100644 --- a/vendor/io-lifetimes-1.0.1/src/traits.rs +++ b/vendor/io-lifetimes-1.0.1/src/traits.rs @@ -1,9 +1,9 @@ -#[cfg(not(io_lifetimes_use_std))] +#[cfg(not(io_safety_is_in_std))] #[cfg(any(unix, target_os = "wasi"))] use crate::BorrowedFd; #[cfg(any(unix, target_os = "wasi"))] use crate::OwnedFd; -#[cfg(not(io_lifetimes_use_std))] +#[cfg(not(io_safety_is_in_std))] #[cfg(windows)] use crate::{BorrowedHandle, BorrowedSocket}; #[cfg(windows)] @@ -14,7 +14,7 @@ use crate::{OwnedHandle, OwnedSocket}; /// This is only available on unix platforms and must be imported in order to /// call the method. Windows platforms have a corresponding `AsHandle` and /// `AsSocket` set of traits. -#[cfg(not(io_lifetimes_use_std))] +#[cfg(not(io_safety_is_in_std))] #[cfg(any(unix, target_os = "wasi"))] pub trait AsFd { /// Borrows the file descriptor. @@ -34,7 +34,7 @@ pub trait AsFd { } /// A trait to borrow the handle from an underlying object. -#[cfg(not(io_lifetimes_use_std))] +#[cfg(not(io_safety_is_in_std))] #[cfg(windows)] pub trait AsHandle { /// Borrows the handle. @@ -54,7 +54,7 @@ pub trait AsHandle { } /// A trait to borrow the socket from an underlying object. -#[cfg(not(io_lifetimes_use_std))] +#[cfg(not(io_safety_is_in_std))] #[cfg(windows)] pub trait AsSocket { /// Borrows the socket. @@ -235,7 +235,7 @@ pub trait FromSocket { } } -#[cfg(not(io_lifetimes_use_std))] +#[cfg(not(io_safety_is_in_std))] #[cfg(any(unix, target_os = "wasi"))] impl AsFd for &T { #[inline] @@ -244,7 +244,7 @@ impl AsFd for &T { } } -#[cfg(not(io_lifetimes_use_std))] +#[cfg(not(io_safety_is_in_std))] #[cfg(any(unix, target_os = "wasi"))] impl AsFd for &mut T { #[inline] @@ -253,7 +253,7 @@ impl AsFd for &mut T { } } -#[cfg(not(io_lifetimes_use_std))] +#[cfg(not(io_safety_is_in_std))] #[cfg(windows)] impl AsHandle for &T { #[inline] @@ -262,7 +262,7 @@ impl AsHandle for &T { } } -#[cfg(not(io_lifetimes_use_std))] +#[cfg(not(io_safety_is_in_std))] #[cfg(windows)] impl AsHandle for &mut T { #[inline] @@ -271,7 +271,7 @@ impl AsHandle for &mut T { } } -#[cfg(not(io_lifetimes_use_std))] +#[cfg(not(io_safety_is_in_std))] #[cfg(windows)] impl AsSocket for &T { #[inline] @@ -280,7 +280,7 @@ impl AsSocket for &T { } } -#[cfg(not(io_lifetimes_use_std))] +#[cfg(not(io_safety_is_in_std))] #[cfg(windows)] impl AsSocket for &mut T { #[inline] diff --git a/vendor/io-lifetimes-1.0.1/src/types.rs b/vendor/io-lifetimes-1.0.1/src/types.rs index 695ae513c..7f7809fb0 100644 --- a/vendor/io-lifetimes-1.0.1/src/types.rs +++ b/vendor/io-lifetimes-1.0.1/src/types.rs @@ -50,12 +50,6 @@ const INVALID_SOCKET: usize = !0 as _; #[cfg(any(unix, target_os = "wasi"))] #[derive(Copy, Clone)] #[repr(transparent)] -#[cfg_attr(rustc_attrs, rustc_nonnull_optimization_guaranteed)] -#[cfg_attr(rustc_attrs, rustc_layout_scalar_valid_range_start(0))] -// libstd/os/raw/mod.rs assures me that every libstd-supported platform has a -// 32-bit c_int. Below is -2, in two's complement, but that only works out -// because c_int is 32 bits. -#[cfg_attr(rustc_attrs, rustc_layout_scalar_valid_range_end(0xFF_FF_FF_FE))] pub struct BorrowedFd<'fd> { fd: RawFd, _phantom: PhantomData<&'fd OwnedFd>, @@ -105,17 +99,6 @@ pub struct BorrowedHandle<'handle> { #[cfg(windows)] #[derive(Copy, Clone)] #[repr(transparent)] -#[cfg_attr(rustc_attrs, rustc_nonnull_optimization_guaranteed)] -#[cfg_attr(rustc_attrs, rustc_layout_scalar_valid_range_start(0))] -// This is -2, in two's complement. -1 is `INVALID_SOCKET`. -#[cfg_attr( - all(rustc_attrs, target_pointer_width = "32"), - rustc_layout_scalar_valid_range_end(0xFF_FF_FF_FE) -)] -#[cfg_attr( - all(rustc_attrs, target_pointer_width = "64"), - rustc_layout_scalar_valid_range_end(0xFF_FF_FF_FF_FF_FF_FF_FE) -)] pub struct BorrowedSocket<'socket> { socket: RawSocket, _phantom: PhantomData<&'socket OwnedSocket>, @@ -131,12 +114,6 @@ pub struct BorrowedSocket<'socket> { /// has the value `-1`. #[cfg(any(unix, target_os = "wasi"))] #[repr(transparent)] -#[cfg_attr(rustc_attrs, rustc_nonnull_optimization_guaranteed)] -#[cfg_attr(rustc_attrs, rustc_layout_scalar_valid_range_start(0))] -// libstd/os/raw/mod.rs assures me that every libstd-supported platform has a -// 32-bit c_int. Below is -2, in two's complement, but that only works out -// because c_int is 32 bits. -#[cfg_attr(rustc_attrs, rustc_layout_scalar_valid_range_end(0xFF_FF_FF_FE))] pub struct OwnedFd { fd: RawFd, } @@ -286,17 +263,6 @@ impl BorrowedHandle<'_> { /// [`INVALID_SOCKET`]. #[cfg(windows)] #[repr(transparent)] -#[cfg_attr(rustc_attrs, rustc_nonnull_optimization_guaranteed)] -#[cfg_attr(rustc_attrs, rustc_layout_scalar_valid_range_start(0))] -// This is -2, in two's complement. -1 is `INVALID_SOCKET`. -#[cfg_attr( - all(rustc_attrs, target_pointer_width = "32"), - rustc_layout_scalar_valid_range_end(0xFF_FF_FF_FE) -)] -#[cfg_attr( - all(rustc_attrs, target_pointer_width = "64"), - rustc_layout_scalar_valid_range_end(0xFF_FF_FF_FF_FF_FF_FF_FE) -)] pub struct OwnedSocket { socket: RawSocket, }