From 13856719454bc02e090f0784c66a45558be0e9b8 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Tue, 14 Dec 2021 09:59:15 -0800 Subject: [PATCH] Work around doc build failure due to docs.rs flags change --- build.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build.rs b/build.rs index 178c757..946be6e 100644 --- a/build.rs +++ b/build.rs @@ -58,7 +58,8 @@ fn main() { process::exit(1); } - let semver_exempt = cfg!(procmacro2_semver_exempt); + let docs_rs = env::var_os("DOCS_RS").is_some(); + let semver_exempt = cfg!(procmacro2_semver_exempt) || docs_rs; if semver_exempt { // https://github.com/dtolnay/proc-macro2/issues/147 println!("cargo:rustc-cfg=procmacro2_semver_exempt");