From 00e944f7186810ac518d47b62a3e3cc8aa081cdf Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Tue, 20 Jul 2021 01:47:53 +0200 Subject: [PATCH] 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{}`. --- doc/langref.html.in | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/doc/langref.html.in b/doc/langref.html.in index d88b8633e9..b20f5821a8 100644 --- a/doc/langref.html.in +++ b/doc/langref.html.in @@ -5725,9 +5725,8 @@ test "turn HashMap into a set with void" { value is deleted, as seen above.

- {#syntax#}void{#endsyntax#} is distinct from {#syntax#}c_void{#endsyntax#}, which is defined like this: - {#syntax#}pub const c_void = opaque {};{#endsyntax#}. - {#syntax#}void{#endsyntax#} has a known size of 0 bytes, and {#syntax#}c_void{#endsyntax#} has an unknown, but non-zero, size. + {#syntax#}void{#endsyntax#} is distinct from {#syntax#}c_void{#endsyntax#}. + {#syntax#}void{#endsyntax#} has a known size of 0 bytes, and {#syntax#}c_void{#endsyntax#} has an unknown, but non-zero, size.

Expressions of type {#syntax#}void{#endsyntax#} are the only ones whose value can be ignored. For example: