cmd/compile/internal/types2: review of decl.go
cmd/compile/internal/types2: review of decl.go

The changes between (equivalent, and reviewed) go/types/decl.go
and decl.go can be seen by comparing patchset 1 and 2. The actual
changes are removing the "// UNREVIEWED" marker and a minor comment
update.

The primary differences to go/types/decl.go are:
- use of syntax rather than go/ast package
- use of error_ objects to collect follow-on error info
- use of check.conf.Trace rather than global trace flag
- more aggressively marking variables as used in the presence errors
- not using a walkDecl abstraction for const/var/type declarations

Change-Id: I5cf26779c9939b686a3dbaa4d38fdd0c154a92ca
Reviewed-on: https://go-review.googlesource.com/c/go/+/305570
Trust: Robert Griesemer <a6752097faebf1f02d80107d77a9be009089afe3@golang.org>
Reviewed-by: Robert Findley <9179eee875d1ee628c37fb47d7e749e855ffd21f@google.com>

cloudflare/go,CAFxX/go,cloudflare/go,nawawi/go,cloudflare/go,golang/go,golang/go,cloudflare/go,nawawi/go,CAFxX/go,nawawi/go,golang/go,CAFxX/go,nawawi/go,golang/go,CAFxX/go,cloudflare/go,cloudflare/go,nawawi/go,CAFxX/go,CAFxX/go,cloudflare/go,golang/go,nawawi/go,nawawi/go,golang/go,cloudflare/go,golang/go,CAFxX/go,golang/go,CAFxX/go,nawawi/go