Skip to content

Commit 40ca39d

Browse files
committedJan 31, 2018
fix error message mentioning unreachable instead of noreturn
1 parent 3ef6a00 commit 40ca39d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed
 

‎src/ir.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -7009,7 +7009,7 @@ static IrInstruction *ir_get_const_ptr(IrAnalyze *ira, IrInstruction *instructio
70097009
if (pointee_type->id == TypeTableEntryIdMetaType) {
70107010
TypeTableEntry *type_entry = pointee->data.x_type;
70117011
if (type_entry->id == TypeTableEntryIdUnreachable) {
7012-
ir_add_error(ira, instruction, buf_sprintf("pointer to unreachable not allowed"));
7012+
ir_add_error(ira, instruction, buf_sprintf("pointer to noreturn not allowed"));
70137013
return ira->codegen->invalid_instruction;
70147014
}
70157015

‎test/compile_errors.zig

+2-2
Original file line numberDiff line numberDiff line change
@@ -372,10 +372,10 @@ pub fn addCases(cases: &tests.CompileErrorContext) void {
372372
\\export fn entry() void { _ = a(); }
373373
, ".tmp_source.zig:1:8: error: use of undeclared identifier 'bogus'");
374374

375-
cases.add("pointer to unreachable",
375+
cases.add("pointer to noreturn",
376376
\\fn a() &noreturn {}
377377
\\export fn entry() void { _ = a(); }
378-
, ".tmp_source.zig:1:9: error: pointer to unreachable not allowed");
378+
, ".tmp_source.zig:1:9: error: pointer to noreturn not allowed");
379379

380380
cases.add("unreachable code",
381381
\\export fn a() void {

0 commit comments

Comments
 (0)
Please sign in to comment.