ci: Test docs in addition to cargo t --all-targets (#392)

* ci: Test docs in addition to `cargo t --all-targets`

Unfortunately docs are not explicitly (build-)tested as part of
`--all-targets` allowing broken code to slip in as shown by #390.

Also remove the `rust` listing type which is the default, leaving only
`no_run` (until the CI has a loadable Vulkan library).

* ash: Fix errors and warnings in (now tested) documentation comments
This commit is contained in:
Marijn Suijten 2021-03-14 11:31:17 +01:00 committed by GitHub
parent dba9e6b691
commit 8444db4fb2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 9 deletions

View file

@ -53,10 +53,16 @@ jobs:
profile: minimal profile: minimal
toolchain: stable toolchain: stable
override: true override: true
- uses: actions-rs/cargo@v1 - name: Test all targets
uses: actions-rs/cargo@v1
with: with:
command: test command: test
args: --workspace --all-targets args: --workspace --all-targets
- name: Test docs
uses: actions-rs/cargo@v1
with:
command: test
args: --workspace --doc
fmt: fmt:
name: Rustfmt name: Rustfmt

View file

@ -191,10 +191,10 @@ impl<L> EntryCustom<L> {
} }
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkEnumerateInstanceVersion.html>"] #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkEnumerateInstanceVersion.html>"]
/// ```rust,no_run /// ```no_run
/// # use ash::{Entry, vk}; /// # use ash::{Entry, vk};
/// # fn main() -> Result<(), Box<std::error::Error>> { /// # fn main() -> Result<(), Box<dyn std::error::Error>> {
/// let entry = Entry::new()?; /// let entry = unsafe { Entry::new() }?;
/// match entry.try_enumerate_instance_version()? { /// match entry.try_enumerate_instance_version()? {
/// // Vulkan 1.1+ /// // Vulkan 1.1+
/// Some(version) => { /// Some(version) => {

View file

@ -46,10 +46,10 @@ impl EntryCustom<Arc<Library>> {
/// `dlopen`ing native libraries is inherently unsafe. The safety guidelines /// `dlopen`ing native libraries is inherently unsafe. The safety guidelines
/// for [`Library::new`] and [`Library::get`] apply here. /// for [`Library::new`] and [`Library::get`] apply here.
/// ///
/// ```rust,no_run /// ```no_run
/// use ash::{vk, Entry, version::EntryV1_0}; /// use ash::{vk, Entry, version::EntryV1_0};
/// # fn main() -> Result<(), Box<std::error::Error>> { /// # fn main() -> Result<(), Box<dyn std::error::Error>> {
/// let entry = Entry::new()?; /// let entry = unsafe { Entry::new() }?;
/// let app_info = vk::ApplicationInfo { /// let app_info = vk::ApplicationInfo {
/// api_version: vk::make_version(1, 0, 0), /// api_version: vk::make_version(1, 0, 0),
/// ..Default::default() /// ..Default::default()

View file

@ -5,10 +5,10 @@
//! //!
//! ## Examples //! ## Examples
//! //!
//! ```rust,no_run //! ```no_run
//! use ash::{vk, Entry, version::EntryV1_0}; //! use ash::{vk, Entry, version::EntryV1_0};
//! # fn main() -> Result<(), Box<dyn std::error::Error>> { //! # fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let entry = Entry::new()?; //! let entry = unsafe { Entry::new() }?;
//! let app_info = vk::ApplicationInfo { //! let app_info = vk::ApplicationInfo {
//! api_version: vk::make_version(1, 0, 0), //! api_version: vk::make_version(1, 0, 0),
//! ..Default::default() //! ..Default::default()