@@ -118,15 +118,15 @@ type Bar struct {
118118}
119119
120120func NewBar () * Bar {
121- return & Bar {42 , nil } // ERROR "&Bar literal escapes to heap$"
121+ return & Bar {42 , nil } // ERROR "&Bar{...} escapes to heap$"
122122}
123123
124124func NewBarp (x * int ) * Bar { // ERROR "leaking param: x$"
125- return & Bar {42 , x } // ERROR "&Bar literal escapes to heap$"
125+ return & Bar {42 , x } // ERROR "&Bar{...} escapes to heap$"
126126}
127127
128128func NewBarp2 (x * int ) * Bar { // ERROR "x does not escape$"
129- return & Bar {* x , nil } // ERROR "&Bar literal escapes to heap$"
129+ return & Bar {* x , nil } // ERROR "&Bar{...} escapes to heap$"
130130}
131131
132132func (b * Bar ) NoLeak () int { // ERROR "b does not escape$"
@@ -173,7 +173,7 @@ type Bar2 struct {
173173}
174174
175175func NewBar2 () * Bar2 {
176- return & Bar2 {[12 ]int {42 }, nil } // ERROR "&Bar2 literal escapes to heap$"
176+ return & Bar2 {[12 ]int {42 }, nil } // ERROR "&Bar2{...} escapes to heap$"
177177}
178178
179179func (b * Bar2 ) NoLeak () int { // ERROR "b does not escape$"
@@ -539,7 +539,7 @@ func foo72b() [10]*int {
539539
540540// issue 2145
541541func foo73 () {
542- s := []int {3 , 2 , 1 } // ERROR "\[\]int literal does not escape$"
542+ s := []int {3 , 2 , 1 } // ERROR "\[\]int{...} does not escape$"
543543 for _ , v := range s {
544544 vv := v
545545 // actually just escapes its scope
@@ -550,7 +550,7 @@ func foo73() {
550550}
551551
552552func foo731 () {
553- s := []int {3 , 2 , 1 } // ERROR "\[\]int literal does not escape$"
553+ s := []int {3 , 2 , 1 } // ERROR "\[\]int{...} does not escape$"
554554 for _ , v := range s {
555555 vv := v // ERROR "moved to heap: vv$"
556556 // actually just escapes its scope
@@ -562,7 +562,7 @@ func foo731() {
562562}
563563
564564func foo74 () {
565- s := []int {3 , 2 , 1 } // ERROR "\[\]int literal does not escape$"
565+ s := []int {3 , 2 , 1 } // ERROR "\[\]int{...} does not escape$"
566566 for _ , v := range s {
567567 vv := v
568568 // actually just escapes its scope
@@ -574,7 +574,7 @@ func foo74() {
574574}
575575
576576func foo74a () {
577- s := []int {3 , 2 , 1 } // ERROR "\[\]int literal does not escape$"
577+ s := []int {3 , 2 , 1 } // ERROR "\[\]int{...} does not escape$"
578578 for _ , v := range s {
579579 vv := v // ERROR "moved to heap: vv$"
580580 // actually just escapes its scope
@@ -589,7 +589,7 @@ func foo74a() {
589589// issue 3975
590590func foo74b () {
591591 var array [3 ]func ()
592- s := []int {3 , 2 , 1 } // ERROR "\[\]int literal does not escape$"
592+ s := []int {3 , 2 , 1 } // ERROR "\[\]int{...} does not escape$"
593593 for i , v := range s {
594594 vv := v
595595 // actually just escapes its scope
@@ -601,7 +601,7 @@ func foo74b() {
601601
602602func foo74c () {
603603 var array [3 ]func ()
604- s := []int {3 , 2 , 1 } // ERROR "\[\]int literal does not escape$"
604+ s := []int {3 , 2 , 1 } // ERROR "\[\]int{...} does not escape$"
605605 for i , v := range s {
606606 vv := v // ERROR "moved to heap: vv$"
607607 // actually just escapes its scope
@@ -759,15 +759,15 @@ type LimitedFooer struct {
759759}
760760
761761func LimitFooer (r Fooer , n int64 ) Fooer { // ERROR "leaking param: r$"
762- return & LimitedFooer {r , n } // ERROR "&LimitedFooer literal escapes to heap$"
762+ return & LimitedFooer {r , n } // ERROR "&LimitedFooer{...} escapes to heap$"
763763}
764764
765765func foo90 (x * int ) map [* int ]* int { // ERROR "leaking param: x$"
766- return map [* int ]* int {nil : x } // ERROR "map\[\*int\]\*int literal escapes to heap$"
766+ return map [* int ]* int {nil : x } // ERROR "map\[\*int\]\*int{...} escapes to heap$"
767767}
768768
769769func foo91 (x * int ) map [* int ]* int { // ERROR "leaking param: x$"
770- return map [* int ]* int {x : nil } // ERROR "map\[\*int\]\*int literal escapes to heap$"
770+ return map [* int ]* int {x : nil } // ERROR "map\[\*int\]\*int{...} escapes to heap$"
771771}
772772
773773func foo92 (x * int ) [2 ]* int { // ERROR "leaking param: x to result ~r1 level=0$"
@@ -870,28 +870,28 @@ func foo106(x *int) { // ERROR "leaking param: x$"
870870}
871871
872872func foo107 (x * int ) map [* int ]* int { // ERROR "leaking param: x$"
873- return map [* int ]* int {x : nil } // ERROR "map\[\*int\]\*int literal escapes to heap$"
873+ return map [* int ]* int {x : nil } // ERROR "map\[\*int\]\*int{...} escapes to heap$"
874874}
875875
876876func foo108 (x * int ) map [* int ]* int { // ERROR "leaking param: x$"
877- return map [* int ]* int {nil : x } // ERROR "map\[\*int\]\*int literal escapes to heap$"
877+ return map [* int ]* int {nil : x } // ERROR "map\[\*int\]\*int{...} escapes to heap$"
878878}
879879
880880func foo109 (x * int ) * int { // ERROR "leaking param: x$"
881- m := map [* int ]* int {x : nil } // ERROR "map\[\*int\]\*int literal does not escape$"
881+ m := map [* int ]* int {x : nil } // ERROR "map\[\*int\]\*int{...} does not escape$"
882882 for k , _ := range m {
883883 return k
884884 }
885885 return nil
886886}
887887
888888func foo110 (x * int ) * int { // ERROR "leaking param: x$"
889- m := map [* int ]* int {nil : x } // ERROR "map\[\*int\]\*int literal does not escape$"
889+ m := map [* int ]* int {nil : x } // ERROR "map\[\*int\]\*int{...} does not escape$"
890890 return m [nil ]
891891}
892892
893893func foo111 (x * int ) * int { // ERROR "leaking param: x to result ~r1 level=0"
894- m := []* int {x } // ERROR "\[\]\*int literal does not escape$"
894+ m := []* int {x } // ERROR "\[\]\*int{...} does not escape$"
895895 return m [0 ]
896896}
897897
@@ -906,7 +906,7 @@ func foo113(x *int) *int { // ERROR "leaking param: x to result ~r1 level=0$"
906906}
907907
908908func foo114 (x * int ) * int { // ERROR "leaking param: x to result ~r1 level=0$"
909- m := & Bar {ii : x } // ERROR "&Bar literal does not escape$"
909+ m := & Bar {ii : x } // ERROR "&Bar{...} does not escape$"
910910 return m .ii
911911}
912912
@@ -1343,8 +1343,8 @@ func foo140() interface{} {
13431343 X string
13441344 T * T
13451345 }
1346- t := & T {} // ERROR "&T literal escapes to heap$"
1347- return U { // ERROR "U literal escapes to heap$"
1346+ t := & T {} // ERROR "&T{} escapes to heap$"
1347+ return U { // ERROR "U{...} escapes to heap$"
13481348 X : t .X ,
13491349 T : t ,
13501350 }
@@ -1530,7 +1530,7 @@ type V struct {
15301530}
15311531
15321532func NewV (u U ) * V { // ERROR "leaking param: u$"
1533- return & V {u .String ()} // ERROR "&V literal escapes to heap$"
1533+ return & V {u .String ()} // ERROR "&V{...} escapes to heap$"
15341534}
15351535
15361536func foo152 () {
@@ -1571,21 +1571,21 @@ type Lit struct {
15711571func ptrlitNoescape () {
15721572 // Both literal and element do not escape.
15731573 i := 0
1574- x := & Lit {& i } // ERROR "&Lit literal does not escape$"
1574+ x := & Lit {& i } // ERROR "&Lit{...} does not escape$"
15751575 _ = x
15761576}
15771577
15781578func ptrlitNoEscape2 () {
15791579 // Literal does not escape, but element does.
15801580 i := 0 // ERROR "moved to heap: i$"
1581- x := & Lit {& i } // ERROR "&Lit literal does not escape$"
1581+ x := & Lit {& i } // ERROR "&Lit{...} does not escape$"
15821582 sink = * x
15831583}
15841584
15851585func ptrlitEscape () {
15861586 // Both literal and element escape.
15871587 i := 0 // ERROR "moved to heap: i$"
1588- x := & Lit {& i } // ERROR "&Lit literal escapes to heap$"
1588+ x := & Lit {& i } // ERROR "&Lit{...} escapes to heap$"
15891589 sink = x
15901590}
15911591
@@ -1760,18 +1760,18 @@ func stringtoslicerune2() {
17601760}
17611761
17621762func slicerunetostring0 () {
1763- r := []rune {1 , 2 , 3 } // ERROR "\[\]rune literal does not escape$"
1763+ r := []rune {1 , 2 , 3 } // ERROR "\[\]rune{...} does not escape$"
17641764 s := string (r ) // ERROR "string\(r\) does not escape$"
17651765 _ = s
17661766}
17671767
17681768func slicerunetostring1 () string {
1769- r := []rune {1 , 2 , 3 } // ERROR "\[\]rune literal does not escape$"
1769+ r := []rune {1 , 2 , 3 } // ERROR "\[\]rune{...} does not escape$"
17701770 return string (r ) // ERROR "string\(r\) escapes to heap$"
17711771}
17721772
17731773func slicerunetostring2 () {
1774- r := []rune {1 , 2 , 3 } // ERROR "\[\]rune literal does not escape$"
1774+ r := []rune {1 , 2 , 3 } // ERROR "\[\]rune{...} does not escape$"
17751775 sink = string (r ) // ERROR "string\(r\) escapes to heap$"
17761776}
17771777
0 commit comments