From 35201e9d9338537a92de2ff89ea23dcd22ce4e52 Mon Sep 17 00:00:00 2001 From: Wooster Date: Sat, 9 Nov 2024 15:31:41 +0100 Subject: [PATCH] Sema: fix wording in error message It's an FQN, not an actual file name. --- src/Sema.zig | 2 +- test/cases/compile_errors/bogus_compile_var.zig | 2 +- test/cases/compile_errors/missing_main_fn_in_executable.zig | 2 +- test/cases/hello_world_with_updates.0.zig | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Sema.zig b/src/Sema.zig index 65805b6a67..dfa48e021d 100644 --- a/src/Sema.zig +++ b/src/Sema.zig @@ -5511,7 +5511,7 @@ fn failWithBadMemberAccess( else => unreachable, }; if (agg_ty.typeDeclInst(zcu)) |inst| if ((inst.resolve(ip) orelse return error.AnalysisFail) == .main_struct_inst) { - return sema.fail(block, field_src, "root struct of file '{}' has no member named '{}'", .{ + return sema.fail(block, field_src, "root source file struct '{}' has no member named '{}'", .{ agg_ty.fmt(pt), field_name.fmt(ip), }); }; diff --git a/test/cases/compile_errors/bogus_compile_var.zig b/test/cases/compile_errors/bogus_compile_var.zig index 3584730205..3562efa4f6 100644 --- a/test/cases/compile_errors/bogus_compile_var.zig +++ b/test/cases/compile_errors/bogus_compile_var.zig @@ -7,5 +7,5 @@ export fn entry() usize { // backend=stage2 // target=native // -// :1:29: error: root struct of file 'builtin' has no member named 'bogus' +// :1:29: error: root source file struct 'builtin' has no member named 'bogus' // note: struct declared here diff --git a/test/cases/compile_errors/missing_main_fn_in_executable.zig b/test/cases/compile_errors/missing_main_fn_in_executable.zig index c1af588b99..6eae093846 100644 --- a/test/cases/compile_errors/missing_main_fn_in_executable.zig +++ b/test/cases/compile_errors/missing_main_fn_in_executable.zig @@ -3,7 +3,7 @@ // target=x86_64-linux // output_mode=Exe // -// : error: root struct of file 'tmp' has no member named 'main' +// : error: root source file struct 'tmp' has no member named 'main' // : note: struct declared here // : note: called from here // : note: called from here diff --git a/test/cases/hello_world_with_updates.0.zig b/test/cases/hello_world_with_updates.0.zig index bcd09204d0..2cebc2c047 100644 --- a/test/cases/hello_world_with_updates.0.zig +++ b/test/cases/hello_world_with_updates.0.zig @@ -3,4 +3,4 @@ // target=x86_64-linux,x86_64-macos // link_libc=true // -// :?:?: error: root struct of file 'tmp' has no member named 'main' +// :?:?: error: root source file struct 'tmp' has no member named 'main'