1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//! Pattern Matching macros.
/// Returns true if an expression matches a pattern.
///
/// # Example
///
/// ```
/// # #[macro_use] extern crate mac;
///
/// # fn main() {
/// assert!(matches!(2, 1 | 2 | 3));
/// assert!(matches!('x', 'a' ... 'z'));
/// assert!(!matches!(Some(1), None));
/// assert!(matches!(Some(42), Some(n) if n == 42));
/// # }
/// ```
/// Work around "error: unexpected token: `an interpolated tt`", whatever that
/// means. (Probably rust-lang/rust#22819.)