mirror of https://github.com/golang/go.git
Revert "cmd/vet: teach vet about ast.AliasSpec"
This reverts commit aa8c8e770e.
Reason: Decision to back out current alias implementation.
For #16339.
Change-Id: I4db9a8d6b3625c794be9d2f1ff0e9c047f383d28
Reviewed-on: https://go-review.googlesource.com/32827
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Chris Manghane <cmang@golang.org>
This commit is contained in:
parent
8e970536df
commit
26e43779f1
|
|
@ -61,10 +61,7 @@ func checkCopyLocksGenDecl(f *File, gd *ast.GenDecl) {
|
|||
return
|
||||
}
|
||||
for _, spec := range gd.Specs {
|
||||
valueSpec, ok := spec.(*ast.ValueSpec)
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
valueSpec := spec.(*ast.ValueSpec)
|
||||
for i, x := range valueSpec.Values {
|
||||
if path := lockPathRhs(f, x); path != nil {
|
||||
f.Badf(x.Pos(), "variable declaration copies lock value to %v: %v", valueSpec.Names[i].Name, path)
|
||||
|
|
|
|||
|
|
@ -188,7 +188,8 @@ func checkShadowDecl(f *File, d *ast.GenDecl) {
|
|||
for _, spec := range d.Specs {
|
||||
valueSpec, ok := spec.(*ast.ValueSpec)
|
||||
if !ok {
|
||||
continue
|
||||
f.Badf(spec.Pos(), "invalid AST: var GenDecl not ValueSpec")
|
||||
return
|
||||
}
|
||||
// Don't complain about deliberate redeclarations of the form
|
||||
// var i = i
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
package testdata
|
||||
|
||||
import (
|
||||
"runtime"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
)
|
||||
|
|
@ -157,11 +156,3 @@ func AtomicTypesCheck() {
|
|||
vP := &vX
|
||||
vZ := &atomic.Value{}
|
||||
}
|
||||
|
||||
// ensure we don't crash when we encounter aliases; issue 17755
|
||||
|
||||
var _ => runtime.MemProfileRate
|
||||
|
||||
const _ => runtime.Compiler
|
||||
|
||||
type _ => sync.Mutex
|
||||
|
|
|
|||
Loading…
Reference in New Issue