From 6d47b4f39e8cdd95ead71b1efdbf67a737174e97 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sun, 27 Jun 2021 17:28:59 -0700 Subject: Revert "Include package root dir in stage2 error messages" This reverts commit 15a030ef3d2d68992835568f2fb9d5deab18f39f. ast-check started crashing after this commit. Needs more QA before merging. --- src/Compilation.zig | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/Compilation.zig') diff --git a/src/Compilation.zig b/src/Compilation.zig index fececba066..f202034242 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -403,10 +403,10 @@ pub const AllErrors = struct { const source = try module_note.src_loc.file_scope.getSource(module.gpa); const byte_offset = try module_note.src_loc.byteOffset(module.gpa); const loc = std.zig.findLineColumn(source, byte_offset); - const file_path = try module_note.src_loc.file_scope.fullPath(&arena.allocator); + const sub_file_path = module_note.src_loc.file_scope.sub_file_path; note.* = .{ .src = .{ - .src_path = file_path, + .src_path = try arena.allocator.dupe(u8, sub_file_path), .msg = try arena.allocator.dupe(u8, module_note.msg), .byte_offset = byte_offset, .line = @intCast(u32, loc.line), @@ -426,10 +426,10 @@ pub const AllErrors = struct { const source = try module_err_msg.src_loc.file_scope.getSource(module.gpa); const byte_offset = try module_err_msg.src_loc.byteOffset(module.gpa); const loc = std.zig.findLineColumn(source, byte_offset); - const file_path = try module_err_msg.src_loc.file_scope.fullPath(&arena.allocator); + const sub_file_path = module_err_msg.src_loc.file_scope.sub_file_path; try errors.append(.{ .src = .{ - .src_path = file_path, + .src_path = try arena.allocator.dupe(u8, sub_file_path), .msg = try arena.allocator.dupe(u8, module_err_msg.msg), .byte_offset = byte_offset, .line = @intCast(u32, loc.line), @@ -480,7 +480,7 @@ pub const AllErrors = struct { note.* = .{ .src = .{ - .src_path = try file.fullPath(arena), + .src_path = try arena.dupe(u8, file.sub_file_path), .msg = try arena.dupe(u8, msg), .byte_offset = byte_offset, .line = @intCast(u32, loc.line), @@ -506,7 +506,7 @@ pub const AllErrors = struct { try errors.append(.{ .src = .{ - .src_path = try file.fullPath(arena), + .src_path = try arena.dupe(u8, file.sub_file_path), .msg = try arena.dupe(u8, msg), .byte_offset = byte_offset, .line = @intCast(u32, loc.line), -- cgit v1.2.3