Merge "Pass the `--cfg soong` flag when building rustdoc" into main
diff --git a/rust/builder.go b/rust/builder.go
index 1ce92f4..f469f56 100644
--- a/rust/builder.go
+++ b/rust/builder.go
@@ -520,6 +520,9 @@
 	// this flag.
 	rustdocFlags = append(rustdocFlags, "-Z", "unstable-options", "--enable-index-page")
 
+	// Ensure we use any special-case code-paths for Soong.
+	rustdocFlags = append(rustdocFlags, "--cfg", "soong")
+
 	targetTriple := ctx.toolchain().RustTriple()
 
 	// Collect rustc flags