]> Cypherpunks repositories - gostls13.git/commitdiff
spec: unsafe.Add/Slice are not permitted in statement context
authorRobert Griesemer <gri@golang.org>
Tue, 22 Jun 2021 05:20:11 +0000 (22:20 -0700)
committerRobert Griesemer <gri@golang.org>
Tue, 22 Jun 2021 16:01:58 +0000 (16:01 +0000)
Add unsafe.Add and unsafe.Slice to the list of built-in functions
which are not permitted in statement context. The compiler and
type checker already enforce this restriction, this just fixes
a documentation oversight.

For #19367.
For #40481.

Change-Id: Iabc63a8db048eaf40a5f5b5573fdf00b79d54119
Reviewed-on: https://go-review.googlesource.com/c/go/+/329925
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Rob Pike <r@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>

doc/go_spec.html

index 561d44271a258035df266806249e20f845ed5fcc..b59b37fd55240382fae7767b29301645426de93b 100644 (file)
@@ -1,6 +1,6 @@
 <!--{
        "Title": "The Go Programming Language Specification",
-       "Subtitle": "Version of Jun 2, 2021",
+       "Subtitle": "Version of Jun 22, 2021",
        "Path": "/ref/spec"
 }-->
 
@@ -4670,7 +4670,7 @@ The following built-in functions are not permitted in statement context:
 
 <pre>
 append cap complex imag len make new real
-unsafe.Alignof unsafe.Offsetof unsafe.Sizeof
+unsafe.Add unsafe.Alignof unsafe.Offsetof unsafe.Sizeof unsafe.Slice
 </pre>
 
 <pre>