authorgravatar for mail@isaacfreund.comIsaac Freund <mail@isaacfreund.com> 2021-07-20 01:47:53+02:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-07-21 12:27:21-07:00
log2561b1eb6729a000bfa77f2dc0d242ddcc9c4866
tree1bdba2c34127dea17a1c5cfc54306ae930356d15
parentc1e444b07c4b49df8e1fa7fba0b4a25bdc98004b

langref: remove incorrect statement on c_void

c_void is *not* simply `const c_void = opaque{};`. It has unique semantics as any pointer type may coerce to `*c_void` which is not true for an arbitrary `*opaque{}`.

1 files changed, 2 insertions(+), 3 deletions(-)

doc/langref.html.in+2-3
......@@ -5634,9 +5634,8 @@ test "turn HashMap into a set with void" {
56345634 value is deleted, as seen above.
56355635 </p>
56365636 <p>
5637 {#syntax#}void{#endsyntax#} is distinct from {#syntax#}c_void{#endsyntax#}, which is defined like this:
5638 {#syntax#}pub const c_void = opaque {};{#endsyntax#}.
5639 {#syntax#}void{#endsyntax#} has a known size of 0 bytes, and {#syntax#}c_void{#endsyntax#} has an unknown, but non-zero, size.
5637 {#syntax#}void{#endsyntax#} is distinct from {#syntax#}c_void{#endsyntax#}.
5638 {#syntax#}void{#endsyntax#} has a known size of 0 bytes, and {#syntax#}c_void{#endsyntax#} has an unknown, but non-zero, size.
56405639 </p>
56415640 <p>
56425641 Expressions of type {#syntax#}void{#endsyntax#} are the only ones whose value can be ignored. For example: