diff --git a/src/back/spv/layout.rs b/src/back/spv/layout.rs index 5db9a05caa..e4c3d1cc0d 100644 --- a/src/back/spv/layout.rs +++ b/src/back/spv/layout.rs @@ -53,12 +53,14 @@ impl Instruction { } } + #[allow(clippy::panic)] pub(super) fn set_type(&mut self, id: Word) { assert!(self.type_id.is_none(), "Type can only be set once"); self.type_id = Some(id); self.wc += 1; } + #[allow(clippy::panic)] pub(super) fn set_result(&mut self, id: Word) { assert!(self.result_id.is_none(), "Result can only be set once"); self.result_id = Some(id); diff --git a/src/front/glsl/mod.rs b/src/front/glsl/mod.rs index 40d3729115..2d2baeb122 100644 --- a/src/front/glsl/mod.rs +++ b/src/front/glsl/mod.rs @@ -1,3 +1,4 @@ +#![allow(clippy::panic)] use crate::{ Arena, ArraySize, BinaryOperator, Binding, BuiltIn, Constant, ConstantInner, EntryPoint, Expression, FastHashMap, Function, GlobalVariable, Handle, Header, LocalVariable, Module, diff --git a/src/front/glsl_new/parser.rs b/src/front/glsl_new/parser.rs index 194dca93d7..ee1c89b906 100644 --- a/src/front/glsl_new/parser.rs +++ b/src/front/glsl_new/parser.rs @@ -1,4 +1,5 @@ #![allow(unused_braces)] +#![allow(clippy::panic)] use pomelo::pomelo; pomelo! { diff --git a/src/front/spv.rs b/src/front/spv.rs index 91708f4114..a28d0cf5af 100644 --- a/src/front/spv.rs +++ b/src/front/spv.rs @@ -1062,7 +1062,10 @@ impl> Parser { fn make_expression_storage(&mut self) -> Arena { let mut expressions = Arena::new(); - assert!(self.lookup_expression.is_empty()); + #[allow(clippy::panic)] + { + assert!(self.lookup_expression.is_empty()); + } // register global variables for (&id, var) in self.lookup_variable.iter() { self.lookup_expression.insert( @@ -1161,7 +1164,10 @@ impl> Parser { let ty = module.types.get_mut(handle); match ty.inner { crate::TypeInner::Sampler { ref mut comparison } => { - assert!(!*comparison); + #[allow(clippy::panic)] + { + assert!(!*comparison) + }; *comparison = true; } crate::TypeInner::Image { diff --git a/src/lib.rs b/src/lib.rs index 2bfe6ceb6f..51f8984b54 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -5,6 +5,7 @@ //! To improve performance and reduce memory usage, most structures are stored //! in an [`Arena`], and can be retrieved using the corresponding [`Handle`]. #![allow(clippy::new_without_default)] +#![deny(clippy::panic)] mod arena; pub mod back;