Skip to content

Commit ac7efcb

Browse files
cuonglmgopherbot
authored andcommitted
test: enable inlining tests for functions with local type
Updates #57410 Change-Id: Ibe1f5523a4635d2b844b9a5db94514e07eb0bc0f Reviewed-on: https://go-review.googlesource.com/c/go/+/463998 Reviewed-by: Keith Randall <[email protected]> Auto-Submit: Cuong Manh Le <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Run-TryBot: Cuong Manh Le <[email protected]> Reviewed-by: Matthew Dempsky <[email protected]>
1 parent 3e1478e commit ac7efcb

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

test/escape4.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,20 +38,15 @@ func f2() {} // ERROR "can inline f2"
3838
func f3() { panic(1) } // ERROR "can inline f3" "1 escapes to heap"
3939
func f4() { recover() }
4040

41-
// TODO(cuonglm): remove f5, f6 //go:noinline and update the error message
42-
// once GOEXPERIMENT=nounified is gone.
43-
44-
//go:noinline
45-
func f5() *byte {
41+
func f5() *byte { // ERROR "can inline f5"
4642
type T struct {
4743
x [1]byte
4844
}
4945
t := new(T) // ERROR "new.T. escapes to heap"
5046
return &t.x[0]
5147
}
5248

53-
//go:noinline
54-
func f6() *byte {
49+
func f6() *byte { // ERROR "can inline f6"
5550
type T struct {
5651
x struct {
5752
y byte

0 commit comments

Comments
 (0)