diff --git a/Cargo.toml b/Cargo.toml index 3924af1c14..6dc1dcbc27 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -134,3 +134,6 @@ zip = { version = "2.2.3", default-features = false, features = ["deflate"] } [workspace.lints.clippy] large_futures = "deny" + +[workspace.lints.rust] +unexpected_cfgs = { level = "warn", check-cfg = ['cfg(docsrs)'] } diff --git a/sdk/core/azure_core/Cargo.toml b/sdk/core/azure_core/Cargo.toml index f2a848730e..3b3b582249 100644 --- a/sdk/core/azure_core/Cargo.toml +++ b/sdk/core/azure_core/Cargo.toml @@ -60,6 +60,9 @@ tokio_process = ["dep:tokio", "tokio/process"] tokio_sleep = ["typespec_client_core/tokio_sleep"] xml = ["typespec_client_core/xml"] +[lints] +workspace = true + [package.metadata.docs.rs] features = [ "hmac_openssl", diff --git a/sdk/core/azure_core/src/lib.rs b/sdk/core/azure_core/src/lib.rs index 09d4e20686..786df127b2 100644 --- a/sdk/core/azure_core/src/lib.rs +++ b/sdk/core/azure_core/src/lib.rs @@ -3,8 +3,8 @@ #![forbid(unsafe_code)] #![deny(missing_debug_implementations, nonstandard_style)] -// #![warn(missing_docs, future_incompatible, unreachable_pub)] #![doc = include_str!("../README.md")] +#![cfg_attr(docsrs, feature(doc_auto_cfg))] #[macro_use] mod macros; diff --git a/sdk/core/azure_core_amqp/Cargo.toml b/sdk/core/azure_core_amqp/Cargo.toml index 9c6f1371bd..04005dae87 100644 --- a/sdk/core/azure_core_amqp/Cargo.toml +++ b/sdk/core/azure_core_amqp/Cargo.toml @@ -47,5 +47,8 @@ fe2o3_amqp = [ "serde_bytes", ] +[lints] +workspace = true + [package.metadata.docs.rs] features = ["fe2o3_amqp"] diff --git a/sdk/core/azure_core_amqp/src/lib.rs b/sdk/core/azure_core_amqp/src/lib.rs index ea9ca28f1d..b3fe6162a0 100644 --- a/sdk/core/azure_core_amqp/src/lib.rs +++ b/sdk/core/azure_core_amqp/src/lib.rs @@ -2,6 +2,7 @@ // Licensed under the MIT License. #![doc = include_str!("../README.md")] +#![cfg_attr(docsrs, feature(doc_auto_cfg))] #[cfg(all(feature = "fe2o3_amqp", not(target_arch = "wasm32")))] mod fe2o3; diff --git a/sdk/eventhubs/azure_messaging_eventhubs/Cargo.toml b/sdk/eventhubs/azure_messaging_eventhubs/Cargo.toml index 809d7bbabb..6c1309478f 100644 --- a/sdk/eventhubs/azure_messaging_eventhubs/Cargo.toml +++ b/sdk/eventhubs/azure_messaging_eventhubs/Cargo.toml @@ -34,3 +34,6 @@ azure_core_test.workspace = true azure_identity.workspace = true tokio = { workspace = true, features = ["rt-multi-thread", "macros", "time"] } tracing-subscriber = { workspace = true, features = ["env-filter", "fmt"] } + +[lints] +workspace = true diff --git a/sdk/eventhubs/azure_messaging_eventhubs/src/lib.rs b/sdk/eventhubs/azure_messaging_eventhubs/src/lib.rs index a76c003485..512803b380 100644 --- a/sdk/eventhubs/azure_messaging_eventhubs/src/lib.rs +++ b/sdk/eventhubs/azure_messaging_eventhubs/src/lib.rs @@ -4,6 +4,7 @@ #![recursion_limit = "128"] #![warn(missing_docs)] #![doc = include_str!("../README.md")] +#![cfg_attr(docsrs, feature(doc_auto_cfg))] pub(crate) mod common; diff --git a/sdk/identity/azure_identity/Cargo.toml b/sdk/identity/azure_identity/Cargo.toml index db7b318bb5..bc08759177 100644 --- a/sdk/identity/azure_identity/Cargo.toml +++ b/sdk/identity/azure_identity/Cargo.toml @@ -53,6 +53,9 @@ client_certificate = ["openssl"] # https://github.com/Azure/azure-cli/issues/19700 old_azure_cli = ["time/local-offset", "tz-rs"] +[lints] +workspace = true + [package.metadata.docs.rs] features = [ "client_certificate", diff --git a/sdk/identity/azure_identity/src/lib.rs b/sdk/identity/azure_identity/src/lib.rs index 090f7ae80d..dbfac517cf 100644 --- a/sdk/identity/azure_identity/src/lib.rs +++ b/sdk/identity/azure_identity/src/lib.rs @@ -2,6 +2,7 @@ // Licensed under the MIT License. #![doc = include_str!("../README.md")] +#![cfg_attr(docsrs, feature(doc_auto_cfg))] mod authorization_code_flow; mod azure_pipelines_credential; diff --git a/sdk/typespec/Cargo.toml b/sdk/typespec/Cargo.toml index 548f51b23a..12642adbf5 100644 --- a/sdk/typespec/Cargo.toml +++ b/sdk/typespec/Cargo.toml @@ -25,3 +25,6 @@ default = ["http", "json"] http = [] json = ["dep:serde", "dep:serde_json"] amqp = [] + +[lints] +workspace = true diff --git a/sdk/typespec/src/lib.rs b/sdk/typespec/src/lib.rs index 5d72018a91..fba4c2f81a 100644 --- a/sdk/typespec/src/lib.rs +++ b/sdk/typespec/src/lib.rs @@ -2,6 +2,7 @@ // Licensed under the MIT License. #![doc = include_str!("../README.md")] +#![cfg_attr(docsrs, feature(doc_auto_cfg))] pub mod error; #[cfg(feature = "http")] diff --git a/sdk/typespec/typespec_client_core/Cargo.toml b/sdk/typespec/typespec_client_core/Cargo.toml index 606c4d59ed..687b0f3b76 100644 --- a/sdk/typespec/typespec_client_core/Cargo.toml +++ b/sdk/typespec/typespec_client_core/Cargo.toml @@ -79,3 +79,6 @@ features = [ "tokio_sleep", "xml", ] + +[lints] +workspace = true diff --git a/sdk/typespec/typespec_client_core/src/lib.rs b/sdk/typespec/typespec_client_core/src/lib.rs index 3b4b0e8fb8..187b22f139 100644 --- a/sdk/typespec/typespec_client_core/src/lib.rs +++ b/sdk/typespec/typespec_client_core/src/lib.rs @@ -2,6 +2,7 @@ // Licensed under the MIT License. #![doc = include_str!("../README.md")] +#![cfg_attr(docsrs, feature(doc_auto_cfg))] #[macro_use] mod macros;