Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion compiler/rustc_mir_build/src/thir/print.rs
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,9 @@ impl<'a, 'tcx> ThirPrinter<'a, 'tcx> {
print_indented!(self, "kind: PatKind {", depth_lvl);

match pat_kind {
PatKind::Missing => unreachable!(),
PatKind::Missing => {
print_indented!(self, "Missing", depth_lvl + 1);
}
PatKind::Wild => {
print_indented!(self, "Wild", depth_lvl + 1);
}
Expand Down
6 changes: 6 additions & 0 deletions tests/ui/thir-print/c-variadic.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
//@ compile-flags: -Zunpretty=thir-tree --crate-type=lib
//@ check-pass
#![feature(c_variadic)]

// The `...` argument uses `PatKind::Missing`.
unsafe extern "C" fn foo(_: i32, ...) {}
61 changes: 61 additions & 0 deletions tests/ui/thir-print/c-variadic.stdout
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
DefId(0:3 ~ c_variadic[a5de]::foo):
params: [
Param {
ty: i32
ty_span: Some($DIR/c-variadic.rs:6:29: 6:32 (#0))
self_kind: None
hir_id: Some(HirId(DefId(0:3 ~ c_variadic[a5de]::foo).1))
param: Some(
Pat: {
ty: i32
span: $DIR/c-variadic.rs:6:26: 6:27 (#0)
kind: PatKind {
Wild
}
}
)
}
Param {
ty: std::ffi::VaListImpl<'{erased}>
ty_span: None
self_kind: None
hir_id: Some(HirId(DefId(0:3 ~ c_variadic[a5de]::foo).3))
param: Some(
Pat: {
ty: std::ffi::VaListImpl<'{erased}>
span: $DIR/c-variadic.rs:6:34: 6:37 (#0)
kind: PatKind {
Missing
}
}
)
}
]
body:
Expr {
ty: ()
temp_lifetime: TempLifetime { temp_lifetime: Some(Node(6)), backwards_incompatible: None }
span: $DIR/c-variadic.rs:6:39: 6:41 (#0)
kind:
Scope {
region_scope: Node(6)
lint_level: Explicit(HirId(DefId(0:3 ~ c_variadic[a5de]::foo).6))
value:
Expr {
ty: ()
temp_lifetime: TempLifetime { temp_lifetime: Some(Node(6)), backwards_incompatible: None }
span: $DIR/c-variadic.rs:6:39: 6:41 (#0)
kind:
Block {
targeted_by_break: false
span: $DIR/c-variadic.rs:6:39: 6:41 (#0)
region_scope: Node(5)
safety_mode: Safe
stmts: []
expr: []
}
}
}
}


Loading