]> Cypherpunks.ru repositories - gostls13.git/blobdiff - test/escape_field.go
cmd/compile/internal/inline: score call sites exposed by inlines
[gostls13.git] / test / escape_field.go
index 8bb1a99553d6430439ae57f5cf0e7c2c7b5fb8a2..95d0784d9167cc9cf358dda69914ef9d0a319af0 100644 (file)
@@ -127,20 +127,20 @@ func field12() {
 
 func field13() {
        i := 0          // ERROR "moved to heap: i$"
-       x := &X{p1: &i} // ERROR "field13 &X literal does not escape$"
+       x := &X{p1: &i} // ERROR "&X{...} does not escape$"
        sink = x.p1
 }
 
 func field14() {
        i := 0 // ERROR "moved to heap: i$"
        // BAD: &i should not escape
-       x := &X{p1: &i} // ERROR "field14 &X literal does not escape$"
+       x := &X{p1: &i} // ERROR "&X{...} does not escape$"
        sink = x.p2
 }
 
 func field15() {
        i := 0          // ERROR "moved to heap: i$"
-       x := &X{p1: &i} // ERROR "&X literal escapes to heap$"
+       x := &X{p1: &i} // ERROR "&X{...} escapes to heap$"
        sink = x
 }
 
@@ -149,7 +149,7 @@ func field16() {
        var x X
        // BAD: &i should not escape
        x.p1 = &i
-       var iface interface{} = x // ERROR "field16 x does not escape"
+       var iface interface{} = x // ERROR "x does not escape"
        x1 := iface.(X)
        sink = x1.p2
 }
@@ -158,7 +158,7 @@ func field17() {
        i := 0 // ERROR "moved to heap: i$"
        var x X
        x.p1 = &i
-       var iface interface{} = x // ERROR "field17 x does not escape"
+       var iface interface{} = x // ERROR "x does not escape"
        x1 := iface.(X)
        sink = x1.p1
 }
@@ -168,7 +168,7 @@ func field18() {
        var x X
        // BAD: &i should not escape
        x.p1 = &i
-       var iface interface{} = x // ERROR "field18 x does not escape"
+       var iface interface{} = x // ERROR "x does not escape"
        y, _ := iface.(Y)         // Put X, but extracted Y. The cast will fail, so y is zero initialized.
        sink = y                  // ERROR "y escapes to heap"
 }