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>
This commit is contained in:
sagudev authored and GitHub committed 2025-03-25 08:25:59 -04:00
1 parent 299079fb69
commit 94dd3a7dc7
4 files changed
+7 -7

No files matched your search

+2 -2
View File
@@ -1,4 +1,4 @@
#[cfg(native)]
#[cfg(wgpu_core)]
use alloc::vec::Vec;
use core::future::Future;
@@ -213,7 +213,7 @@ impl Instance {
/// # Arguments
///
/// - `backends` - Backends from which to enumerate adapters.
#[cfg(native)]
#[cfg(wgpu_core)]
pub fn enumerate_adapters(&self, backends: Backends) -> Vec<Adapter> {
let Some(core_instance) = self.inner.as_core_opt() else {
return Vec::new();
+1 -1
View File
@@ -61,7 +61,7 @@ impl ContextWgpuCore {
Self(unsafe { Arc::new(wgc::global::Global::from_instance(core_instance)) })
}
#[cfg(native)]
#[cfg(wgpu_core)]
pub fn enumerate_adapters(&self, backends: wgt::Backends) -> Vec<wgc::id::AdapterId> {
self.0.enumerate_adapters(backends)
}
+2 -2
View File
@@ -67,7 +67,7 @@ macro_rules! impl_eq_ord_hash_proxy {
/// ```ignore
/// impl_eq_ord_hash_arc_address!(MyType => .field);
/// ```
#[cfg_attr(not(wgpu_core), expect(unused_macros))]
#[cfg_attr(not(any(wgpu_core, custom)), expect(unused_macros))]
macro_rules! impl_eq_ord_hash_arc_address {
($type:ty => $($access:tt)*) => {
impl PartialEq for $type {
@@ -105,5 +105,5 @@ macro_rules! impl_eq_ord_hash_arc_address {
};
}
#[cfg_attr(not(wgpu_core), expect(unused_imports))]
#[cfg_attr(not(any(wgpu_core, custom)), expect(unused_imports))]
pub(crate) use {impl_eq_ord_hash_arc_address, impl_eq_ord_hash_proxy};
+2 -2
View File
@@ -4,7 +4,7 @@ use crate::{Adapter, Instance, RequestAdapterOptions, Surface};
use crate::Backends;
/// Initialize the adapter obeying the `WGPU_ADAPTER_NAME` environment variable.
#[cfg(native)]
#[cfg(wgpu_core)]
pub fn initialize_adapter_from_env(
instance: &Instance,
compatible_surface: Option<&Surface<'_>>,
@@ -36,7 +36,7 @@ pub fn initialize_adapter_from_env(
}
/// Initialize the adapter obeying the `WGPU_ADAPTER_NAME` environment variable.
#[cfg(not(native))]
#[cfg(not(wgpu_core))]
pub fn initialize_adapter_from_env(
_instance: &Instance,
_compatible_surface: Option<&Surface<'_>>,