std.ArrayList.toOwnedSlice() is removed in Zig 0.16toOwnedSlice — FALSE POSITIVEFiles: N/A Severity: HIGH (downgraded) Status: ❌ FALSE POSITIVE
Verification: Standalone test confirming toOwnedSlice works:
test "toOwnedSlice still works" {
var list: std.ArrayList(u8) = .empty;
errdefer list.deinit(testing.allocator);
try list.appendSlice(testing.allocator, "hello");
const owned = try list.toOwnedSlice(testing.allocator);
defer testing.allocator.free(owned);
try testing.expectEqualStrings("hello", owned);
}
Result: passes, zero deprecation warnings.
Evidence from std lib source (array_list.zig):
pub fn toOwnedSlice(self: *Self) Allocator.Error!Slicepub fn toOwnedSlice(self: *Self, gpa: Allocator) Allocator.Error!Slice@deprecate annotation anywhere on toOwnedSliceRoot cause of false positive: The Zig 0.16 skill doc stated std.json.stringify was removed (correct — replaced by std.json.fmt), and incorrectly extended that pattern to toOwnedSlice. The two are unrelated: stringify was truly removed, but toOwnedSlice remains.
No code changes needed.