diff options
| author | Oli Scherer <github333195615777966@oli-obk.de> | 2025-02-27 09:46:46 +0000 |
|---|---|---|
| committer | Oli Scherer <github333195615777966@oli-obk.de> | 2025-04-28 07:50:18 +0000 |
| commit | b023856f29743a288727d13d0d1044b8e0d3f9f3 (patch) | |
| tree | 7a7bf06175bb87fd9d6f2e81df8f2a84313da982 /compiler/rustc_ast_pretty | |
| parent | cb6d3715a5447da8c291aa5d83133376e5811751 (diff) | |
| download | rust-b023856f29743a288727d13d0d1044b8e0d3f9f3.tar.gz rust-b023856f29743a288727d13d0d1044b8e0d3f9f3.zip | |
Add or-patterns to pattern types
Diffstat (limited to 'compiler/rustc_ast_pretty')
| -rw-r--r-- | compiler/rustc_ast_pretty/src/pprust/state.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/compiler/rustc_ast_pretty/src/pprust/state.rs b/compiler/rustc_ast_pretty/src/pprust/state.rs index 62a50c73855..9411237421d 100644 --- a/compiler/rustc_ast_pretty/src/pprust/state.rs +++ b/compiler/rustc_ast_pretty/src/pprust/state.rs @@ -1162,6 +1162,17 @@ impl<'a> State<'a> { self.print_expr_anon_const(end, &[]); } } + rustc_ast::TyPatKind::Or(variants) => { + let mut first = true; + for pat in variants { + if first { + first = false + } else { + self.word(" | "); + } + self.print_ty_pat(pat); + } + } rustc_ast::TyPatKind::Err(_) => { self.popen(); self.word("/*ERROR*/"); |
