diff --git a/src/hyperlight_host/src/lib.rs b/src/hyperlight_host/src/lib.rs index 998bc9c9e..2c52729a5 100644 --- a/src/hyperlight_host/src/lib.rs +++ b/src/hyperlight_host/src/lib.rs @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#![deny(dead_code, missing_docs, unused_mut)] +#![warn(dead_code, missing_docs, unused_mut)] //! This crate contains an SDK that is used to execute specially- // compiled binaries within a very lightweight hypervisor environment. diff --git a/src/hyperlight_host/src/sandbox/hypervisor.rs b/src/hyperlight_host/src/sandbox/hypervisor.rs index 7cd1154ee..114083c78 100644 --- a/src/hyperlight_host/src/sandbox/hypervisor.rs +++ b/src/hyperlight_host/src/sandbox/hypervisor.rs @@ -77,3 +77,9 @@ pub(crate) enum HypervisorType { #[cfg(target_os = "windows")] Whp, } + +// Compiler error if no hypervisor type is available +#[cfg(not(any(kvm, mshv, target_os = "windows")))] +compile_error!( + "No hypervisor type is available for the current platform. Please enable either the `kvm` or `mshv` cargo feature." +);