]> git.lizzy.rs Git - rust.git/blob - src/test/ui/parser/issues/issue-65846-rollback-gating-failing-matcher.rs
Rollup merge of #92399 - Veeupup:fix_vec_typo, r=Dylan-DPC
[rust.git] / src / test / ui / parser / issues / issue-65846-rollback-gating-failing-matcher.rs
1 // run-pass
2
3 // Test that failing macro matchers will not cause pre-expansion errors
4 // even though they use a feature that is pre-expansion gated.
5
6 macro_rules! m {
7     ($e:expr) => { 0 }; // This fails on the input below due to `, foo`.
8     ($e:expr,) => { 1 }; // This also fails to match due to `foo`.
9     (box $e:expr, foo) => { 2 }; // Successful matcher, we should get `2`.
10 }
11
12 fn main() {
13     assert_eq!(2, m!(box 42, foo));
14 }