From 4e84867b3faaa84db89951b0311bb9696ebe63ca Mon Sep 17 00:00:00 2001 From: Kenny Kerr Date: Tue, 11 Jan 2022 09:28:50 -0800 Subject: [PATCH] Remove std feature (#1424) --- .github/workflows/build.yml | 2 +- crates/libs/bindgen/src/cfg.rs | 1 - crates/libs/bindgen/src/extensions/vector2.rs | 3 --- crates/libs/bindgen/src/extensions/vector3.rs | 3 --- crates/libs/bindgen/src/extensions/vector4.rs | 3 --- crates/libs/bindgen/src/replacements/pwstr.rs | 2 -- crates/libs/gen/src/async.rs | 1 - crates/libs/gen/src/pwstr.rs | 2 -- crates/libs/gen/src/vector2.rs | 3 --- crates/libs/gen/src/vector3.rs | 3 --- crates/libs/gen/src/vector4.rs | 3 --- crates/libs/windows/Cargo.toml | 1 - .../windows/src/Windows/Devices/Sms/mod.rs | 24 +++++++++---------- .../src/Windows/Foundation/Numerics/mod.rs | 9 ------- .../windows/src/Windows/Foundation/mod.rs | 16 ++++++------- .../Security/Authentication/OnlineId/mod.rs | 8 +++---- .../src/Windows/Storage/Streams/mod.rs | 8 +++---- .../src/Windows/Win32/Foundation/mod.rs | 2 -- crates/libs/windows/src/core/bindings.rs | 2 -- crates/libs/windows/src/core/error.rs | 2 -- crates/libs/windows/src/lib.rs | 1 - crates/tests/core/Cargo.toml | 2 +- crates/tests/legacy/pwstr/Cargo.toml | 2 +- crates/tests/legacy/winrt/Cargo.toml | 6 +---- crates/tests/win32/mshtml/Cargo.toml | 1 - crates/tests/winrt/async/Cargo.toml | 5 ++-- crates/tests/winrt/collections/Cargo.toml | 1 - crates/tools/api/src/main.rs | 1 - 28 files changed, 34 insertions(+), 83 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 33baacebd7..746a3687a7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -119,7 +119,7 @@ jobs: cargo_doc: name: Check cargo docs - runs-on: ubuntu-latest + runs-on: windows-latest steps: - name: Checkout uses: actions/checkout@v2 diff --git a/crates/libs/bindgen/src/cfg.rs b/crates/libs/bindgen/src/cfg.rs index 80875d684f..296d8a1066 100644 --- a/crates/libs/bindgen/src/cfg.rs +++ b/crates/libs/bindgen/src/cfg.rs @@ -23,7 +23,6 @@ impl Cfg { pub fn and_async(&self) -> Self { let mut combo = self.clone(); - combo.features.insert("std"); combo.features.insert("Windows.Foundation"); combo } diff --git a/crates/libs/bindgen/src/extensions/vector2.rs b/crates/libs/bindgen/src/extensions/vector2.rs index e1bd8f09cf..83507ea5c6 100644 --- a/crates/libs/bindgen/src/extensions/vector2.rs +++ b/crates/libs/bindgen/src/extensions/vector2.rs @@ -24,18 +24,15 @@ pub fn gen() -> TokenStream { pub fn length_squared(&self) -> f32 { self.dot(self) } - #[cfg(feature = "std")] pub fn length(&self) -> f32 { self.length_squared().sqrt() } - #[cfg(feature = "std")] pub fn distance(&self, value: &Self) -> f32 { (self - value).length() } pub fn distance_squared(&self, value: &Self) -> f32 { (self - value).length_squared() } - #[cfg(feature = "std")] pub fn normalize(&self) -> Self { self / self.length() } diff --git a/crates/libs/bindgen/src/extensions/vector3.rs b/crates/libs/bindgen/src/extensions/vector3.rs index 363ee048cb..85f09d99cf 100644 --- a/crates/libs/bindgen/src/extensions/vector3.rs +++ b/crates/libs/bindgen/src/extensions/vector3.rs @@ -47,18 +47,15 @@ pub fn gen() -> TokenStream { pub fn length_squared(&self) -> f32 { self.dot(self) } - #[cfg(feature = "std")] pub fn length(&self) -> f32 { self.length_squared().sqrt() } - #[cfg(feature = "std")] pub fn distance(&self, value: &Self) -> f32 { (self - value).length() } pub fn distance_squared(&self, value: &Self) -> f32 { (self - value).length_squared() } - #[cfg(feature = "std")] pub fn normalize(&self) -> Self { self / self.length() } diff --git a/crates/libs/bindgen/src/extensions/vector4.rs b/crates/libs/bindgen/src/extensions/vector4.rs index d004c2befa..7954a1ccee 100644 --- a/crates/libs/bindgen/src/extensions/vector4.rs +++ b/crates/libs/bindgen/src/extensions/vector4.rs @@ -60,18 +60,15 @@ pub fn gen() -> TokenStream { pub fn length_squared(&self) -> f32 { self.dot(self) } - #[cfg(feature = "std")] pub fn length(&self) -> f32 { self.length_squared().sqrt() } - #[cfg(feature = "std")] pub fn distance(&self, value: &Self) -> f32 { (self - value).length() } pub fn distance_squared(&self, value: &Self) -> f32 { (self - value).length_squared() } - #[cfg(feature = "std")] pub fn normalize(&self) -> Self { self / self.length() } diff --git a/crates/libs/bindgen/src/replacements/pwstr.rs b/crates/libs/bindgen/src/replacements/pwstr.rs index 9f6a2703f3..e526ad97f6 100644 --- a/crates/libs/bindgen/src/replacements/pwstr.rs +++ b/crates/libs/bindgen/src/replacements/pwstr.rs @@ -56,14 +56,12 @@ pub fn gen() -> TokenStream { ::windows::core::IntoParam::into_param(self.as_str()) } } - #[cfg(feature = "std")] impl<'a> ::windows::core::IntoParam<'a, PWSTR> for &::std::ffi::OsStr { fn into_param(self) -> ::windows::core::Param<'a, PWSTR> { use ::std::os::windows::ffi::OsStrExt; ::windows::core::Param::Boxed(PWSTR(::windows::core::alloc::boxed::Box::<[u16]>::into_raw(self.encode_wide().chain(::core::iter::once(0)).collect::<::windows::core::alloc::vec::Vec>().into_boxed_slice()) as _)) } } - #[cfg(feature = "std")] impl<'a> ::windows::core::IntoParam<'a, PWSTR> for ::std::ffi::OsString { fn into_param(self) -> ::windows::core::Param<'a, PWSTR> { ::windows::core::IntoParam::into_param(self.as_os_str()) diff --git a/crates/libs/gen/src/async.rs b/crates/libs/gen/src/async.rs index d8080f368a..4e4444c886 100644 --- a/crates/libs/gen/src/async.rs +++ b/crates/libs/gen/src/async.rs @@ -53,7 +53,6 @@ fn gen_async_kind(kind: AsyncKind, name: &TypeDef, self_name: &TypeDef, gen: &Ge }, quote! { #cfg - #[cfg(feature = "std")] impl<#constraints> ::std::future::Future for #name { type Output = ::windows::core::Result<#return_sig>; diff --git a/crates/libs/gen/src/pwstr.rs b/crates/libs/gen/src/pwstr.rs index 077876a422..abfdb72e3e 100644 --- a/crates/libs/gen/src/pwstr.rs +++ b/crates/libs/gen/src/pwstr.rs @@ -39,14 +39,12 @@ pub fn gen_pwstr() -> TokenStream { ::windows::core::IntoParam::into_param(self.as_str()) } } - #[cfg(feature = "std")] impl<'a> ::windows::core::IntoParam<'a, PWSTR> for &::std::ffi::OsStr { fn into_param(self) -> ::windows::core::Param<'a, PWSTR> { use ::std::os::windows::ffi::OsStrExt; ::windows::core::Param::Boxed(PWSTR(::windows::core::alloc::boxed::Box::<[u16]>::into_raw(self.encode_wide().chain(::core::iter::once(0)).collect::<::windows::core::alloc::vec::Vec>().into_boxed_slice()) as _)) } } - #[cfg(feature = "std")] impl<'a> ::windows::core::IntoParam<'a, PWSTR> for ::std::ffi::OsString { fn into_param(self) -> ::windows::core::Param<'a, PWSTR> { ::windows::core::IntoParam::into_param(self.as_os_str()) diff --git a/crates/libs/gen/src/vector2.rs b/crates/libs/gen/src/vector2.rs index 001491193c..bf02f88941 100644 --- a/crates/libs/gen/src/vector2.rs +++ b/crates/libs/gen/src/vector2.rs @@ -24,18 +24,15 @@ pub fn gen_vector2() -> TokenStream { pub fn length_squared(&self) -> f32 { self.dot(self) } - #[cfg(feature = "std")] pub fn length(&self) -> f32 { self.length_squared().sqrt() } - #[cfg(feature = "std")] pub fn distance(&self, value: &Self) -> f32 { (self - value).length() } pub fn distance_squared(&self, value: &Self) -> f32 { (self - value).length_squared() } - #[cfg(feature = "std")] pub fn normalize(&self) -> Self { self / self.length() } diff --git a/crates/libs/gen/src/vector3.rs b/crates/libs/gen/src/vector3.rs index 1ce8e5b1a5..a3ed0e6881 100644 --- a/crates/libs/gen/src/vector3.rs +++ b/crates/libs/gen/src/vector3.rs @@ -47,18 +47,15 @@ pub fn gen_vector3() -> TokenStream { pub fn length_squared(&self) -> f32 { self.dot(self) } - #[cfg(feature = "std")] pub fn length(&self) -> f32 { self.length_squared().sqrt() } - #[cfg(feature = "std")] pub fn distance(&self, value: &Self) -> f32 { (self - value).length() } pub fn distance_squared(&self, value: &Self) -> f32 { (self - value).length_squared() } - #[cfg(feature = "std")] pub fn normalize(&self) -> Self { self / self.length() } diff --git a/crates/libs/gen/src/vector4.rs b/crates/libs/gen/src/vector4.rs index b3cb7f9989..df452911ec 100644 --- a/crates/libs/gen/src/vector4.rs +++ b/crates/libs/gen/src/vector4.rs @@ -60,18 +60,15 @@ pub fn gen_vector4() -> TokenStream { pub fn length_squared(&self) -> f32 { self.dot(self) } - #[cfg(feature = "std")] pub fn length(&self) -> f32 { self.length_squared().sqrt() } - #[cfg(feature = "std")] pub fn distance(&self, value: &Self) -> f32 { (self - value).length() } pub fn distance_squared(&self, value: &Self) -> f32 { (self - value).length_squared() } - #[cfg(feature = "std")] pub fn normalize(&self) -> Self { self / self.length() } diff --git a/crates/libs/windows/Cargo.toml b/crates/libs/windows/Cargo.toml index b179653d26..e210b47928 100644 --- a/crates/libs/windows/Cargo.toml +++ b/crates/libs/windows/Cargo.toml @@ -52,7 +52,6 @@ windows_gen = { path = "../gen", version = "0.29.0", optional = true } [features] default = [] deprecated = [] -std = [] alloc = [] build = ["windows_gen", "windows_macros", "windows_reader"] AI = [] diff --git a/crates/libs/windows/src/Windows/Devices/Sms/mod.rs b/crates/libs/windows/src/Windows/Devices/Sms/mod.rs index 8e8078e5ae..b4cfa3dc65 100644 --- a/crates/libs/windows/src/Windows/Devices/Sms/mod.rs +++ b/crates/libs/windows/src/Windows/Devices/Sms/mod.rs @@ -133,7 +133,7 @@ unsafe impl ::windows::core::Interface for DeleteSmsMessageOperation { impl ::windows::core::RuntimeName for DeleteSmsMessageOperation { const NAME: &'static str = "Windows.Devices.Sms.DeleteSmsMessageOperation"; } -#[cfg(all(feature = "Foundation", feature = "deprecated", feature = "std"))] +#[cfg(all(feature = "Foundation", feature = "deprecated"))] impl DeleteSmsMessageOperation { pub fn get(&self) -> ::windows::core::Result<()> { if self.Status()? == super::super::Foundation::AsyncStatus::Started { @@ -148,7 +148,7 @@ impl DeleteSmsMessageOperation { self.GetResults() } } -#[cfg(all(feature = "Foundation", feature = "deprecated", feature = "std"))] +#[cfg(all(feature = "Foundation", feature = "deprecated"))] impl ::std::future::Future for DeleteSmsMessageOperation { type Output = ::windows::core::Result<()>; fn poll(self: ::std::pin::Pin<&mut Self>, context: &mut ::std::task::Context) -> ::std::task::Poll { @@ -364,7 +364,7 @@ unsafe impl ::windows::core::Interface for DeleteSmsMessagesOperation { impl ::windows::core::RuntimeName for DeleteSmsMessagesOperation { const NAME: &'static str = "Windows.Devices.Sms.DeleteSmsMessagesOperation"; } -#[cfg(all(feature = "Foundation", feature = "deprecated", feature = "std"))] +#[cfg(all(feature = "Foundation", feature = "deprecated"))] impl DeleteSmsMessagesOperation { pub fn get(&self) -> ::windows::core::Result<()> { if self.Status()? == super::super::Foundation::AsyncStatus::Started { @@ -379,7 +379,7 @@ impl DeleteSmsMessagesOperation { self.GetResults() } } -#[cfg(all(feature = "Foundation", feature = "deprecated", feature = "std"))] +#[cfg(all(feature = "Foundation", feature = "deprecated"))] impl ::std::future::Future for DeleteSmsMessagesOperation { type Output = ::windows::core::Result<()>; fn poll(self: ::std::pin::Pin<&mut Self>, context: &mut ::std::task::Context) -> ::std::task::Poll { @@ -598,7 +598,7 @@ unsafe impl ::windows::core::Interface for GetSmsDeviceOperation { impl ::windows::core::RuntimeName for GetSmsDeviceOperation { const NAME: &'static str = "Windows.Devices.Sms.GetSmsDeviceOperation"; } -#[cfg(all(feature = "Foundation", feature = "deprecated", feature = "std"))] +#[cfg(all(feature = "Foundation", feature = "deprecated"))] impl GetSmsDeviceOperation { pub fn get(&self) -> ::windows::core::Result { if self.Status()? == super::super::Foundation::AsyncStatus::Started { @@ -613,7 +613,7 @@ impl GetSmsDeviceOperation { self.GetResults() } } -#[cfg(all(feature = "Foundation", feature = "deprecated", feature = "std"))] +#[cfg(all(feature = "Foundation", feature = "deprecated"))] impl ::std::future::Future for GetSmsDeviceOperation { type Output = ::windows::core::Result; fn poll(self: ::std::pin::Pin<&mut Self>, context: &mut ::std::task::Context) -> ::std::task::Poll { @@ -832,7 +832,7 @@ unsafe impl ::windows::core::Interface for GetSmsMessageOperation { impl ::windows::core::RuntimeName for GetSmsMessageOperation { const NAME: &'static str = "Windows.Devices.Sms.GetSmsMessageOperation"; } -#[cfg(all(feature = "Foundation", feature = "deprecated", feature = "std"))] +#[cfg(all(feature = "Foundation", feature = "deprecated"))] impl GetSmsMessageOperation { pub fn get(&self) -> ::windows::core::Result { if self.Status()? == super::super::Foundation::AsyncStatus::Started { @@ -847,7 +847,7 @@ impl GetSmsMessageOperation { self.GetResults() } } -#[cfg(all(feature = "Foundation", feature = "deprecated", feature = "std"))] +#[cfg(all(feature = "Foundation", feature = "deprecated"))] impl ::std::future::Future for GetSmsMessageOperation { type Output = ::windows::core::Result; fn poll(self: ::std::pin::Pin<&mut Self>, context: &mut ::std::task::Context) -> ::std::task::Poll { @@ -1081,7 +1081,7 @@ unsafe impl ::windows::core::Interface for GetSmsMessagesOperation { impl ::windows::core::RuntimeName for GetSmsMessagesOperation { const NAME: &'static str = "Windows.Devices.Sms.GetSmsMessagesOperation"; } -#[cfg(all(feature = "Foundation", feature = "deprecated", feature = "std"))] +#[cfg(all(feature = "Foundation", feature = "deprecated"))] impl GetSmsMessagesOperation { pub fn get(&self) -> ::windows::core::Result> { if self.Status()? == super::super::Foundation::AsyncStatus::Started { @@ -1096,7 +1096,7 @@ impl GetSmsMessagesOperation { self.GetResults() } } -#[cfg(all(feature = "Foundation", feature = "deprecated", feature = "std"))] +#[cfg(all(feature = "Foundation", feature = "deprecated"))] impl ::std::future::Future for GetSmsMessagesOperation { type Output = ::windows::core::Result>; fn poll(self: ::std::pin::Pin<&mut Self>, context: &mut ::std::task::Context) -> ::std::task::Poll { @@ -2771,7 +2771,7 @@ unsafe impl ::windows::core::Interface for SendSmsMessageOperation { impl ::windows::core::RuntimeName for SendSmsMessageOperation { const NAME: &'static str = "Windows.Devices.Sms.SendSmsMessageOperation"; } -#[cfg(all(feature = "Foundation", feature = "deprecated", feature = "std"))] +#[cfg(all(feature = "Foundation", feature = "deprecated"))] impl SendSmsMessageOperation { pub fn get(&self) -> ::windows::core::Result<()> { if self.Status()? == super::super::Foundation::AsyncStatus::Started { @@ -2786,7 +2786,7 @@ impl SendSmsMessageOperation { self.GetResults() } } -#[cfg(all(feature = "Foundation", feature = "deprecated", feature = "std"))] +#[cfg(all(feature = "Foundation", feature = "deprecated"))] impl ::std::future::Future for SendSmsMessageOperation { type Output = ::windows::core::Result<()>; fn poll(self: ::std::pin::Pin<&mut Self>, context: &mut ::std::task::Context) -> ::std::task::Poll { diff --git a/crates/libs/windows/src/Windows/Foundation/Numerics/mod.rs b/crates/libs/windows/src/Windows/Foundation/Numerics/mod.rs index 832eb3ce16..0be05dad61 100644 --- a/crates/libs/windows/src/Windows/Foundation/Numerics/mod.rs +++ b/crates/libs/windows/src/Windows/Foundation/Numerics/mod.rs @@ -570,18 +570,15 @@ impl Vector2 { pub fn length_squared(&self) -> f32 { self.dot(self) } - #[cfg(feature = "std")] pub fn length(&self) -> f32 { self.length_squared().sqrt() } - #[cfg(feature = "std")] pub fn distance(&self, value: &Self) -> f32 { (self - value).length() } pub fn distance_squared(&self, value: &Self) -> f32 { (self - value).length_squared() } - #[cfg(feature = "std")] pub fn normalize(&self) -> Self { self / self.length() } @@ -787,18 +784,15 @@ impl Vector3 { pub fn length_squared(&self) -> f32 { self.dot(self) } - #[cfg(feature = "std")] pub fn length(&self) -> f32 { self.length_squared().sqrt() } - #[cfg(feature = "std")] pub fn distance(&self, value: &Self) -> f32 { (self - value).length() } pub fn distance_squared(&self, value: &Self) -> f32 { (self - value).length_squared() } - #[cfg(feature = "std")] pub fn normalize(&self) -> Self { self / self.length() } @@ -1008,18 +1002,15 @@ impl Vector4 { pub fn length_squared(&self) -> f32 { self.dot(self) } - #[cfg(feature = "std")] pub fn length(&self) -> f32 { self.length_squared().sqrt() } - #[cfg(feature = "std")] pub fn distance(&self, value: &Self) -> f32 { (self - value).length() } pub fn distance_squared(&self, value: &Self) -> f32 { (self - value).length_squared() } - #[cfg(feature = "std")] pub fn normalize(&self) -> Self { self / self.length() } diff --git a/crates/libs/windows/src/Windows/Foundation/mod.rs b/crates/libs/windows/src/Windows/Foundation/mod.rs index 696d7f8c28..5ff0d758f4 100644 --- a/crates/libs/windows/src/Windows/Foundation/mod.rs +++ b/crates/libs/windows/src/Windows/Foundation/mod.rs @@ -1088,7 +1088,7 @@ impl ::core::fmt::Debug for IAsyncAction { unsafe impl ::windows::core::RuntimeType for IAsyncAction { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"{5a648006-843a-4da9-865b-9d26e5dfad7b}"); } -#[cfg(all(feature = "Foundation", feature = "std"))] +#[cfg(feature = "Foundation")] impl IAsyncAction { pub fn get(&self) -> ::windows::core::Result<()> { if self.Status()? == AsyncStatus::Started { @@ -1103,7 +1103,7 @@ impl IAsyncAction { self.GetResults() } } -#[cfg(all(feature = "Foundation", feature = "std"))] +#[cfg(feature = "Foundation")] impl ::std::future::Future for IAsyncAction { type Output = ::windows::core::Result<()>; fn poll(self: ::std::pin::Pin<&mut Self>, context: &mut ::std::task::Context) -> ::std::task::Poll { @@ -1291,7 +1291,7 @@ impl ::core::fmt::Debug for I unsafe impl ::windows::core::RuntimeType for IAsyncActionWithProgress { const SIGNATURE: ::windows::core::ConstBuffer = { ::windows::core::ConstBuffer::new().push_slice(b"pinterface(").push_slice(b"{1f6db258-e803-48a1-9546-eb7353398884}").push_slice(b";").push_other(::SIGNATURE).push_slice(b")") }; } -#[cfg(all(feature = "Foundation", feature = "std"))] +#[cfg(feature = "Foundation")] impl IAsyncActionWithProgress { pub fn get(&self) -> ::windows::core::Result<()> { if self.Status()? == AsyncStatus::Started { @@ -1306,7 +1306,7 @@ impl IAsyncActionWithProgress self.GetResults() } } -#[cfg(all(feature = "Foundation", feature = "std"))] +#[cfg(feature = "Foundation")] impl ::std::future::Future for IAsyncActionWithProgress { type Output = ::windows::core::Result<()>; fn poll(self: ::std::pin::Pin<&mut Self>, context: &mut ::std::task::Context) -> ::std::task::Poll { @@ -1606,7 +1606,7 @@ impl ::core::fmt::Debug for IAs unsafe impl ::windows::core::RuntimeType for IAsyncOperation { const SIGNATURE: ::windows::core::ConstBuffer = { ::windows::core::ConstBuffer::new().push_slice(b"pinterface(").push_slice(b"{9fc2b0bb-e446-44e2-aa61-9cab8f636af2}").push_slice(b";").push_other(::SIGNATURE).push_slice(b")") }; } -#[cfg(all(feature = "Foundation", feature = "std"))] +#[cfg(feature = "Foundation")] impl IAsyncOperation { pub fn get(&self) -> ::windows::core::Result { if self.Status()? == AsyncStatus::Started { @@ -1621,7 +1621,7 @@ impl IAsyncOperation { self.GetResults() } } -#[cfg(all(feature = "Foundation", feature = "std"))] +#[cfg(feature = "Foundation")] impl ::std::future::Future for IAsyncOperation { type Output = ::windows::core::Result; fn poll(self: ::std::pin::Pin<&mut Self>, context: &mut ::std::task::Context) -> ::std::task::Poll { @@ -1816,7 +1816,7 @@ impl ::windows::core::RuntimeType for IAsyncOperationWithProgress { const SIGNATURE: ::windows::core::ConstBuffer = { ::windows::core::ConstBuffer::new().push_slice(b"pinterface(").push_slice(b"{b5d036d7-e297-498f-ba60-0289e76e23dd}").push_slice(b";").push_other(::SIGNATURE).push_slice(b";").push_other(::SIGNATURE).push_slice(b")") }; } -#[cfg(all(feature = "Foundation", feature = "std"))] +#[cfg(feature = "Foundation")] impl IAsyncOperationWithProgress { pub fn get(&self) -> ::windows::core::Result { if self.Status()? == AsyncStatus::Started { @@ -1831,7 +1831,7 @@ impl ::std::future::Future for IAsyncOperationWithProgress { type Output = ::windows::core::Result; fn poll(self: ::std::pin::Pin<&mut Self>, context: &mut ::std::task::Context) -> ::std::task::Poll { diff --git a/crates/libs/windows/src/Windows/Security/Authentication/OnlineId/mod.rs b/crates/libs/windows/src/Windows/Security/Authentication/OnlineId/mod.rs index b82419b549..69efab7749 100644 --- a/crates/libs/windows/src/Windows/Security/Authentication/OnlineId/mod.rs +++ b/crates/libs/windows/src/Windows/Security/Authentication/OnlineId/mod.rs @@ -1018,7 +1018,7 @@ unsafe impl ::windows::core::Interface for SignOutUserOperation { impl ::windows::core::RuntimeName for SignOutUserOperation { const NAME: &'static str = "Windows.Security.Authentication.OnlineId.SignOutUserOperation"; } -#[cfg(all(feature = "Foundation", feature = "std"))] +#[cfg(feature = "Foundation")] impl SignOutUserOperation { pub fn get(&self) -> ::windows::core::Result<()> { if self.Status()? == super::super::super::Foundation::AsyncStatus::Started { @@ -1033,7 +1033,7 @@ impl SignOutUserOperation { self.GetResults() } } -#[cfg(all(feature = "Foundation", feature = "std"))] +#[cfg(feature = "Foundation")] impl ::std::future::Future for SignOutUserOperation { type Output = ::windows::core::Result<()>; fn poll(self: ::std::pin::Pin<&mut Self>, context: &mut ::std::task::Context) -> ::std::task::Poll { @@ -1256,7 +1256,7 @@ unsafe impl ::windows::core::Interface for UserAuthenticationOperation { impl ::windows::core::RuntimeName for UserAuthenticationOperation { const NAME: &'static str = "Windows.Security.Authentication.OnlineId.UserAuthenticationOperation"; } -#[cfg(all(feature = "Foundation", feature = "std"))] +#[cfg(feature = "Foundation")] impl UserAuthenticationOperation { pub fn get(&self) -> ::windows::core::Result { if self.Status()? == super::super::super::Foundation::AsyncStatus::Started { @@ -1271,7 +1271,7 @@ impl UserAuthenticationOperation { self.GetResults() } } -#[cfg(all(feature = "Foundation", feature = "std"))] +#[cfg(feature = "Foundation")] impl ::std::future::Future for UserAuthenticationOperation { type Output = ::windows::core::Result; fn poll(self: ::std::pin::Pin<&mut Self>, context: &mut ::std::task::Context) -> ::std::task::Poll { diff --git a/crates/libs/windows/src/Windows/Storage/Streams/mod.rs b/crates/libs/windows/src/Windows/Storage/Streams/mod.rs index a6b786e27d..ace4bd7650 100644 --- a/crates/libs/windows/src/Windows/Storage/Streams/mod.rs +++ b/crates/libs/windows/src/Windows/Storage/Streams/mod.rs @@ -634,7 +634,7 @@ unsafe impl ::windows::core::Interface for DataReaderLoadOperation { impl ::windows::core::RuntimeName for DataReaderLoadOperation { const NAME: &'static str = "Windows.Storage.Streams.DataReaderLoadOperation"; } -#[cfg(all(feature = "Foundation", feature = "std"))] +#[cfg(feature = "Foundation")] impl DataReaderLoadOperation { pub fn get(&self) -> ::windows::core::Result { if self.Status()? == super::super::Foundation::AsyncStatus::Started { @@ -649,7 +649,7 @@ impl DataReaderLoadOperation { self.GetResults() } } -#[cfg(all(feature = "Foundation", feature = "std"))] +#[cfg(feature = "Foundation")] impl ::std::future::Future for DataReaderLoadOperation { type Output = ::windows::core::Result; fn poll(self: ::std::pin::Pin<&mut Self>, context: &mut ::std::task::Context) -> ::std::task::Poll { @@ -1184,7 +1184,7 @@ unsafe impl ::windows::core::Interface for DataWriterStoreOperation { impl ::windows::core::RuntimeName for DataWriterStoreOperation { const NAME: &'static str = "Windows.Storage.Streams.DataWriterStoreOperation"; } -#[cfg(all(feature = "Foundation", feature = "std"))] +#[cfg(feature = "Foundation")] impl DataWriterStoreOperation { pub fn get(&self) -> ::windows::core::Result { if self.Status()? == super::super::Foundation::AsyncStatus::Started { @@ -1199,7 +1199,7 @@ impl DataWriterStoreOperation { self.GetResults() } } -#[cfg(all(feature = "Foundation", feature = "std"))] +#[cfg(feature = "Foundation")] impl ::std::future::Future for DataWriterStoreOperation { type Output = ::windows::core::Result; fn poll(self: ::std::pin::Pin<&mut Self>, context: &mut ::std::task::Context) -> ::std::task::Poll { diff --git a/crates/libs/windows/src/Windows/Win32/Foundation/mod.rs b/crates/libs/windows/src/Windows/Win32/Foundation/mod.rs index f418c04403..6bd75768fb 100644 --- a/crates/libs/windows/src/Windows/Win32/Foundation/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/Foundation/mod.rs @@ -5869,14 +5869,12 @@ impl<'a> ::windows::core::IntoParam<'a, PWSTR> for ::windows::core::alloc::strin ::windows::core::IntoParam::into_param(self.as_str()) } } -#[cfg(feature = "std")] impl<'a> ::windows::core::IntoParam<'a, PWSTR> for &::std::ffi::OsStr { fn into_param(self) -> ::windows::core::Param<'a, PWSTR> { use std::os::windows::ffi::OsStrExt; ::windows::core::Param::Boxed(PWSTR(::windows::core::alloc::boxed::Box::<[u16]>::into_raw(self.encode_wide().chain(::core::iter::once(0)).collect::<::windows::core::alloc::vec::Vec>().into_boxed_slice()) as _)) } } -#[cfg(feature = "std")] impl<'a> ::windows::core::IntoParam<'a, PWSTR> for ::std::ffi::OsString { fn into_param(self) -> ::windows::core::Param<'a, PWSTR> { ::windows::core::IntoParam::into_param(self.as_os_str()) diff --git a/crates/libs/windows/src/core/bindings.rs b/crates/libs/windows/src/core/bindings.rs index d5a73f15a7..4bd61737dd 100644 --- a/crates/libs/windows/src/core/bindings.rs +++ b/crates/libs/windows/src/core/bindings.rs @@ -1532,14 +1532,12 @@ impl<'a> ::windows::core::IntoParam<'a, PWSTR> for ::windows::core::alloc::strin ::windows::core::IntoParam::into_param(self.as_str()) } } -#[cfg(feature = "std")] impl<'a> ::windows::core::IntoParam<'a, PWSTR> for &::std::ffi::OsStr { fn into_param(self) -> ::windows::core::Param<'a, PWSTR> { use std::os::windows::ffi::OsStrExt; ::windows::core::Param::Boxed(PWSTR(::windows::core::alloc::boxed::Box::<[u16]>::into_raw(self.encode_wide().chain(::core::iter::once(0)).collect::<::windows::core::alloc::vec::Vec>().into_boxed_slice()) as _)) } } -#[cfg(feature = "std")] impl<'a> ::windows::core::IntoParam<'a, PWSTR> for ::std::ffi::OsString { fn into_param(self) -> ::windows::core::Param<'a, PWSTR> { ::windows::core::IntoParam::into_param(self.as_os_str()) diff --git a/crates/libs/windows/src/core/error.rs b/crates/libs/windows/src/core/error.rs index 507467cdf4..df0d15d3e0 100644 --- a/crates/libs/windows/src/core/error.rs +++ b/crates/libs/windows/src/core/error.rs @@ -94,7 +94,6 @@ impl core::convert::From for HRESULT { } } -#[cfg(feature = "std")] impl core::convert::From for std::io::Error { fn from(from: Error) -> Self { Self::from_raw_os_error((from.code.0 & 0xFFFF) as _) @@ -144,7 +143,6 @@ impl core::fmt::Display for Error { } } -#[cfg(feature = "std")] impl std::error::Error for Error {} type RoOriginateError = extern "system" fn(code: HRESULT, message: core::mem::ManuallyDrop) -> BOOL; diff --git a/crates/libs/windows/src/lib.rs b/crates/libs/windows/src/lib.rs index 1d4dc87ed4..9e24f5d68a 100644 --- a/crates/libs/windows/src/lib.rs +++ b/crates/libs/windows/src/lib.rs @@ -2,7 +2,6 @@ Learn more about Rust for Windows here: */ -#![cfg_attr(all(not(test), not(feature = "std")), no_std)] #![doc(html_no_source)] extern crate self as windows; diff --git a/crates/tests/core/Cargo.toml b/crates/tests/core/Cargo.toml index e010719bb8..9a783d6a56 100644 --- a/crates/tests/core/Cargo.toml +++ b/crates/tests/core/Cargo.toml @@ -5,4 +5,4 @@ authors = ["Microsoft"] edition = "2018" [dependencies] -windows = { path = "../../libs/windows", features = ["std"] } +windows = { path = "../../libs/windows" } diff --git a/crates/tests/legacy/pwstr/Cargo.toml b/crates/tests/legacy/pwstr/Cargo.toml index 6a980c8866..bea693bec5 100644 --- a/crates/tests/legacy/pwstr/Cargo.toml +++ b/crates/tests/legacy/pwstr/Cargo.toml @@ -11,6 +11,6 @@ windows = { path = "../../../libs/windows", features = ["build", "alloc"] } windows = { path = "../../../libs/windows", features = ["build", "alloc"] } [features] -default = ["alloc", "std"] +default = ["alloc"] alloc = [] std = [] diff --git a/crates/tests/legacy/winrt/Cargo.toml b/crates/tests/legacy/winrt/Cargo.toml index ddff804006..05e0ad4c52 100644 --- a/crates/tests/legacy/winrt/Cargo.toml +++ b/crates/tests/legacy/winrt/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Microsoft"] edition = "2018" [dependencies] -windows = { path = "../../../libs/windows", features = ["std", "alloc"] } +windows = { path = "../../../libs/windows", features = ["alloc"] } gen = { package = "windows_gen", path = "../../../../crates/libs/gen" } reader = { package = "windows_reader", path = "../../../../crates/libs/reader" } @@ -15,7 +15,3 @@ helpers = { package = "test_helpers", path = "../helpers" } [build-dependencies] windows = { path = "../../../libs/windows", features = ["build"] } - -[features] -default = ["std"] -std = [] diff --git a/crates/tests/win32/mshtml/Cargo.toml b/crates/tests/win32/mshtml/Cargo.toml index 562d8f4ff8..a7b642dbfa 100644 --- a/crates/tests/win32/mshtml/Cargo.toml +++ b/crates/tests/win32/mshtml/Cargo.toml @@ -7,7 +7,6 @@ edition = "2018" [dependencies.windows] path = "../../../libs/windows" features = [ - "std", "Win32_Web_MsHtml", "Win32_Foundation", "Win32_System_Com", diff --git a/crates/tests/winrt/async/Cargo.toml b/crates/tests/winrt/async/Cargo.toml index d9aadfd9aa..bf241bbff4 100644 --- a/crates/tests/winrt/async/Cargo.toml +++ b/crates/tests/winrt/async/Cargo.toml @@ -7,7 +7,6 @@ edition = "2018" [dependencies.windows] path = "../../../libs/windows" features = [ - "std", "Foundation", ] @@ -18,6 +17,6 @@ windows = { path = "../../../libs/windows", features = ["build"] } futures = "0.3" [features] -default = ["alloc", "std"] +default = ["alloc"] alloc = [] -std = [] + diff --git a/crates/tests/winrt/collections/Cargo.toml b/crates/tests/winrt/collections/Cargo.toml index f9f60cb71d..3886817ed9 100644 --- a/crates/tests/winrt/collections/Cargo.toml +++ b/crates/tests/winrt/collections/Cargo.toml @@ -7,7 +7,6 @@ edition = "2018" [dependencies.windows] path = "../../../libs/windows" features = [ - "std", "alloc", "Foundation_Collections", ] diff --git a/crates/tools/api/src/main.rs b/crates/tools/api/src/main.rs index fed0d94ca0..924d19d273 100644 --- a/crates/tools/api/src/main.rs +++ b/crates/tools/api/src/main.rs @@ -76,7 +76,6 @@ windows_gen = { path = "../gen", version = "0.29.0", optional = true } [features] default = [] deprecated = [] -std = [] alloc = [] build = ["windows_gen", "windows_macros", "windows_reader"] "#