From f5003d43bee529c25fc86706f98a76e66cad9ce2 Mon Sep 17 00:00:00 2001 From: Kevin Reid Date: Thu, 18 Jul 2024 15:46:04 -0700 Subject: [PATCH] Disable wgpu-core documentation as a workaround for #4905 (#5987) This enables `cargo doc` to succeed in a reasonable amount of time, as long as the reader isn't looking for documentation for `wgpu-core` itself. (cherry picked from commit b5934e89f7aa4619deffddd7cb42f954f48cc88b) # Conflicts: # CHANGELOG.md --- CHANGELOG.md | 1 + wgpu-core/src/lib.rs | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 760f59deb..a1c19d247 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -47,6 +47,7 @@ Bottom level categories: - Fix crash when dropping the surface after the device. By @wumpf in [#6052](https://github.com/gfx-rs/wgpu/pull/6052) - Fix length of copy in `queue_write_texture`. By @teoxoy in [#6009](https://github.com/gfx-rs/wgpu/pull/6009) - Fix error message that is thrown in create_render_pass to no longer say `compute_pass`. By @matthew-wong1 [#6041](https://github.com/gfx-rs/wgpu/pull/6041) +- As a workaround for [issue #4905](https://github.com/gfx-rs/wgpu/issues/4905), `wgpu-core` is undocumented unless `--cfg wgpu_core_doc` feature is enabled. By @kpreid in [#5987](https://github.com/gfx-rs/wgpu/pull/5987) ## 22.0.0 (2024-07-17) diff --git a/wgpu-core/src/lib.rs b/wgpu-core/src/lib.rs index 7600436bc..b192bc867 100644 --- a/wgpu-core/src/lib.rs +++ b/wgpu-core/src/lib.rs @@ -2,6 +2,20 @@ //! It is designed for integration into browsers, as well as wrapping //! into other language-specific user-friendly libraries. //! +#![cfg_attr( + not(any(not(doc), wgpu_core_doc)), + doc = r#"\ +## Documentation hidden + +As a workaround for [an issue in rustdoc](https://github.com/rust-lang/rust/issues/114891) +that [affects `wgpu-core` documentation builds \ +severely](https://github.com/gfx-rs/wgpu/issues/4905), +the documentation for `wgpu-core` is empty unless built with +`RUSTFLAGS="--cfg wgpu_core_doc"`, which may take a very long time. +"# +)] +#![cfg(any(not(doc), wgpu_core_doc))] +//! //! ## Feature flags #![doc = document_features::document_features!()] //!