zig/doc/langref/test_string_literal_to_slice.zig

10 lines
158 B
Zig

fn foo(s: []u8) void {
_ = s;
}
test "string literal to mutable slice" {
foo("hello");
}
// test_error=expected type '[]u8', found '*const [5:0]u8'