Skip to content

Commit

Permalink
spec: unsafe.Add/Slice are not permitted in statement context
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
griesemer committed Jun 22, 2021
1 parent 666315b commit 5bd09e5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions doc/go_spec.html
Original file line number Diff line number Diff line change
@@ -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"
}-->

Expand Down Expand Up @@ -4670,7 +4670,7 @@ <h3 id="Expression_statements">Expression statements</h3>

<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>
Expand Down

0 comments on commit 5bd09e5

Please sign in to comment.