about summary refs log tree commit diff
path: root/compiler/rustc_hir_pretty
diff options
context:
space:
mode:
authorOli Scherer <github333195615777966@oli-obk.de>2025-02-27 09:46:46 +0000
committerOli Scherer <github333195615777966@oli-obk.de>2025-04-28 07:50:18 +0000
commitb023856f29743a288727d13d0d1044b8e0d3f9f3 (patch)
tree7a7bf06175bb87fd9d6f2e81df8f2a84313da982 /compiler/rustc_hir_pretty
parentcb6d3715a5447da8c291aa5d83133376e5811751 (diff)
downloadrust-b023856f29743a288727d13d0d1044b8e0d3f9f3.tar.gz
rust-b023856f29743a288727d13d0d1044b8e0d3f9f3.zip
Add or-patterns to pattern types
Diffstat (limited to 'compiler/rustc_hir_pretty')
-rw-r--r--compiler/rustc_hir_pretty/src/lib.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/compiler/rustc_hir_pretty/src/lib.rs b/compiler/rustc_hir_pretty/src/lib.rs
index c95d6a277c7..37c7e613b2c 100644
--- a/compiler/rustc_hir_pretty/src/lib.rs
+++ b/compiler/rustc_hir_pretty/src/lib.rs
@@ -1866,6 +1866,19 @@ impl<'a> State<'a> {
                 self.word("..=");
                 self.print_const_arg(end);
             }
+            TyPatKind::Or(patterns) => {
+                self.popen();
+                let mut first = true;
+                for pat in patterns {
+                    if first {
+                        first = false;
+                    } else {
+                        self.word(" | ");
+                    }
+                    self.print_ty_pat(pat);
+                }
+                self.pclose();
+            }
             TyPatKind::Err(_) => {
                 self.popen();
                 self.word("/*ERROR*/");