diff --git a/crates/libs/windows/Cargo.toml b/crates/libs/windows/Cargo.toml
index 8fa02c0b0f..337c69835c 100644
--- a/crates/libs/windows/Cargo.toml
+++ b/crates/libs/windows/Cargo.toml
@@ -14,6 +14,7 @@ rust-version = "1.64"
[package.metadata.docs.rs]
default-target = "x86_64-pc-windows-msvc"
targets = []
+rustc-args = ["--cfg", "docsrs"]
[target.'cfg(not(windows_raw_dylib))'.dependencies]
windows-targets = { path = "../targets", version = "0.42.1" }
diff --git a/crates/libs/windows/src/lib.rs b/crates/libs/windows/src/lib.rs
index b2c7b5ff7c..60cebe31f5 100644
--- a/crates/libs/windows/src/lib.rs
+++ b/crates/libs/windows/src/lib.rs
@@ -1,3 +1,5 @@
+#![cfg_attr(docsrs, doc = "This is a stub. The latest API documentation is here: ")]
+#![cfg_attr(docsrs, doc = "")]
/*!
Learn more about Rust for Windows here:
*/
diff --git a/crates/tools/windows/src/main.rs b/crates/tools/windows/src/main.rs
index 00f1deab03..be0a01008d 100644
--- a/crates/tools/windows/src/main.rs
+++ b/crates/tools/windows/src/main.rs
@@ -55,6 +55,7 @@ rust-version = "1.64"
[package.metadata.docs.rs]
default-target = "x86_64-pc-windows-msvc"
targets = []
+rustc-args = ["--cfg", "docsrs"]
[target.'cfg(not(windows_raw_dylib))'.dependencies]
windows-targets = { path = "../targets", version = "0.42.1" }