From 0b0fb9ecabd08ed299dc1fb880dfd1f9d92c5b36 Mon Sep 17 00:00:00 2001 From: fqwert Date: Tue, 4 Jul 2023 19:22:48 +0800 Subject: [PATCH] add compile error message while features conflict Signed-off-by: fqwert --- ylong_runtime/src/lib.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ylong_runtime/src/lib.rs b/ylong_runtime/src/lib.rs index 5850a65..381d326 100644 --- a/ylong_runtime/src/lib.rs +++ b/ylong_runtime/src/lib.rs @@ -14,6 +14,15 @@ //! # ylong_runtime //! A runtime for writing IO-bounded and CPU-bounded applications. +#[cfg(all( + feature = "ffrt", + any(feature = "current_thread_runtime", feature = "multi_instance_runtime") +))] +compile_error!("Feature ffrt can not be enabled with feature current_thread_runtime or feature multi_instance_runtime"); + +#[cfg(all(feature = "ffrt", not(target_os = "linux")))] +compile_error!("Feature ffrt only works on linux currently"); + extern crate core; use crate::error::ScheduleError; -- Gitee