From ceffdc8545c3155b030de9e91d399dc34bd3c678 Mon Sep 17 00:00:00 2001 From: Matthew Dempsky Date: Mon, 12 Sep 2022 13:01:57 -0700 Subject: cmd/compile: implement slice-to-array conversions The conversion T(x) is implemented as *(*T)(x). Accordingly, runtime panic messages for (*T)(x) are made more general. Fixes #46505. Change-Id: I76317c0878b6a5908299506d392eed50d7ef6523 Reviewed-on: https://go-review.googlesource.com/c/go/+/430415 Reviewed-by: Cuong Manh Le Reviewed-by: Jenny Rakoczy TryBot-Result: Gopher Robot Run-TryBot: Matthew Dempsky Reviewed-by: Keith Randall --- src/runtime/error.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/runtime/error.go') diff --git a/src/runtime/error.go b/src/runtime/error.go index b11473c634..a211fbf515 100644 --- a/src/runtime/error.go +++ b/src/runtime/error.go @@ -151,7 +151,7 @@ var boundsErrorFmts = [...]string{ boundsSlice3Acap: "slice bounds out of range [::%x] with capacity %y", boundsSlice3B: "slice bounds out of range [:%x:%y]", boundsSlice3C: "slice bounds out of range [%x:%y:]", - boundsConvert: "cannot convert slice with length %y to pointer to array with length %x", + boundsConvert: "cannot convert slice with length %y to array or pointer to array with length %x", } // boundsNegErrorFmts are overriding formats if x is negative. In this case there's no need to report y. -- cgit v1.3