Skip to content

Commit

Permalink
cmd/compile: remove period from "not allowed in runtime" errors
Browse files Browse the repository at this point in the history
We don't punctuate compiler diagnostics.

Change-Id: I19e1f30fbf04f0d1bfe6648fae26beaf3a06ee92
Reviewed-on: https://go-review.googlesource.com/c/go/+/201077
Reviewed-by: Brad Fitzpatrick <[email protected]>
  • Loading branch information
mdempsky committed Oct 14, 2019
1 parent 06b12e6 commit b649bdc
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/cmd/compile/internal/gc/closure.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ func closuredebugruntimecheck(clo *Node) {
}
}
if compiling_runtime && clo.Esc == EscHeap {
yyerrorl(clo.Pos, "heap-allocated closure, not allowed in runtime.")
yyerrorl(clo.Pos, "heap-allocated closure, not allowed in runtime")
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/cmd/compile/internal/gc/esc.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ func moveToHeap(n *Node) {
Dump("MOVE", n)
}
if compiling_runtime {
yyerror("%v escapes to heap, not allowed in runtime.", n)
yyerror("%v escapes to heap, not allowed in runtime", n)
}
if n.Class() == PAUTOHEAP {
Dump("n", n)
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/compile/internal/gc/walk.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ func walkstmt(n *Node) *Node {
v := n.Left
if v.Class() == PAUTOHEAP {
if compiling_runtime {
yyerror("%v escapes to heap, not allowed in runtime.", v)
yyerror("%v escapes to heap, not allowed in runtime", v)
}
if prealloc[v] == nil {
prealloc[v] = callnew(v.Type)
Expand Down
6 changes: 3 additions & 3 deletions test/fixedbugs/issue14999.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
package p

func f(x int) func(int) int {
return func(y int) int { return x + y } // ERROR "heap-allocated closure, not allowed in runtime."
return func(y int) int { return x + y } // ERROR "heap-allocated closure, not allowed in runtime"
}

func g(x int) func(int) int { // ERROR "x escapes to heap, not allowed in runtime."
return func(y int) int { // ERROR "heap-allocated closure, not allowed in runtime."
func g(x int) func(int) int { // ERROR "x escapes to heap, not allowed in runtime"
return func(y int) int { // ERROR "heap-allocated closure, not allowed in runtime"
x += y
return x + y
}
Expand Down

0 comments on commit b649bdc

Please sign in to comment.