From a7f35c766b03f111c906e7af410b34d063e4bf62 Mon Sep 17 00:00:00 2001 From: Voxell Paladynee Date: Sun, 18 Oct 2026 22:07:40 +0300 Subject: [PATCH] updated documentation for std.Target.Query and std.Target.Cpu.Feature.Set to point to existing feature sets in std\n\nthe motivation for this change was the issue codeberg#37309 and the feature presets living in another namespace than std.Target.Cpu.Feature.Set.*, making it harder to find things around by looking around in the proximity. --- lib/std/Target.zig | 3 +++ lib/std/Target/Query.zig | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/lib/std/Target.zig b/lib/std/Target.zig index 1220f970d86d715f6d905c71830da876f9f73586..4eaa95613af97fe2c46bae86a70f5ac19ef2e5e5 100644 --- a/lib/std/Target.zig +++ b/lib/std/Target.zig @@ -1228,6 +1228,9 @@ pub const Cpu = struct { dependencies: Set, /// A bit set of all the features. + /// + /// The typed features for a given `Target.Cpu.Arch` can be found in + /// `@field(Target, @tagName(arch.family()))`. pub const Set = struct { ints: [usize_count]usize, diff --git a/lib/std/Target/Query.zig b/lib/std/Target/Query.zig index b889354c5e68d15c1ddc86d825877cb68b8d4632..bc034dc9fa6e66472128cf0f2df565e66a371e51 100644 --- a/lib/std/Target/Query.zig +++ b/lib/std/Target/Query.zig @@ -18,9 +18,19 @@ cpu_arch: ?Target.Cpu.Arch = null, cpu_model: CpuModel = .determined_by_arch_os, /// Sparse set of CPU features to add to the set from `cpu_model`. +/// +/// The typed features for a given `Target.Cpu.Arch` can be found in +/// `@field(Target, @tagName(arch.family()))`. +/// +/// For example, `std.Target.x86.cpu.x86_64_v3.features` or `std.Target.s390x.cpu.z13.features`. cpu_features_add: Target.Cpu.Feature.Set = .empty, /// Sparse set of CPU features to remove from the set from `cpu_model`. +/// +/// The typed features for a given `Target.Cpu.Arch` can be found in +/// `@field(Target, @tagName(arch.family()))`. +/// +/// For example, `std.Target.x86.cpu.x86_64_v3.features` or `std.Target.s390x.cpu.z13.features`. cpu_features_sub: Target.Cpu.Feature.Set = .empty, /// `null` means native. -- 2.54.0