diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2021-10-04 23:47:27 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2021-10-04 23:48:55 -0700 |
| commit | 6115cf22404467fd13d0290fc022d51d372d139a (patch) | |
| tree | 26c0bab951c81e89b5f0edcc5dc9f4b8e64df7db /lib/std/meta | |
| parent | 78902db68bbd400f6d84b65280c31d417105f2a8 (diff) | |
| download | zig-6115cf22404467fd13d0290fc022d51d372d139a.tar.gz zig-6115cf22404467fd13d0290fc022d51d372d139a.zip | |
migrate from `std.Target.current` to `@import("builtin").target`
closes #9388
closes #9321
Diffstat (limited to 'lib/std/meta')
| -rw-r--r-- | lib/std/meta/trait.zig | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/std/meta/trait.zig b/lib/std/meta/trait.zig index d1590141a1..6b6124ebeb 100644 --- a/lib/std/meta/trait.zig +++ b/lib/std/meta/trait.zig @@ -1,5 +1,4 @@ const std = @import("../std.zig"); -const builtin = std.builtin; const mem = std.mem; const debug = std.debug; const testing = std.testing; @@ -98,7 +97,7 @@ test "std.meta.trait.hasField" { try testing.expect(!hasField("value")(u8)); } -pub fn is(comptime id: builtin.TypeId) TraitFn { +pub fn is(comptime id: std.builtin.TypeId) TraitFn { const Closure = struct { pub fn trait(comptime T: type) bool { return id == @typeInfo(T); @@ -115,7 +114,7 @@ test "std.meta.trait.is" { try testing.expect(!is(.Optional)(anyerror)); } -pub fn isPtrTo(comptime id: builtin.TypeId) TraitFn { +pub fn isPtrTo(comptime id: std.builtin.TypeId) TraitFn { const Closure = struct { pub fn trait(comptime T: type) bool { if (!comptime isSingleItemPtr(T)) return false; @@ -131,7 +130,7 @@ test "std.meta.trait.isPtrTo" { try testing.expect(!isPtrTo(.Struct)(**struct {})); } -pub fn isSliceOf(comptime id: builtin.TypeId) TraitFn { +pub fn isSliceOf(comptime id: std.builtin.TypeId) TraitFn { const Closure = struct { pub fn trait(comptime T: type) bool { if (!comptime isSlice(T)) return false; |
