Skip to content

Commit b688d84

Browse files
committed
minor: add missing test
This test kills the following mutant: diff --git a/crates/mbe/src/tt_iter.rs b/crates/mbe/src/tt_iter.rs index 9d2b1da..055d9a733 100644 --- a/crates/mbe/src/tt_iter.rs +++ b/crates/mbe/src/tt_iter.rs @@ -134,7 +134,7 @@ impl<'a> TtIter<'a> { self.inner = self.inner.as_slice()[res.len()..].iter(); let res = match res.len() { 1 => Some(res[0].cloned()), - 0 => None, + // 0 => None, _ => Some(tt::TokenTree::Subtree(tt::Subtree { delimiter: None, token_trees: res.into_iter().map(|it| it.cloned()).collect(),
1 parent 3038141 commit b688d84

File tree

1 file changed

+14
-0
lines changed
  • crates/hir_def/src/macro_expansion_tests/mbe

1 file changed

+14
-0
lines changed

crates/hir_def/src/macro_expansion_tests/mbe/matching.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,3 +122,17 @@ stringify!(.. .. ..|);
122122
"#]],
123123
);
124124
}
125+
126+
#[test]
127+
fn trailing_vis() {
128+
check(
129+
r#"
130+
macro_rules! m { ($($i:ident)? $vis:vis) => () }
131+
m!(x pub);
132+
"#,
133+
expect![[r#"
134+
macro_rules! m { ($($i:ident)? $vis:vis) => () }
135+
136+
"#]],
137+
)
138+
}

0 commit comments

Comments
 (0)