Skip to content

Commit 39601b4

Browse files
committed
rustdoc: tolerate PatKind::Missing in rustc_ast_pretty
1 parent cb79c42 commit 39601b4

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

compiler/rustc_ast_pretty/src/pprust/state.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1725,7 +1725,7 @@ impl<'a> State<'a> {
17251725
self.ann.pre(self, AnnNode::Pat(pat));
17261726
/* Pat isn't normalized, but the beauty of it is that it doesn't matter */
17271727
match &pat.kind {
1728-
PatKind::Missing => unreachable!(),
1728+
PatKind::Missing => {}
17291729
PatKind::Wild => self.word("_"),
17301730
PatKind::Never => self.word("!"),
17311731
PatKind::Ident(BindingMode(by_ref, mutbl), ident, sub) => {
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Ensure rustdoc does not ICE When expanding a macro that
2+
// generates a `PatKind::Missing` pattern.
3+
4+
//@ compile-flags: -Zunstable-options --generate-macro-expansion
5+
6+
#![crate_name = "foo"]
7+
8+
//@ has 'src/foo/missing-par-ice-150154.rs.html'
9+
10+
macro_rules! foo {
11+
() => {
12+
fn(())
13+
}
14+
}
15+
16+
fn bar() {
17+
let _: foo!();
18+
}

0 commit comments

Comments
 (0)