| author | |
| committer | |
| log | 442592855c655f20b8b51db9ac75e17485c4e685 |
| tree | 486b7f9f565bfb399fc41fad3225536bb3ffbf56 |
| parent | 5fa7f13082145c10d0b536cc894f60323ffacd61 |
4 files changed, 12 insertions(+), 13 deletions(-)
src/Type.zig+3-3| ... | ... | @@ -4158,8 +4158,8 @@ fn shouldDedupeType(ty: Type, ctx: *Comparison, pt: Zcu.PerThread) error{OutOfMe |
| 4158 | 4158 | |
| 4159 | 4159 | const type_len: i32 = @intCast(discarding.count); |
| 4160 | 4160 | |
| 4161 | const placeholder_len: i32 = 3; | |
| 4162 | const min_saved_bytes: i32 = 10; | |
| 4161 | const placeholder_len: i32 = 1; | |
| 4162 | const min_saved_bytes: i32 = 20; | |
| 4163 | 4163 | |
| 4164 | 4164 | const saved_bytes = (type_len - placeholder_len) * (occ - 1); |
| 4165 | 4165 | const max_placeholders = 7; // T to Z |
| ... | ... | @@ -4192,7 +4192,7 @@ pub const Comparison = struct { |
| 4192 | 4192 | index: u8, |
| 4193 | 4193 | |
| 4194 | 4194 | pub fn format(p: Placeholder, writer: *std.Io.Writer) error{WriteFailed}!void { |
| 4195 | return writer.print("<{c}>", .{p.index + 'T'}); | |
| 4195 | return writer.print("{c}", .{p.index + 'T'}); | |
| 4196 | 4196 | } |
| 4197 | 4197 | }; |
| 4198 | 4198 |
test/cases/compile_errors/pointer_attributes_checked_when_coercing_pointer_to_anon_literal.zig+1-2| ... | ... | @@ -16,8 +16,7 @@ comptime { |
| 16 | 16 | // |
| 17 | 17 | // :2:29: error: expected type '[][]const u8', found '*const [2][]const u8' |
| 18 | 18 | // :2:29: note: cast discards const qualifier |
| 19 | // :6:31: error: expected type '*<T>', found '*const <T>' | |
| 20 | // :6:31: note: <T> = [2][]const u8 | |
| 19 | // :6:31: error: expected type '*[2][]const u8', found '*const [2][]const u8' | |
| 21 | 20 | // :6:31: note: cast discards const qualifier |
| 22 | 21 | // :11:19: error: expected type '*tmp.S', found '*const tmp.S' |
| 23 | 22 | // :11:19: note: cast discards const qualifier |
test/cases/compile_errors/type_dedupe.zig+6-6| ... | ... | @@ -1,18 +1,18 @@ |
| 1 | const SomeVeryLongName = struct {}; | |
| 1 | const SomeVeryVeryVeryLongName = struct {}; | |
| 2 | 2 | |
| 3 | fn foo(a: *SomeVeryLongName) void { | |
| 3 | fn foo(a: *SomeVeryVeryVeryLongName) void { | |
| 4 | 4 | _ = a; |
| 5 | 5 | } |
| 6 | 6 | |
| 7 | 7 | export fn entry() void { |
| 8 | const a: SomeVeryLongName = .{}; | |
| 8 | const a: SomeVeryVeryVeryLongName = .{}; | |
| 9 | 9 | |
| 10 | 10 | foo(a); |
| 11 | 11 | } |
| 12 | 12 | |
| 13 | 13 | // error |
| 14 | 14 | // |
| 15 | // :10:9: error: expected type '*<T>', found '<T>' | |
| 16 | // :10:9: note: <T> = tmp.SomeVeryLongName | |
| 17 | // :1:26: note: struct declared here | |
| 15 | // :10:9: error: expected type '*T', found 'T' | |
| 16 | // :10:9: note: T = tmp.SomeVeryVeryVeryLongName | |
| 17 | // :1:34: note: struct declared here | |
| 18 | 18 | // :3:11: note: parameter type declared here |
test/cases/compile_errors/type_mismatch_with_tuple_concatenation.zig+2-2| ... | ... | @@ -5,5 +5,5 @@ export fn entry() void { |
| 5 | 5 | |
| 6 | 6 | // error |
| 7 | 7 | // |
| 8 | // :3:11: error: expected type '@TypeOf(.{})', found 'struct { comptime <T> = 1, comptime <T> = 2, comptime <T> = 3 }' | |
| 9 | // :3:11: note: <T> = comptime_int | |
| 8 | // :3:11: error: expected type '@TypeOf(.{})', found 'struct { comptime T = 1, comptime T = 2, comptime T = 3 }' | |
| 9 | // :3:11: note: T = comptime_int |