diff --git a/egui/Cargo.toml b/egui/Cargo.toml index 0ee258a0..cfcda442 100644 --- a/egui/Cargo.toml +++ b/egui/Cargo.toml @@ -47,7 +47,7 @@ cint = ["epaint/cint"] persistence = ["serde", "epaint/persistence", "ron"] -# Only needed if you plan to use the same egui::Context from multiple threads. +# multi_threaded is only needed if you plan to use the same egui::Context from multiple threads. single_threaded = ["epaint/single_threaded"] multi_threaded = ["epaint/multi_threaded"] diff --git a/epaint/src/mutex.rs b/epaint/src/mutex.rs index ef23337f..dec4d86b 100644 --- a/epaint/src/mutex.rs +++ b/epaint/src/mutex.rs @@ -2,6 +2,9 @@ //! //! When the `single_threaded` feature is on the mutexes will panic when locked from different threads. +#[cfg(not(any(feature = "single_threaded", feature = "multi_threaded")))] +compile_error!("Either feature \"single_threaded\" or \"multi_threaded\" must be enabled."); + // ---------------------------------------------------------------------------- /// The lock you get from [`Mutex`].