|
39 | 39 | #![feature(generic_assert_internals)]
|
40 | 40 | #![feature(hasher_prefixfree_extras)]
|
41 | 41 | #![feature(hashmap_internals)]
|
42 |
| -#![feature(inline_const_pat)] |
43 | 42 | #![feature(int_roundings)]
|
44 | 43 | #![feature(ip)]
|
45 | 44 | #![feature(ip_from)]
|
|
95 | 94 |
|
96 | 95 | /// Version of `assert_matches` that ignores fancy runtime printing in const context and uses structural equality.
|
97 | 96 | macro_rules! assert_eq_const_safe {
|
98 |
| - ($left:expr, $right:expr) => { |
99 |
| - assert_eq_const_safe!($left, $right, concat!(stringify!($left), " == ", stringify!($right))); |
| 97 | + ($t:ty: $left:expr, $right:expr) => { |
| 98 | + assert_eq_const_safe!($t: $left, $right, concat!(stringify!($left), " == ", stringify!($right))); |
100 | 99 | };
|
101 |
| - ($left:expr, $right:expr$(, $($arg:tt)+)?) => { |
| 100 | + ($t:ty: $left:expr, $right:expr$(, $($arg:tt)+)?) => { |
102 | 101 | {
|
103 | 102 | fn runtime() {
|
104 | 103 | assert_eq!($left, $right, $($($arg)*),*);
|
105 | 104 | }
|
106 | 105 | const fn compiletime() {
|
107 |
| - assert!(matches!($left, const { $right })); |
| 106 | + const PAT: $t = $right; |
| 107 | + assert!(matches!($left, PAT), $($($arg)*),*); |
108 | 108 | }
|
109 | 109 | core::intrinsics::const_eval_select((), compiletime, runtime)
|
110 | 110 | }
|
|
0 commit comments