From b7a39b9e3638ce74723f69568b1e01686303bafb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agust=C3=ADn=20Borgna?= <121866228+aborgna-q@users.noreply.github.com> Date: Mon, 29 Jul 2024 16:28:11 +0100 Subject: [PATCH] chore: Replace `build.rs` with lint config in Cargo.toml (#1354) Rust 1.80 [just dropped](https://blog.rust-lang.org/2024/07/25/Rust-1.80.0.html), adding a lint option that allows us to avoid the `build.rs` definition we had to add for https://github.com/CQCL/hugr/issues/1067. (The nightly lint got updated before hitting beta, so there shouldn't be compatibility problems there). ~~Depends on #1355~~ --- Cargo.toml | 3 ++- hugr-core/build.rs | 7 ------- 2 files changed, 2 insertions(+), 8 deletions(-) delete mode 100644 hugr-core/build.rs diff --git a/Cargo.toml b/Cargo.toml index 4dfe5654a..d3cf7c95b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,8 +14,9 @@ license = "Apache-2.0" # authors [workspace.lints.rust] -missing_docs = "warn" +unexpected_cfgs = { level = "warn", check-cfg = ['cfg(ci_run)'] } +missing_docs = "warn" [workspace.lints.clippy] # Unstable check, may cause false positives. # https://github.com/rust-lang/rust-clippy/issues/5112 diff --git a/hugr-core/build.rs b/hugr-core/build.rs deleted file mode 100644 index 385ec3d50..000000000 --- a/hugr-core/build.rs +++ /dev/null @@ -1,7 +0,0 @@ -//! Build script for the `hugr` crate. - -fn main() { - // We use a `ci_run` RUSTFLAG to indicate that we are running a CI check, - // so we can reject debug code using some tools defined in `utils.rs`. - println!("cargo:rustc-check-cfg=cfg(ci_run)"); -}