Skip to content

Commit ca176ee

Browse files
committed
Fix doctests that used ignore to hide code that didn't compile.
1 parent 673bb69 commit ca176ee

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/cargo/core/features.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
//! 3. To actually perform the feature gate, you'll want to have code that looks
2222
//! like:
2323
//!
24-
//! ```rust,ignore
24+
//! ```rust,compile_fail
2525
//! use core::{Feature, Features};
2626
//!
2727
//! let feature = Feature::launch_into_space();

src/cargo/util/network.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,12 @@ fn maybe_spurious(err: &Error) -> bool {
7373
///
7474
/// # Examples
7575
///
76-
/// ```ignore
77-
/// use util::network;
78-
/// cargo_result = network::with_retry(&config, || something.download());
76+
/// ```
77+
/// # use crate::cargo::util::{CargoResult, Config};
78+
/// # let download_something = || return Ok(());
79+
/// # let config = Config::default().unwrap();
80+
/// use cargo::util::network;
81+
/// let cargo_result = network::with_retry(&config, || download_something());
7982
/// ```
8083
pub fn with_retry<T, F>(config: &Config, mut callback: F) -> CargoResult<T>
8184
where

0 commit comments

Comments
 (0)