diff --git a/lib/std/atomic/int.zig b/lib/std/atomic/int.zig index 155a340b0a..cdbf4ca81e 100644 --- a/lib/std/atomic/int.zig +++ b/lib/std/atomic/int.zig @@ -10,6 +10,9 @@ const testing = std.testing; /// Thread-safe, lock-free integer pub fn Int(comptime T: type) type { + if (!std.meta.trait.isIntegral(T)) + @compileError("Expected integral type, got '" ++ @typeName(T) ++ "'"); + return extern struct { unprotected_value: T,