We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
0.11.0-dev.2571+31738de28
Code:
const std = @import("std"); const ___tracy_source_location_data = extern struct { name: ?[*:0]const u8, function: [*:0]const u8, file: [*:0]const u8, line: u32, color: u32, }; pub inline fn traceNamed(comptime src: std.builtin.SourceLocation, comptime name: [*:0]const u8) Ctx { const holder = struct { pub const data: ___tracy_source_location_data = ___tracy_source_location_data{ .name = name, .function = src.fn_name.ptr, .file = src.file.ptr, .line = src.line, .color = 0, }; }; return ___tracy_emit_zone_begin(&holder.data, 1); } pub fn main() anyerror!void { const ctx = traceNamed(@src(), "main"); _ = ctx.id; } extern fn ___tracy_emit_zone_begin(data: *const ___tracy_source_location_data, depth: u32) Ctx; pub const Ctx = extern struct { id: u64 = 0, };
zig build-exe ./repro.zig
Message:
repro.zig:13:86: error: unable to evaluate comptime expression pub const data: ___tracy_source_location_data = ___tracy_source_location_data{ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ referenced by: traceNamed: /Users/jarred/Desktop/repro.zig:21:44 main: /Users/jarred/Desktop/repro.zig:25:17 remaining
No error
The text was updated successfully, but these errors were encountered:
This is caused by @src().line not being compile time known. #13315 (comment)
@src().line
Sorry, something went wrong.
No branches or pull requests
Zig Version
0.11.0-dev.2571+31738de28
Steps to Reproduce and Observed Behavior
Code:
Message:
Expected Behavior
No error
The text was updated successfully, but these errors were encountered: