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
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
- name: Test all targets
uses: actions-rs/cargo@v1
with:
command: test
args: --workspace --all-targets
- name: Test docs
uses: actions-rs/cargo@v1
with:
command: test
args: --workspace --doc
fmt:
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>"]
/// ```rust,no_run
/// ```no_run
/// # use ash::{Entry, vk};
/// # fn main() -> Result<(), Box<std::error::Error>> {
/// let entry = Entry::new()?;
/// # fn main() -> Result<(), Box<dyn std::error::Error>> {
/// let entry = unsafe { Entry::new() }?;
/// match entry.try_enumerate_instance_version()? {
/// // Vulkan 1.1+
/// Some(version) => {

View file

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

View file

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