Skip to content

Commit 94dd3a7

Browse files
authored
Fix some cfg guards (#7418)
All guards should actually refer to `wgpu_core` instead of `native` Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
1 parent 299079f commit 94dd3a7

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

wgpu/src/api/instance.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#[cfg(native)]
1+
#[cfg(wgpu_core)]
22
use alloc::vec::Vec;
33
use core::future::Future;
44

@@ -213,7 +213,7 @@ impl Instance {
213213
/// # Arguments
214214
///
215215
/// - `backends` - Backends from which to enumerate adapters.
216-
#[cfg(native)]
216+
#[cfg(wgpu_core)]
217217
pub fn enumerate_adapters(&self, backends: Backends) -> Vec<Adapter> {
218218
let Some(core_instance) = self.inner.as_core_opt() else {
219219
return Vec::new();

wgpu/src/backend/wgpu_core.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ impl ContextWgpuCore {
6161
Self(unsafe { Arc::new(wgc::global::Global::from_instance(core_instance)) })
6262
}
6363

64-
#[cfg(native)]
64+
#[cfg(wgpu_core)]
6565
pub fn enumerate_adapters(&self, backends: wgt::Backends) -> Vec<wgc::id::AdapterId> {
6666
self.0.enumerate_adapters(backends)
6767
}

wgpu/src/cmp.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ macro_rules! impl_eq_ord_hash_proxy {
6767
/// ```ignore
6868
/// impl_eq_ord_hash_arc_address!(MyType => .field);
6969
/// ```
70-
#[cfg_attr(not(wgpu_core), expect(unused_macros))]
70+
#[cfg_attr(not(any(wgpu_core, custom)), expect(unused_macros))]
7171
macro_rules! impl_eq_ord_hash_arc_address {
7272
($type:ty => $($access:tt)*) => {
7373
impl PartialEq for $type {
@@ -105,5 +105,5 @@ macro_rules! impl_eq_ord_hash_arc_address {
105105
};
106106
}
107107

108-
#[cfg_attr(not(wgpu_core), expect(unused_imports))]
108+
#[cfg_attr(not(any(wgpu_core, custom)), expect(unused_imports))]
109109
pub(crate) use {impl_eq_ord_hash_arc_address, impl_eq_ord_hash_proxy};

wgpu/src/util/init.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use crate::{Adapter, Instance, RequestAdapterOptions, Surface};
44
use crate::Backends;
55

66
/// Initialize the adapter obeying the `WGPU_ADAPTER_NAME` environment variable.
7-
#[cfg(native)]
7+
#[cfg(wgpu_core)]
88
pub fn initialize_adapter_from_env(
99
instance: &Instance,
1010
compatible_surface: Option<&Surface<'_>>,
@@ -36,7 +36,7 @@ pub fn initialize_adapter_from_env(
3636
}
3737

3838
/// Initialize the adapter obeying the `WGPU_ADAPTER_NAME` environment variable.
39-
#[cfg(not(native))]
39+
#[cfg(not(wgpu_core))]
4040
pub fn initialize_adapter_from_env(
4141
_instance: &Instance,
4242
_compatible_surface: Option<&Surface<'_>>,

0 commit comments

Comments
 (0)