spec: unsafe.Pointers are pointers

But they cannot be dereferenced.
See also issue 6116.

Fixes #6358.

R=r, rsc, iant, ken
CC=golang-dev
https://golang.org/cl/14374046
This commit is contained in:
Robert Griesemer 2013-10-07 10:43:28 -07:00
parent 989a63eb0b
commit e121de2f01
1 changed files with 5 additions and 1 deletions

View File

@ -1,6 +1,6 @@
<!--{
"Title": "The Go Programming Language Specification",
"Subtitle": "Version of Oct 3, 2013",
"Subtitle": "Version of Oct 7, 2013",
"Path": "/ref/spec"
}-->
@ -5954,6 +5954,8 @@ func Sizeof(variable ArbitraryType) uintptr
<p>
Any pointer or value of <a href="#Types">underlying type</a> <code>uintptr</code> can be converted to
a <code>Pointer</code> type and vice versa.
A <code>Pointer</code> is a <a href="#Pointer_types">pointer type</a> but a <code>Pointer</code>
value may not be <a href="#Address_operators">dereferenced</a>.
</p>
<pre>
@ -5962,6 +5964,8 @@ bits = *(*uint64)(unsafe.Pointer(&amp;f))
type ptr unsafe.Pointer
bits = *(*uint64)(ptr(&amp;f))
var p ptr = nil
</pre>
<p>