This works fine at runtime but at comptime it’s a no-go.
ub fn main() !void {
comptime {
const s = "Hello";
_ = @intFromPtr(s.ptr);
}
}
I get
src/main.zig:6:13: error: unable to evaluate comptime expression
_ = @intFromPtr(s.ptr);
^~~~~~~~~~~~~~~~~~
src/main.zig:6:26: note: operation is runtime due to this operand
_ = @intFromPtr(s.ptr);
~^~~~