Skip to content

Commit

Permalink
Keep unsafe code forbidden when puffin is disabled (#3603)
Browse files Browse the repository at this point in the history
This helps document what unsafe is being used for, and prevent other
uses from going unnoticed.
  • Loading branch information
YgorSouza authored Nov 22, 2023
1 parent 63e48dc commit 4ece25b
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion crates/egui/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,8 @@
#![allow(clippy::float_cmp)]
#![allow(clippy::manual_range_contains)]
#![deny(unsafe_code)]
#![cfg_attr(feature = "puffin", deny(unsafe_code))]
#![cfg_attr(not(feature = "puffin"), forbid(unsafe_code))]

mod animation_manager;
pub mod containers;
Expand Down
3 changes: 2 additions & 1 deletion crates/egui_demo_lib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
#![allow(clippy::float_cmp)]
#![allow(clippy::manual_range_contains)]
#![deny(unsafe_code)]
#![cfg_attr(feature = "puffin", deny(unsafe_code))]
#![cfg_attr(not(feature = "puffin"), forbid(unsafe_code))]

mod color_test;
mod demo;
Expand Down
3 changes: 2 additions & 1 deletion crates/egui_extras/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
#![allow(clippy::float_cmp)]
#![allow(clippy::manual_range_contains)]
#![deny(unsafe_code)]
#![cfg_attr(feature = "puffin", deny(unsafe_code))]
#![cfg_attr(not(feature = "puffin"), forbid(unsafe_code))]

#[cfg(feature = "chrono")]
mod datepicker;
Expand Down
3 changes: 2 additions & 1 deletion crates/emath/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
//!
#![allow(clippy::float_cmp)]
#![deny(unsafe_code)]
#![cfg_attr(feature = "puffin", deny(unsafe_code))]
#![cfg_attr(not(feature = "puffin"), forbid(unsafe_code))]

use std::ops::{Add, Div, Mul, RangeInclusive, Sub};

Expand Down
3 changes: 2 additions & 1 deletion crates/epaint/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
#![allow(clippy::float_cmp)]
#![allow(clippy::manual_range_contains)]
#![deny(unsafe_code)]
#![cfg_attr(feature = "puffin", deny(unsafe_code))]
#![cfg_attr(not(feature = "puffin"), forbid(unsafe_code))]

mod bezier;
pub mod image;
Expand Down

0 comments on commit 4ece25b

Please sign in to comment.