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-19 20:03:26-04:00
log00e944f7186810ac518d47b62a3e3cc8aa081cdf
treef0304fbefb5ab6a0e615038eaeaf5293a3f7653c
parent3e67ef5c9f539d63e93867c0928ad1fdf2658682

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
...@@ -5725,9 +5725,8 @@ test "turn HashMap into a set with void" {...@@ -5725,9 +5725,8 @@ test "turn HashMap into a set with void" {
5725 value is deleted, as seen above.5725 value is deleted, as seen above.
5726 </p>5726 </p>
5727 <p>5727 <p>
5728 {#syntax#}void{#endsyntax#} is distinct from {#syntax#}c_void{#endsyntax#}, which is defined like this:5728 {#syntax#}void{#endsyntax#} is distinct from {#syntax#}c_void{#endsyntax#}.
5729 {#syntax#}pub const c_void = opaque {};{#endsyntax#}.5729 {#syntax#}void{#endsyntax#} has a known size of 0 bytes, and {#syntax#}c_void{#endsyntax#} has an unknown, but non-zero, size.
5730 {#syntax#}void{#endsyntax#} has a known size of 0 bytes, and {#syntax#}c_void{#endsyntax#} has an unknown, but non-zero, size.
5731 </p>5730 </p>
5732 <p>5731 <p>
5733 Expressions of type {#syntax#}void{#endsyntax#} are the only ones whose value can be ignored. For example:5732 Expressions of type {#syntax#}void{#endsyntax#} are the only ones whose value can be ignored. For example: