From bb1ea49f235b73dfa3ba8f6bd9b3c4d7faab2a27 Mon Sep 17 00:00:00 2001 From: Jay Oster Date: Sun, 22 Sep 2024 15:33:00 -0700 Subject: [PATCH] Forbid unsafe code - Made possible by `wgpu` 0.19: https://github.com/gfx-rs/wgpu/blob/trunk/CHANGELOG.md#safe--unified-surface-creation - Closes #238 --- examples/minimal-winit-android/src/lib.rs | 3 +++ internals/pixels-mocks/src/lib.rs | 1 + run-wasm/src/main.rs | 3 +++ src/lib.rs | 1 + 4 files changed, 8 insertions(+) diff --git a/examples/minimal-winit-android/src/lib.rs b/examples/minimal-winit-android/src/lib.rs index 6900841f..2471f6ba 100644 --- a/examples/minimal-winit-android/src/lib.rs +++ b/examples/minimal-winit-android/src/lib.rs @@ -1,3 +1,6 @@ +#![deny(clippy::all)] +#![forbid(unsafe_code)] + #[cfg(target_os = "android")] use winit::platform::android::activity::AndroidApp; diff --git a/internals/pixels-mocks/src/lib.rs b/internals/pixels-mocks/src/lib.rs index 169893ac..9e6fd43b 100644 --- a/internals/pixels-mocks/src/lib.rs +++ b/internals/pixels-mocks/src/lib.rs @@ -1,4 +1,5 @@ #![deny(clippy::all)] +#![forbid(unsafe_code)] pub struct Window; diff --git a/run-wasm/src/main.rs b/run-wasm/src/main.rs index ecda3267..d556e8e1 100644 --- a/run-wasm/src/main.rs +++ b/run-wasm/src/main.rs @@ -1,3 +1,6 @@ +#![deny(clippy::all)] +#![forbid(unsafe_code)] + fn main() { let css = r#"body { background-color: #000; diff --git a/src/lib.rs b/src/lib.rs index e45dff28..360970ac 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -30,6 +30,7 @@ //! `WGPU_ADAPTER_NAME` takes precedence. #![deny(clippy::all)] +#![forbid(unsafe_code)] pub use crate::builder::{check_texture_size, PixelsBuilder}; pub use crate::renderers::ScalingRenderer;