std: update to use @memcpy directly

This commit is contained in:
Andrew Kelley
2023-04-27 15:16:01 -07:00
parent 73d3fb9883
commit 125221cce9
27 changed files with 119 additions and 115 deletions

View File

@@ -309,8 +309,8 @@ pub fn panicExtra(
// error being part of the @panic stack trace (but that error should
// only happen rarely)
const msg = std.fmt.bufPrint(buf[0..size], format, args) catch |err| switch (err) {
std.fmt.BufPrintError.NoSpaceLeft => blk: {
std.mem.copy(u8, buf[size..], trunc_msg);
error.NoSpaceLeft => blk: {
@memcpy(buf[size..], trunc_msg);
break :blk &buf;
},
};