Skip to content

Commit 5bd1204

Browse files
committed
Fix assert_matches doc examples.
1 parent 0a8e401 commit 5bd1204

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

library/core/src/macros/mod.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,15 @@ macro_rules! assert_ne {
124124
/// # Examples
125125
///
126126
/// ```
127+
/// #![feature(assert_matches)]
128+
///
127129
/// let a = 1u32.checked_add(2);
128130
/// let b = 1u32.checked_sub(2);
129131
/// assert_matches!(a, Some(_));
130132
/// assert_matches!(b, None);
131133
///
132134
/// let c = Ok("abc".to_string());
133-
/// assert_matches!(a, Ok(x) | Err(x) if x.len() < 100);
135+
/// assert_matches!(c, Ok(x) | Err(x) if x.len() < 100);
134136
/// ```
135137
#[macro_export]
136138
#[unstable(feature = "assert_matches", issue = "none")]
@@ -279,13 +281,15 @@ macro_rules! debug_assert_ne {
279281
/// # Examples
280282
///
281283
/// ```
284+
/// #![feature(assert_matches)]
285+
///
282286
/// let a = 1u32.checked_add(2);
283287
/// let b = 1u32.checked_sub(2);
284288
/// debug_assert_matches!(a, Some(_));
285289
/// debug_assert_matches!(b, None);
286290
///
287291
/// let c = Ok("abc".to_string());
288-
/// debug_assert_matches!(a, Ok(x) | Err(x) if x.len() < 100);
292+
/// debug_assert_matches!(c, Ok(x) | Err(x) if x.len() < 100);
289293
/// ```
290294
#[macro_export]
291295
#[unstable(feature = "assert_matches", issue = "none")]

0 commit comments

Comments
 (0)