From d91e6d7e63bbb063d8e4a2c1256d0e4fa041078f Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Thu, 30 May 2024 04:35:07 -0400 Subject: [PATCH] Simplify docsrs feature usage - Don't instruct docs.rs to set it, it does so by default now: https://github.com/rust-lang/docs.rs/pull/2390 - Because of that, check-cfg also recognizes it and does not need extra configuration either. --- crates/ruma-client-api/Cargo.toml | 1 - crates/ruma-client-api/build.rs | 6 ------ crates/ruma-client/Cargo.toml | 1 - crates/ruma-client/build.rs | 2 -- crates/ruma-common/Cargo.toml | 1 - crates/ruma-common/build.rs | 6 ------ crates/ruma-events/Cargo.toml | 1 - crates/ruma-federation-api/Cargo.toml | 1 - crates/ruma-federation-api/build.rs | 6 ------ crates/ruma-html/Cargo.toml | 1 - crates/ruma-html/build.rs | 6 ------ crates/ruma-server-util/Cargo.toml | 1 - crates/ruma/Cargo.toml | 1 - crates/ruma/build.rs | 6 ------ 14 files changed, 40 deletions(-) delete mode 100644 crates/ruma-client-api/build.rs delete mode 100644 crates/ruma-common/build.rs delete mode 100644 crates/ruma-federation-api/build.rs delete mode 100644 crates/ruma-html/build.rs delete mode 100644 crates/ruma/build.rs diff --git a/crates/ruma-client-api/Cargo.toml b/crates/ruma-client-api/Cargo.toml index b1c74215..001ccb29 100644 --- a/crates/ruma-client-api/Cargo.toml +++ b/crates/ruma-client-api/Cargo.toml @@ -13,7 +13,6 @@ rust-version = { workspace = true } [package.metadata.docs.rs] all-features = true -rustdoc-args = ["--cfg", "docsrs"] [features] # OutgoingRequest and IncomingResponse implementations diff --git a/crates/ruma-client-api/build.rs b/crates/ruma-client-api/build.rs deleted file mode 100644 index a83086e1..00000000 --- a/crates/ruma-client-api/build.rs +++ /dev/null @@ -1,6 +0,0 @@ -fn main() { - // Prevent unnecessary rerunning of this build script - println!("cargo:rerun-if-changed=build.rs"); - // Prevent nightly CI from erroring on docsrs attributes - println!("cargo:rustc-check-cfg=cfg(docsrs)"); -} diff --git a/crates/ruma-client/Cargo.toml b/crates/ruma-client/Cargo.toml index ecdb0243..74358c9f 100644 --- a/crates/ruma-client/Cargo.toml +++ b/crates/ruma-client/Cargo.toml @@ -13,7 +13,6 @@ rust-version = { workspace = true } [package.metadata.docs.rs] all-features = true -rustdoc-args = ["--cfg", "docsrs"] [features] client-api = ["dep:as_variant", "dep:ruma-client-api"] diff --git a/crates/ruma-client/build.rs b/crates/ruma-client/build.rs index 0e176c4c..ef92bd6a 100644 --- a/crates/ruma-client/build.rs +++ b/crates/ruma-client/build.rs @@ -3,8 +3,6 @@ use std::{env, process}; fn main() { // Prevent unnecessary rerunning of this build script println!("cargo:rerun-if-changed=build.rs"); - // Prevent nightly CI from erroring on docsrs attributes - println!("cargo:rustc-check-cfg=cfg(docsrs)"); let tls_features = [ ("tls-native", env::var_os("CARGO_FEATURE_TLS_NATIVE").is_some()), diff --git a/crates/ruma-common/Cargo.toml b/crates/ruma-common/Cargo.toml index 4cfa68c6..5bfdd71f 100644 --- a/crates/ruma-common/Cargo.toml +++ b/crates/ruma-common/Cargo.toml @@ -12,7 +12,6 @@ rust-version = { workspace = true } [package.metadata.docs.rs] all-features = true -rustdoc-args = ["--cfg", "docsrs"] [features] # These feature gates exist only for the tests. Disabling them results in a diff --git a/crates/ruma-common/build.rs b/crates/ruma-common/build.rs deleted file mode 100644 index a83086e1..00000000 --- a/crates/ruma-common/build.rs +++ /dev/null @@ -1,6 +0,0 @@ -fn main() { - // Prevent unnecessary rerunning of this build script - println!("cargo:rerun-if-changed=build.rs"); - // Prevent nightly CI from erroring on docsrs attributes - println!("cargo:rustc-check-cfg=cfg(docsrs)"); -} diff --git a/crates/ruma-events/Cargo.toml b/crates/ruma-events/Cargo.toml index 80db0e0b..a8f13773 100644 --- a/crates/ruma-events/Cargo.toml +++ b/crates/ruma-events/Cargo.toml @@ -12,7 +12,6 @@ rust-version = { workspace = true } [package.metadata.docs.rs] all-features = true -rustdoc-args = ["--cfg", "docsrs"] [features] canonical-json = ["ruma-common/canonical-json"] diff --git a/crates/ruma-federation-api/Cargo.toml b/crates/ruma-federation-api/Cargo.toml index f0302736..7e225b92 100644 --- a/crates/ruma-federation-api/Cargo.toml +++ b/crates/ruma-federation-api/Cargo.toml @@ -13,7 +13,6 @@ rust-version = { workspace = true } [package.metadata.docs.rs] all-features = true -rustdoc-args = ["--cfg", "docsrs"] [features] # Allow some mandatory fields in requests / responses to be missing, defaulting diff --git a/crates/ruma-federation-api/build.rs b/crates/ruma-federation-api/build.rs deleted file mode 100644 index a83086e1..00000000 --- a/crates/ruma-federation-api/build.rs +++ /dev/null @@ -1,6 +0,0 @@ -fn main() { - // Prevent unnecessary rerunning of this build script - println!("cargo:rerun-if-changed=build.rs"); - // Prevent nightly CI from erroring on docsrs attributes - println!("cargo:rustc-check-cfg=cfg(docsrs)"); -} diff --git a/crates/ruma-html/Cargo.toml b/crates/ruma-html/Cargo.toml index b651069b..1883a5f8 100644 --- a/crates/ruma-html/Cargo.toml +++ b/crates/ruma-html/Cargo.toml @@ -12,7 +12,6 @@ rust-version = { workspace = true } [package.metadata.docs.rs] all-features = true -rustdoc-args = ["--cfg", "docsrs"] [features] matrix = ["dep:ruma-common"] diff --git a/crates/ruma-html/build.rs b/crates/ruma-html/build.rs deleted file mode 100644 index a83086e1..00000000 --- a/crates/ruma-html/build.rs +++ /dev/null @@ -1,6 +0,0 @@ -fn main() { - // Prevent unnecessary rerunning of this build script - println!("cargo:rerun-if-changed=build.rs"); - // Prevent nightly CI from erroring on docsrs attributes - println!("cargo:rustc-check-cfg=cfg(docsrs)"); -} diff --git a/crates/ruma-server-util/Cargo.toml b/crates/ruma-server-util/Cargo.toml index 4bf8e98c..e435a7fc 100644 --- a/crates/ruma-server-util/Cargo.toml +++ b/crates/ruma-server-util/Cargo.toml @@ -13,7 +13,6 @@ rust-version = { workspace = true } [package.metadata.docs.rs] all-features = true -rustdoc-args = ["--cfg", "docsrs"] [dependencies] headers = "0.4.0" diff --git a/crates/ruma/Cargo.toml b/crates/ruma/Cargo.toml index ded9dde3..2214fa8c 100644 --- a/crates/ruma/Cargo.toml +++ b/crates/ruma/Cargo.toml @@ -13,7 +13,6 @@ rust-version = { workspace = true } [package.metadata.docs.rs] all-features = true -rustdoc-args = ["--cfg", "docsrs"] [features] api = ["ruma-common/api"] diff --git a/crates/ruma/build.rs b/crates/ruma/build.rs deleted file mode 100644 index a83086e1..00000000 --- a/crates/ruma/build.rs +++ /dev/null @@ -1,6 +0,0 @@ -fn main() { - // Prevent unnecessary rerunning of this build script - println!("cargo:rerun-if-changed=build.rs"); - // Prevent nightly CI from erroring on docsrs attributes - println!("cargo:rustc-check-cfg=cfg(docsrs)"); -}