From 8035543ce1bbf96bf682ae497855d96a3babee50 Mon Sep 17 00:00:00 2001 From: Marijn Suijten Date: Wed, 8 May 2024 04:42:36 +0200 Subject: [PATCH] Configure new `check-cfg` lint that `coverage` is an allowed option (#722) The lastest Rust nightly [adds checking for cfgs] and their possible values. This requires us to define via `build.rs` that `coverage` is a valid `cfg`, and that it is a "boolean" without any allowed values. [adds checking for cfgs]: https://blog.rust-lang.org/2024/05/06/check-cfg.html --- wayland-backend/build.rs | 2 ++ wayland-client/build.rs | 3 +++ 2 files changed, 5 insertions(+) create mode 100644 wayland-client/build.rs diff --git a/wayland-backend/build.rs b/wayland-backend/build.rs index 76fe07af047..877b9fcdbb9 100644 --- a/wayland-backend/build.rs +++ b/wayland-backend/build.rs @@ -1,4 +1,6 @@ fn main() { + println!("cargo:rustc-check-cfg=cfg(coverage)"); + if std::env::var("CARGO_FEATURE_LOG").ok().is_some() { // build the client shim cc::Build::new().file("src/sys/client_impl/log_shim.c").compile("log_shim_client"); diff --git a/wayland-client/build.rs b/wayland-client/build.rs new file mode 100644 index 00000000000..b7469d193cf --- /dev/null +++ b/wayland-client/build.rs @@ -0,0 +1,3 @@ +fn main() { + println!("cargo:rustc-check-cfg=cfg(coverage)"); +}