Skip to content

Commit

Permalink
ci: Build-test documentation with warnings disallowed, and fix links
Browse files Browse the repository at this point in the history
Broken links that snuck in (most recently in #530 and #537) while the
CI was not testing the documentation have also been corrected, to allow
it to succeed again (and to have proper docs in the first place).
  • Loading branch information
MarijnS95 committed Jan 22, 2022
1 parent fbcc45f commit d47f6c6
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 6 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,21 @@ jobs:
with:
command: clippy
args: --workspace --all-targets -- -D warnings

docs:
name: Build-test docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
name: Document all crates
env:
RUSTDOCFLAGS: -Dwarnings
with:
command: doc
args: --all --all-features --no-deps --document-private-items
4 changes: 4 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased] - ReleaseDate

### Changed

- Fixed broken (intradoc) links in the prelude and `VK_KHR_get_surface_capabilities2` extension (#559)

### Added

- Added conversions from `Extent2D` to `Extent3D` and `Rect2D` (#557)
Expand Down
4 changes: 2 additions & 2 deletions ash/src/extensions/khr/get_surface_capabilities2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ impl GetSurfaceCapabilities2 {
Self { fp }
}

#[doc = "https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceSurfaceCapabilities2KHR.html"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceSurfaceCapabilities2KHR.html>"]
pub unsafe fn get_physical_device_surface_capabilities2(
&self,
physical_device: vk::PhysicalDevice,
Expand Down Expand Up @@ -49,7 +49,7 @@ impl GetSurfaceCapabilities2 {
err_code.result_with_success(count as usize)
}

#[doc = "https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceSurfaceFormats2KHR.html"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceSurfaceFormats2KHR.html>"]
///
/// Call [`Self::get_physical_device_surface_formats2_len()`] to query the number of elements to pass to `out`.
/// Be sure to [`Default::default()`]-initialize these elements and optionally set their `p_next` pointer.
Expand Down
12 changes: 8 additions & 4 deletions ash/src/vk/prelude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ use crate::vk;
/// and 8 bytes in the most significant bits of that memory,
/// occupying a single [`u32`] in total. This is commonly used in
/// [acceleration structure instances] such as
/// [`vk::AccelerationStructureInstanceKHR`][super::AccelerationStructureInstanceKHR],
/// [`vk::AccelerationStructureSRTMotionInstanceNV`][super::AccelerationStructureSRTMotionInstanceNV] and
/// [`vk::AccelerationStructureMatrixMotionInstanceNV`][super::AccelerationStructureMatrixMotionInstanceNV].
/// [`vk::AccelerationStructureInstanceKHR`],
/// [`vk::AccelerationStructureSRTMotionInstanceNV`] and
/// [`vk::AccelerationStructureMatrixMotionInstanceNV`].
///
/// [acceleration structure instances]: https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkAccelerationStructureInstanceKHR.html#_description
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Debug)]
Expand All @@ -29,7 +29,11 @@ impl Packed24_8 {
}
}

impl super::ColorComponentFlags {
// Intradoc `Self::` links refuse to resolve if `ColorComponentFlags`
// isn't directly in scope: https://github.com/rust-lang/rust/issues/93205
use vk::ColorComponentFlags;

impl ColorComponentFlags {
/// Contraction of [`Self::R`] | [`Self::G`] | [`Self::B`] | [`Self::A`]
pub const RGBA: Self = Self(Self::R.0 | Self::G.0 | Self::B.0 | Self::A.0);
}
Expand Down

0 comments on commit d47f6c6

Please sign in to comment.