From fd91002b465417adb7fd5ff8e31c0207195562dd Mon Sep 17 00:00:00 2001 From: Raphael Amorim Date: Mon, 27 Apr 2026 23:45:51 +0200 Subject: [PATCH] make explict about phantom --- sugarloaf/src/renderer/mod.rs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/sugarloaf/src/renderer/mod.rs b/sugarloaf/src/renderer/mod.rs index bfd7ea5d..9ebca6ba 100644 --- a/sugarloaf/src/renderer/mod.rs +++ b/sugarloaf/src/renderer/mod.rs @@ -1399,12 +1399,15 @@ impl Renderer { ); ImageTexture::Metal(mtl_tex) } - // `_Phantom` and any future-added variants. Placed - // LAST so platform arms (Metal/Wgpu/Vulkan) match - // first; an earlier `_ => continue` was the cause of - // image overlays silently dropping. - #[allow(unreachable_patterns)] - _ => continue, + // `_Phantom` is the lifetime-placeholder variant that + // only exists when wgpu is feature-gated out. Naming + // it explicitly (instead of `_ => continue`) forces + // the compiler to flag any future variant added to + // `ContextType` — a previous wildcard arm shadowed + // the platform arms above and silently dropped every + // kitty image upload on macOS+no-wgpu builds. + #[cfg(not(feature = "wgpu"))] + crate::context::ContextType::_Phantom(_) => continue, }; self.image_textures.insert( -- 2.51.2