@@ -208,42 +208,6 @@ macro_rules! debug_assert_ne {
208208 ( $( $arg: tt) * ) => ( if $crate:: cfg!( debug_assertions) { $crate:: assert_ne!( $( $arg) * ) ; } )
209209}
210210
211- /// Asserts that an expression matches any of the given patterns.
212- ///
213- /// Like in a `match` expression, the pattern can be optionally followed by `if`
214- /// and a guard expression that has access to names bound by the pattern.
215- ///
216- /// On panic, this macro will print the value of the expression with its
217- /// debug representation.
218- ///
219- /// Unlike [`assert_matches!`], `debug_assert_matches!` statements are only
220- /// enabled in non optimized builds by default. An optimized build will not
221- /// execute `debug_assert_matches!` statements unless `-C debug-assertions` is
222- /// passed to the compiler. This makes `debug_assert_matches!` useful for
223- /// checks that are too expensive to be present in a release build but may be
224- /// helpful during development. The result of expanding `debug_assert_matches!`
225- /// is always type checked.
226- ///
227- /// # Examples
228- ///
229- /// ```
230- /// #![feature(assert_matches)]
231- ///
232- /// let a = 1u32.checked_add(2);
233- /// let b = 1u32.checked_sub(2);
234- /// debug_assert_matches!(a, Some(_));
235- /// debug_assert_matches!(b, None);
236- ///
237- /// let c = Ok("abc".to_string());
238- /// debug_assert_matches!(c, Ok(x) | Err(x) if x.len() < 100);
239- /// ```
240- #[ macro_export]
241- #[ unstable( feature = "assert_matches" , issue = "82775" ) ]
242- #[ allow_internal_unstable( assert_matches) ]
243- macro_rules! debug_assert_matches {
244- ( $( $arg: tt) * ) => ( if $crate:: cfg!( debug_assertions) { $crate:: assert_matches!( $( $arg) * ) ; } )
245- }
246-
247211/// Returns whether the given expression matches any of the given patterns.
248212///
249213/// Like in a `match` expression, the pattern can be optionally followed by `if`
0 commit comments