diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2022-07-11 20:45:27 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-11 20:45:27 -0400 |
| commit | 7d2e14267985df0226a5deee96d0c17c94bf6eb2 (patch) | |
| tree | 7ed0b99d42c983c1ed2246d0094600a9425c65c0 /lib/std/zig.zig | |
| parent | dc815e5e8f194a03988624a6bf7e739ddfe0d3b4 (diff) | |
| parent | 20d4f7213dde1ffabe0880bbee46a1de44d586fc (diff) | |
| download | zig-7d2e14267985df0226a5deee96d0c17c94bf6eb2.tar.gz zig-7d2e14267985df0226a5deee96d0c17c94bf6eb2.zip | |
Merge pull request #12044 from Vexu/stage2-compile-errors
Sema: add detailed error notes to `coerceInMemoryAllowed`
Diffstat (limited to 'lib/std/zig.zig')
| -rw-r--r-- | lib/std/zig.zig | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/std/zig.zig b/lib/std/zig.zig index 0d3c94d37b..b8f75f649e 100644 --- a/lib/std/zig.zig +++ b/lib/std/zig.zig @@ -49,6 +49,10 @@ pub const Loc = struct { column: usize, /// Does not include the trailing newline. source_line: []const u8, + + pub fn eql(a: Loc, b: Loc) bool { + return a.line == b.line and a.column == b.column and std.mem.eql(u8, a.source_line, b.source_line); + } }; pub fn findLineColumn(source: []const u8, byte_offset: usize) Loc { |
