cmd/compile: remove incannedimport

This used to be used to give special semantics to the builtin
definitions of package runtime and unsafe, but none of those are
relevant anymore:

- The builtin runtime and unsafe packages do not risk triggering false
  import cycles since they no longer contain `import "runtime"`.

- bimport.go never creates ODCLTYPE, so no need to special case them.

- "incannedimport != 0" is only true when "importpkg != nil" anyway,
  so "incannedimport == 0 && importpkg == nil" is equivalent to just
  "importpkg == nil".

Change-Id: I076f15dd705d4962e7a4c33972e304ef67e7effb
Reviewed-on: https://go-review.googlesource.com/29084
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Matthew Dempsky 2016-09-12 13:39:54 -07:00
parent 4c83d29144
commit 1ee5446414
4 changed files with 3 additions and 10 deletions

View file

@ -289,7 +289,7 @@ func (p *importer) pkg() *Pkg {
} else if pkg.Name != name {
Yyerror("conflicting package names %s and %s for path %q", pkg.Name, name, path)
}
if incannedimport == 0 && myimportpath != "" && path == myimportpath {
if myimportpath != "" && path == myimportpath {
Yyerror("import %q: package depends on %q (import cycle)", importpkg.Path, path)
errorexit()
}