diff options
| author | David Chase <drchase@google.com> | 2023-04-24 15:45:33 -0400 |
|---|---|---|
| committer | David Chase <drchase@google.com> | 2023-05-11 04:50:30 +0000 |
| commit | a2838ec5f20b56e94a18c873ab4b68397355e214 (patch) | |
| tree | e461b73e88af94584189441c48a436a2b0980339 /src/runtime/alg.go | |
| parent | 48f8c5c0373886736d348acb1ce1601457da1d2e (diff) | |
| download | go-a2838ec5f20b56e94a18c873ab4b68397355e214.tar.xz | |
runtime: redefine _type to abi.Type; add rtype for methods.
Change-Id: I1c478b704d84811caa209006c657dda82d9c4cf9
Reviewed-on: https://go-review.googlesource.com/c/go/+/488435
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Diffstat (limited to 'src/runtime/alg.go')
| -rw-r--r-- | src/runtime/alg.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/runtime/alg.go b/src/runtime/alg.go index e40eb9b47b..4eda9d4e75 100644 --- a/src/runtime/alg.go +++ b/src/runtime/alg.go @@ -106,7 +106,7 @@ func interhash(p unsafe.Pointer, h uintptr) uintptr { // typehash, but we want to report the topmost type in // the error text (e.g. in a struct with a field of slice type // we want to report the struct, not the slice). - panic(errorString("hash of unhashable type " + t.string())) + panic(errorString("hash of unhashable type " + toRType(t).string())) } if isDirectIface(t) { return c1 * typehash(t, unsafe.Pointer(&a.data), h^c0) @@ -123,7 +123,7 @@ func nilinterhash(p unsafe.Pointer, h uintptr) uintptr { } if t.Equal == nil { // See comment in interhash above. - panic(errorString("hash of unhashable type " + t.string())) + panic(errorString("hash of unhashable type " + toRType(t).string())) } if isDirectIface(t) { return c1 * typehash(t, unsafe.Pointer(&a.data), h^c0) @@ -174,7 +174,7 @@ func typehash(t *_type, p unsafe.Pointer, h uintptr) uintptr { case kindArray: a := (*arraytype)(unsafe.Pointer(t)) for i := uintptr(0); i < a.Len; i++ { - h = typehash(toType(a.Elem), add(p, i*a.Elem.Size_), h) + h = typehash(a.Elem, add(p, i*a.Elem.Size_), h) } return h case kindStruct: @@ -189,7 +189,7 @@ func typehash(t *_type, p unsafe.Pointer, h uintptr) uintptr { default: // Should never happen, as typehash should only be called // with comparable types. - panic(errorString("hash of unhashable type " + t.string())) + panic(errorString("hash of unhashable type " + toRType(t).string())) } } @@ -247,7 +247,7 @@ func efaceeq(t *_type, x, y unsafe.Pointer) bool { } eq := t.Equal if eq == nil { - panic(errorString("comparing uncomparable type " + t.string())) + panic(errorString("comparing uncomparable type " + toRType(t).string())) } if isDirectIface(t) { // Direct interface types are ptr, chan, map, func, and single-element structs/arrays thereof. @@ -264,7 +264,7 @@ func ifaceeq(tab *itab, x, y unsafe.Pointer) bool { t := tab._type eq := t.Equal if eq == nil { - panic(errorString("comparing uncomparable type " + t.string())) + panic(errorString("comparing uncomparable type " + toRType(t).string())) } if isDirectIface(t) { // See comment in efaceeq. |
