Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix building cargo-examples after stabilization of #cfg(doc) #103

Merged
merged 1 commit into from
Feb 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ This project adheres to [Semantic Versioning](http://semver.org/).

### Changed
### Fixed

- Fixed the docs for `mockall_examples`
([#103](https://github.com/asomers/mockall/pull/103))

### Removed

## [0.6.0] - 5 December 2019
Expand Down
7 changes: 0 additions & 7 deletions mockall_examples/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,5 @@ description = """
Examples of autogenerated mock objects by Mockall
"""

[package.metadata.docs.rs]
features = ["nightly-docs"]

[features]
# For building documentation only; no functional change to the library.
nightly-docs = []

[dependencies]
mockall = { version = "= 0.6.0", path = "../mockall" }
7 changes: 3 additions & 4 deletions mockall_examples/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// vim: tw=80
#![cfg_attr(feature = "nightly-docs", feature(doc_cfg))]

//! Examples of mock objects and their generated methods.
//!
Expand All @@ -8,13 +7,13 @@
//! crate. You should never depend on this crate.
//

#[cfg(all(feature = "nightly-docs", rustdoc))]
#[cfg(doc)]
use mockall::*;

/// A basic trait with several kinds of method.
///
/// It is mocked by the [`MockFoo`](struct.MockFoo.html) struct.
#[cfg(all(feature = "nightly-docs", rustdoc))]
#[cfg(doc)]
#[automock]
pub trait Foo {
/// A method with a `'static` return type
Expand All @@ -33,7 +32,7 @@ pub trait Foo {
fn bang(x: i32) -> i32;
}

#[cfg(all(feature = "nightly-docs", rustdoc))]
#[cfg(doc)]
#[automock(mod mock_ffi;)]
extern "C" {
/// A foreign "C" function
Expand Down