authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-03-08 12:44:56-04:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2020-03-08 12:44:56-04:00
logf90fe1f8f2be6ffa1c19997d123e12310d9e04b5
tree32e3a23aeebd5c51a87e6761160b8b51dce6f8c3
parenta5cb19c0ac6b3eec8b0e246507a5feffd1daca59
parentc8050a931c11e34bc6f4723eaed30f0a1bde5b14
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

Merge pull request #4687 from daurnimator/fix-typo

Fix grammar from "C pointers cannot point opaque types"

2 files changed, 5 insertions(+), 5 deletions(-)

src/ir.cpp+4-4
...@@ -9014,7 +9014,7 @@ static IrInstSrc *ir_gen_switch_expr(IrBuilderSrc *irb, Scope *scope, AstNode *n...@@ -9014,7 +9014,7 @@ static IrInstSrc *ir_gen_switch_expr(IrBuilderSrc *irb, Scope *scope, AstNode *n
9014 return irb->codegen->invalid_inst_src;9014 return irb->codegen->invalid_inst_src;
9015 }9015 }
9016 else_prong = prong_node;9016 else_prong = prong_node;
9017 } else if (prong_item_count == 1 && 9017 } else if (prong_item_count == 1 &&
9018 prong_node->data.switch_prong.items.at(0)->type == NodeTypeSymbol &&9018 prong_node->data.switch_prong.items.at(0)->type == NodeTypeSymbol &&
9019 buf_eql_str(prong_node->data.switch_prong.items.at(0)->data.symbol_expr.symbol, "_")) {9019 buf_eql_str(prong_node->data.switch_prong.items.at(0)->data.symbol_expr.symbol, "_")) {
9020 if (underscore_prong) {9020 if (underscore_prong) {
...@@ -26068,7 +26068,7 @@ static IrInstGen *ir_analyze_instruction_slice(IrAnalyze *ira, IrInstSrcSlice *i...@@ -26068,7 +26068,7 @@ static IrInstGen *ir_analyze_instruction_slice(IrAnalyze *ira, IrInstSrcSlice *i
26068 if (array_type->data.pointer.ptr_len == PtrLenC) {26068 if (array_type->data.pointer.ptr_len == PtrLenC) {
26069 array_type = adjust_ptr_len(ira->codegen, array_type, PtrLenUnknown);26069 array_type = adjust_ptr_len(ira->codegen, array_type, PtrLenUnknown);
2607026070
26071 // C pointers are allowzero by default. 26071 // C pointers are allowzero by default.
26072 // However, we want to be able to slice them without generating an allowzero slice (see issue #4401).26072 // However, we want to be able to slice them without generating an allowzero slice (see issue #4401).
26073 // To achieve this, we generate a runtime safety check and make the slice type non-allowzero.26073 // To achieve this, we generate a runtime safety check and make the slice type non-allowzero.
26074 if (array_type->data.pointer.allow_zero) {26074 if (array_type->data.pointer.allow_zero) {
...@@ -26363,7 +26363,7 @@ static IrInstGen *ir_analyze_instruction_slice(IrAnalyze *ira, IrInstSrcSlice *i...@@ -26363,7 +26363,7 @@ static IrInstGen *ir_analyze_instruction_slice(IrAnalyze *ira, IrInstSrcSlice *i
2636326363
26364 if (type_is_invalid(ptr_val->value->type))26364 if (type_is_invalid(ptr_val->value->type))
26365 return ira->codegen->invalid_inst_gen;26365 return ira->codegen->invalid_inst_gen;
26366 26366
26367 ir_build_assert_non_null(ira, &instruction->base.base, ptr_val);26367 ir_build_assert_non_null(ira, &instruction->base.base, ptr_val);
26368 }26368 }
2636926369
...@@ -30246,7 +30246,7 @@ static Error ir_resolve_lazy_raw(AstNode *source_node, ZigValue *val) {...@@ -30246,7 +30246,7 @@ static Error ir_resolve_lazy_raw(AstNode *source_node, ZigValue *val) {
30246 return ErrorSemanticAnalyzeFail;30246 return ErrorSemanticAnalyzeFail;
30247 } else if (elem_type->id == ZigTypeIdOpaque) {30247 } else if (elem_type->id == ZigTypeIdOpaque) {
30248 ir_add_error(ira, &lazy_ptr_type->elem_type->base,30248 ir_add_error(ira, &lazy_ptr_type->elem_type->base,
30249 buf_sprintf("C pointers cannot point opaque types"));30249 buf_sprintf("C pointers cannot point to opaque types"));
30250 return ErrorSemanticAnalyzeFail;30250 return ErrorSemanticAnalyzeFail;
30251 } else if (lazy_ptr_type->is_allowzero) {30251 } else if (lazy_ptr_type->is_allowzero) {
30252 ir_add_error(ira, &lazy_ptr_type->elem_type->base,30252 ir_add_error(ira, &lazy_ptr_type->elem_type->base,
test/compile_errors.zig+1-1
...@@ -1592,7 +1592,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {...@@ -1592,7 +1592,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
1592 \\ var y: [*c]c_void = x;1592 \\ var y: [*c]c_void = x;
1593 \\}1593 \\}
1594 , &[_][]const u8{1594 , &[_][]const u8{
1595 "tmp.zig:3:16: error: C pointers cannot point opaque types",1595 "tmp.zig:3:16: error: C pointers cannot point to opaque types",
1596 });1596 });
15971597
1598 cases.add("directly embedding opaque type in struct and union",1598 cases.add("directly embedding opaque type in struct and union",