1521: Better compile error for not using resolver=2. r=kvark a=ElectronicRU

**Connections**
Usability fix proposed in #1517 with some re-wording to make the intent clearer.

**Description**
Provide a useful compile error in case a downstream project is using old Cargo resolver, instead of the deluge of obscure errors they get r/n if not on MacOS.

**Limitations**
On MacOS, vulkan feature is totally valid, so we cannot detect resolver=1 on Mac.


Co-authored-by: Alex S <alex0player@gmail.com>
This commit is contained in:
bors[bot] 2021-06-19 15:08:13 +00:00 committed by GitHub
commit a8be371acf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -45,8 +45,11 @@
clippy::pattern_type_mismatch, clippy::pattern_type_mismatch,
)] )]
#[cfg(all(feature = "metal", not(any(target_os = "macos", target_os = "ios"))))]
compile_error!("Metal backend enabled on non-Apple OS. If your project is not using resolver=\"2\" in Cargo.toml, it should.");
mod empty; mod empty;
#[cfg(feature = "metal")] #[cfg(all(feature = "metal", any(target_os = "macos", target_os = "ios")))]
mod metal; mod metal;
#[cfg(feature = "vulkan")] #[cfg(feature = "vulkan")]
mod vulkan; mod vulkan;