aboutsummaryrefslogtreecommitdiff
path: root/lib/std
diff options
context:
space:
mode:
Diffstat (limited to 'lib/std')
-rw-r--r--lib/std/zig/AstGen.zig5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/std/zig/AstGen.zig b/lib/std/zig/AstGen.zig
index b280360535..aa1ea2498f 100644
--- a/lib/std/zig/AstGen.zig
+++ b/lib/std/zig/AstGen.zig
@@ -7999,6 +7999,11 @@ fn switchExpr(
appendBodyWithFixupsArrayList(astgen, payloads, case_slice);
}
}
+
+ if (switch_full.label_token) |label_token| if (!block_scope.label.?.used) {
+ try astgen.appendErrorTok(label_token, "unused switch label", .{});
+ };
+
// Now that the item expressions are generated we can add this.
try parent_gz.instructions.append(gpa, switch_block);