Skip to content

Commit

Permalink
chore: warn on clippy::allow_attributes under REPO_MSRV
Browse files Browse the repository at this point in the history
  • Loading branch information
ErichDonGubler committed Jan 9, 2025
1 parent 8a3142a commit cb586c7
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 15 deletions.
1 change: 1 addition & 0 deletions examples/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#![allow(clippy::arc_with_non_send_sync)] // False positive on wasm
#![warn(clippy::allow_attributes)]

pub mod framework;
pub mod utils;
Expand Down
2 changes: 1 addition & 1 deletion player/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! This is a player library for WebGPU traces.
#![cfg(not(target_arch = "wasm32"))]
#![warn(unsafe_op_in_unsafe_fn)]
#![warn(clippy::allow_attributes, unsafe_op_in_unsafe_fn)]

use wgc::device::trace;

Expand Down
2 changes: 1 addition & 1 deletion wgpu/src/api/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ impl Instance {
///
/// If no backend feature for the active target platform is enabled,
/// this method will panic, see [`Instance::enabled_backend_features()`].
#[allow(unreachable_code)]
#[allow(clippy::allow_attributes, unreachable_code)]
pub fn new(_instance_desc: &InstanceDescriptor) -> Self {
if Self::enabled_backend_features().is_empty() {
panic!(
Expand Down
1 change: 1 addition & 0 deletions wgpu/src/backend/webgpu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

mod defined_non_null_js_value;
mod ext_bindings;
#[allow(clippy::allow_attributes)]
mod webgpu_sys;

use js_sys::Promise;
Expand Down
24 changes: 12 additions & 12 deletions wgpu/src/dispatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ macro_rules! dispatch_types_inner {
impl $name {
#[cfg(wgpu_core)]
#[inline]
#[allow(unused)]
#[allow(clippy::allow_attributes, unused)]
pub fn as_core(&self) -> &<$wgpu_core_context as InterfaceTypes>::$subtype {
match self {
Self::Core(value) => value,
Expand All @@ -582,7 +582,7 @@ macro_rules! dispatch_types_inner {

#[cfg(wgpu_core)]
#[inline]
#[allow(unused)]
#[allow(clippy::allow_attributes, unused)]
pub fn as_core_opt(&self) -> Option<&<$wgpu_core_context as InterfaceTypes>::$subtype> {
match self {
Self::Core(value) => Some(value),
Expand All @@ -592,7 +592,7 @@ macro_rules! dispatch_types_inner {

#[cfg(webgpu)]
#[inline]
#[allow(unused)]
#[allow(clippy::allow_attributes, unused)]
pub fn as_webgpu(&self) -> &<$webgpu_context as InterfaceTypes>::$subtype {
match self {
Self::WebGPU(value) => value,
Expand All @@ -602,7 +602,7 @@ macro_rules! dispatch_types_inner {

#[cfg(webgpu)]
#[inline]
#[allow(unused)]
#[allow(clippy::allow_attributes, unused)]
pub fn as_webgpu_opt(&self) -> Option<&<$webgpu_context as InterfaceTypes>::$subtype> {
match self {
Self::WebGPU(value) => Some(value),
Expand Down Expand Up @@ -657,7 +657,7 @@ macro_rules! dispatch_types_inner {
impl $name {
#[cfg(wgpu_core)]
#[inline]
#[allow(unused)]
#[allow(clippy::allow_attributes, unused)]
pub fn as_core(&self) -> &<$wgpu_core_context as InterfaceTypes>::$subtype {
match self {
Self::Core(value) => value,
Expand All @@ -667,7 +667,7 @@ macro_rules! dispatch_types_inner {

#[cfg(wgpu_core)]
#[inline]
#[allow(unused)]
#[allow(clippy::allow_attributes, unused)]
pub fn as_core_mut(&mut self) -> &mut <$wgpu_core_context as InterfaceTypes>::$subtype {
match self {
Self::Core(value) => value,
Expand All @@ -677,7 +677,7 @@ macro_rules! dispatch_types_inner {

#[cfg(wgpu_core)]
#[inline]
#[allow(unused)]
#[allow(clippy::allow_attributes, unused)]
pub fn as_core_opt(&self) -> Option<&<$wgpu_core_context as InterfaceTypes>::$subtype> {
match self {
Self::Core(value) => Some(value),
Expand All @@ -687,7 +687,7 @@ macro_rules! dispatch_types_inner {

#[cfg(wgpu_core)]
#[inline]
#[allow(unused)]
#[allow(clippy::allow_attributes, unused)]
pub fn as_core_mut_opt(
&mut self,
) -> Option<&mut <$wgpu_core_context as InterfaceTypes>::$subtype> {
Expand All @@ -699,7 +699,7 @@ macro_rules! dispatch_types_inner {

#[cfg(webgpu)]
#[inline]
#[allow(unused)]
#[allow(clippy::allow_attributes, unused)]
pub fn as_webgpu(&self) -> &<$webgpu_context as InterfaceTypes>::$subtype {
match self {
Self::WebGPU(value) => value,
Expand All @@ -709,7 +709,7 @@ macro_rules! dispatch_types_inner {

#[cfg(webgpu)]
#[inline]
#[allow(unused)]
#[allow(clippy::allow_attributes, unused)]
pub fn as_webgpu_mut(&mut self) -> &mut <$webgpu_context as InterfaceTypes>::$subtype {
match self {
Self::WebGPU(value) => value,
Expand All @@ -719,7 +719,7 @@ macro_rules! dispatch_types_inner {

#[cfg(webgpu)]
#[inline]
#[allow(unused)]
#[allow(clippy::allow_attributes, unused)]
pub fn as_webgpu_opt(&self) -> Option<&<$webgpu_context as InterfaceTypes>::$subtype> {
match self {
Self::WebGPU(value) => Some(value),
Expand All @@ -729,7 +729,7 @@ macro_rules! dispatch_types_inner {

#[cfg(webgpu)]
#[inline]
#[allow(unused)]
#[allow(clippy::allow_attributes, unused)]
pub fn as_webgpu_mut_opt(
&mut self,
) -> Option<&mut <$webgpu_context as InterfaceTypes>::$subtype> {
Expand Down
7 changes: 6 additions & 1 deletion wgpu/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
#![doc(html_logo_url = "https://raw.githubusercontent.com/gfx-rs/wgpu/trunk/logo.png")]
#![warn(missing_docs, rust_2018_idioms, unsafe_op_in_unsafe_fn)]
#![warn(
clippy::allow_attributes,
missing_docs,
rust_2018_idioms,
unsafe_op_in_unsafe_fn
)]
#![allow(clippy::arc_with_non_send_sync)]

//
Expand Down

0 comments on commit cb586c7

Please sign in to comment.