1
0
mirror of https://github.com/golang/go synced 2024-11-19 02:14:43 -07:00

cmd/compile: remove -s flag

This is better handled by tools like cmd/gofmt, which can
automatically rewrite the source code and already supports a syntactic
version of this simplification. (go/types can be used if
type-sensitive simplification is actually necessary.)

Change-Id: I51332a8f3ff4ab3087bc6b43a491c6d92b717228
Reviewed-on: https://go-review.googlesource.com/c/go/+/197118
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Matthew Dempsky 2019-09-25 00:14:58 -07:00
parent f346a4c44c
commit 3e428363c4
2 changed files with 0 additions and 6 deletions

View File

@ -238,7 +238,6 @@ func Main(archInit func(*Arch)) {
if sys.RaceDetectorSupported(objabi.GOOS, objabi.GOARCH) {
flag.BoolVar(&flag_race, "race", false, "enable race detector")
}
objabi.Flagcount("s", "warn about composite literals that can be simplified", &Debug['s'])
if enableTrace {
flag.BoolVar(&trace, "t", false, "trace type-checking")
}

View File

@ -2747,11 +2747,6 @@ func pushtype(n *Node, t *types.Type) {
n.Right = typenod(t)
n.SetImplicit(true) // don't print
n.Right.SetImplicit(true) // * is okay
} else if Debug['s'] != 0 {
n.Right = typecheck(n.Right, ctxType)
if n.Right.Type != nil && types.Identical(n.Right.Type, t) {
fmt.Printf("%v: redundant type: %v\n", n.Line(), t)
}
}
}