From e0185d195512a7b771af3bc7bd299ba5634cef68 Mon Sep 17 00:00:00 2001 From: teoxoy <28601907+teoxoy@users.noreply.github.com> Date: Thu, 17 Nov 2022 18:34:54 +0100 Subject: [PATCH] [doc] explain how case clauses with multiple selectors are supported --- src/lib.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index c0f102670d..e9fb8ba7cb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1464,6 +1464,11 @@ pub enum Statement { reject: Block, }, /// Conditionally executes one of multiple blocks, based on the value of the selector. + /// + /// Some backends don't support fallthrough (HLSL due to FXC, WGSL). + /// However, a case clause with multiple selectors (and one body) gets translated as + /// a sequence of [`SwitchCase`]s with all but the last one having no body and marked + /// as fallthrough (which can get translated directly to all backends). Switch { selector: Handle, //int cases: Vec,