]> Cypherpunks repositories - gostls13.git/commit
go/types, cmd/compile/internal/types2: use regular type printing for unsafe.Pointer
authorRobert Griesemer <gri@golang.org>
Tue, 23 Feb 2021 01:02:46 +0000 (17:02 -0800)
committerRobert Griesemer <gri@golang.org>
Tue, 23 Feb 2021 04:13:24 +0000 (04:13 +0000)
commita2e150c7cded1367fb092e87abb37ce2a1673d11
treeac3a31f283ae5060781a871e669135f288ed1d0f
parent5a0e4fc4e7188fb36e64a7d7d25bab943f081811
go/types, cmd/compile/internal/types2: use regular type printing for unsafe.Pointer

Type string printing special-cased printing of unsafe.Pointer because
it's a built-in type; yet it's declared in a package like any other
imported or used-defined type (unlike built-in types such as int).

Use the same mechanism for printing unsafe.Pointer like any other
(non-basic) type. This will make it possible to use the package
Qualifier if so desired.

Fixes #44515.

Change-Id: I0dd1026f850737ecfc4bb99135cfb8e3c18be9e7
Reviewed-on: https://go-review.googlesource.com/c/go/+/295271
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
src/cmd/compile/internal/types2/issues_test.go
src/cmd/compile/internal/types2/typestring.go
src/go/types/issues_test.go
src/go/types/typestring.go