]> Cypherpunks.ru repositories - gostls13.git/commitdiff
[dev.typeparams] all: merge master (37f9a8f) into dev.typeparams
authorCuong Manh Le <cuong.manhle.vn@gmail.com>
Fri, 25 Jun 2021 04:17:04 +0000 (11:17 +0700)
committerCuong Manh Le <cuong.manhle.vn@gmail.com>
Fri, 25 Jun 2021 04:34:56 +0000 (11:34 +0700)
Conflicts:

- src/go/types/check_test.go

  CL 330629 fixed a bug in package qualification logic

- src/internal/buildcfg/exp.go

  CL 329930 make parseExperiments get go arch string as input param

Merge List:

+ 2021-06-25 37f9a8f69d go/types: fix a bug in package qualification logic
+ 2021-06-24 c309c89db5 reflect: document that InterfaceData is a low-entropy RNG
+ 2021-06-24 cce621431a cmd/compile: fix wrong type in SSA generation for OSLICE2ARRPTR
+ 2021-06-24 600a2a4ffb cmd/go: don't try to add replaced versions that won't be selected
+ 2021-06-24 a9bb38222a net: remove hard-coded timeout in dialClosedPort test helper
+ 2021-06-24 86d72fa2cb time: handle invalid UTF-8 byte sequences in quote to prevent panic
+ 2021-06-24 44a12e5f33 cmd/go: search breadth-first instead of depth-first for test dependency cycles
+ 2021-06-24 73496e0df0 net: use absDomainName in the Windows lookupPTR test helper
+ 2021-06-24 222ed1b38a os: enable TestFifoEOF on openbsd
+ 2021-06-22 0ebd5a8de0 cmd/go: update ToolTags based on GOARCH value
+ 2021-06-22 5bd09e5efc spec: unsafe.Add/Slice are not permitted in statement context
+ 2021-06-22 666315b4d3 runtime/internal/atomic: remove incorrect pointer indirection in comment
+ 2021-06-22 63daa774b5 go/types: guard against checking instantiation when generics is disabled
+ 2021-06-22 197a5ee2ab cmd/gofmt: remove stale documentation for the -G flag
+ 2021-06-22 9afd158eb2 go/parser: parse an ast.IndexExpr for a[]
+ 2021-06-21 1bd5a20e3c cmd/go: add a -go flag to 'go mod graph'
+ 2021-06-21 761edf71f6 cmd/internal/moddeps: use a temporary directory for GOMODCACHE if needed
+ 2021-06-21 a0400420ad cmd/internal/moddeps: use -mod=readonly instead of -mod=mod
+ 2021-06-21 3f9ec83b10 cmd/go: document GOPPC64 environment variable
+ 2021-06-21 20bdfba325 go/scanner: fall back to next() when encountering 0 bytes in parseIdentifier
+ 2021-06-21 44f9a3566c database/sql: fix deadlock test in prepare statement

Change-Id: I16490e8ea70ee65081f467223857033842da513a

1  2 
src/cmd/compile/internal/ssagen/ssa.go
src/go/parser/parser.go
src/go/scanner/scanner.go
src/go/scanner/scanner_test.go
src/go/types/check_test.go
src/go/types/issues_test.go
src/go/types/testdata/check/issues.src
src/go/types/testdata/examples/functions.go2
src/go/types/typexpr.go
src/internal/buildcfg/exp.go
src/reflect/value.go

Simple merge
Simple merge
Simple merge
index 0926ac743190e8473674515662563c29c55d436a,c85a8e46fbb6f9fb01f29f915641d9dcdfaf9632..a5720f992e944d3090a86d9a8793ed9f8e2f311b
@@@ -202,7 -202,7 +202,7 @@@ func asGoVersion(s string) string 
        return ""
  }
  
- func testFiles(t *testing.T, sizes Sizes, filenames []string, srcs [][]byte, manual bool) {
 -func checkFiles(t *testing.T, sizes Sizes, goVersion string, filenames []string, srcs [][]byte, manual bool, imp Importer) {
++func testFiles(t *testing.T, sizes Sizes, filenames []string, srcs [][]byte, manual bool, imp Importer) {
        if len(filenames) == 0 {
                t.Fatal("no source files")
        }
@@@ -339,7 -325,7 +345,7 @@@ func TestManual(t *testing.T) 
  func TestLongConstants(t *testing.T) {
        format := "package longconst\n\nconst _ = %s\nconst _ = %s // ERROR excessively long constant"
        src := fmt.Sprintf(format, strings.Repeat("1", 9999), strings.Repeat("1", 10001))
-       testFiles(t, nil, []string{"longconst.go"}, [][]byte{[]byte(src)}, false)
 -      checkFiles(t, nil, "", []string{"longconst.go"}, [][]byte{[]byte(src)}, false, nil)
++      testFiles(t, nil, []string{"longconst.go"}, [][]byte{[]byte(src)}, false, nil)
  }
  
  // TestIndexRepresentability tests that constant index operands must
  // represent larger values.
  func TestIndexRepresentability(t *testing.T) {
        const src = "package index\n\nvar s []byte\nvar _ = s[int64 /* ERROR \"int64\\(1\\) << 40 \\(.*\\) overflows int\" */ (1) << 40]"
-       testFiles(t, &StdSizes{4, 4}, []string{"index.go"}, [][]byte{[]byte(src)}, false)
 -      checkFiles(t, &StdSizes{4, 4}, "", []string{"index.go"}, [][]byte{[]byte(src)}, false, nil)
++      testFiles(t, &StdSizes{4, 4}, []string{"index.go"}, [][]byte{[]byte(src)}, false, nil)
  }
  
  func TestIssue46453(t *testing.T) {
                t.Skip("type params are enabled")
        }
        const src = "package p\ntype _ comparable // ERROR \"undeclared name: comparable\""
-       testFiles(t, nil, []string{"issue46453.go"}, [][]byte{[]byte(src)}, false)
 -      checkFiles(t, nil, "", []string{"issue46453.go"}, [][]byte{[]byte(src)}, false, nil)
++      testFiles(t, nil, []string{"issue46453.go"}, [][]byte{[]byte(src)}, false, nil)
  }
  
 -func TestCheck(t *testing.T)     { DefPredeclaredTestFuncs(); testDir(t, "check") }
 -func TestExamples(t *testing.T)  { testDir(t, "examples") }
 -func TestFixedbugs(t *testing.T) { testDir(t, "fixedbugs") }
 +func TestCheck(t *testing.T)     { DefPredeclaredTestFuncs(); testDirFiles(t, "testdata/check", false) }
 +func TestExamples(t *testing.T)  { testDirFiles(t, "testdata/examples", false) }
 +func TestFixedbugs(t *testing.T) { testDirFiles(t, "testdata/fixedbugs", false) }
  
 -func testDir(t *testing.T, dir string) {
 +func testDirFiles(t *testing.T, dir string, manual bool) {
        testenv.MustHaveGoBuild(t)
 +      dir = filepath.FromSlash(dir)
  
 -      dir = filepath.Join("testdata", dir)
        fis, err := os.ReadDir(dir)
        if err != nil {
                t.Error(err)
@@@ -415,5 -391,5 +421,5 @@@ func testPkg(t *testing.T, filenames []
                }
                srcs[i] = src
        }
-       testFiles(t, nil, filenames, srcs, manual)
 -      checkFiles(t, nil, goVersion, filenames, srcs, manual, nil)
++      testFiles(t, nil, filenames, srcs, manual, nil)
  }
index 44926919efe06162dcc20e65d3fa2d987941e7e7,519e19953645d8e8c4f97d0058cd29ebdb9ffdc3..51995af30afd39f7c174abaa1d61dfc9421277bb
@@@ -593,26 -632,9 +632,9 @@@ var _ T = template /* ERROR cannot use.
        if err != nil {
                t.Fatalf("package a failed to typecheck: %v", err)
        }
-       conf := Config{Importer: importHelper{pkg: a, fallback: importer.Default()}}
-       // Packages should be fully qualified when there is ambiguity within the
-       // error string itself.
-       bast := mustParse(t, bsrc)
-       _, err = conf.Check(bast.Name.Name, fset, []*ast.File{bast}, nil)
-       if err == nil {
-               t.Fatal("package b had no errors")
-       }
-       if !strings.Contains(err.Error(), "text/template") || !strings.Contains(err.Error(), "html/template") {
-               t.Errorf("type checking error for b does not disambiguate package template: %q", err)
-       }
+       imp := importHelper{pkg: a, fallback: importer.Default()}
  
-       // ...and also when there is any ambiguity in reachable packages.
-       cast := mustParse(t, csrc)
-       _, err = conf.Check(cast.Name.Name, fset, []*ast.File{cast}, nil)
-       if err == nil {
-               t.Fatal("package c had no errors")
-       }
-       if !strings.Contains(err.Error(), "html/template") {
-               t.Errorf("type checking error for c does not disambiguate package template: %q", err)
-       }
 -      checkFiles(t, nil, "", []string{"b.go"}, [][]byte{[]byte(bsrc)}, false, imp)
 -      checkFiles(t, nil, "", []string{"c.go"}, [][]byte{[]byte(csrc)}, false, imp)
 -      checkFiles(t, nil, "", []string{"t.go"}, [][]byte{[]byte(tsrc)}, false, imp)
++      testFiles(t, nil, []string{"b.go"}, [][]byte{[]byte(bsrc)}, false, imp)
++      testFiles(t, nil, []string{"c.go"}, [][]byte{[]byte(csrc)}, false, imp)
++      testFiles(t, nil, []string{"t.go"}, [][]byte{[]byte(tsrc)}, false, imp)
  }
Simple merge
index e78f98799918c472aab1c9e53a3d0fd90293547f,640aa1934db55ae1f136a90de153fc598da50be2..e87b6221f1eae2f47f683df8191537aa19aabc8f
@@@ -18,10 -18,9 +18,10 @@@ import 
  //
  // (This is not necessarily the set of experiments the compiler itself
  // was built with.)
- var Experiment goexperiment.Flags = parseExperiments()
+ var Experiment goexperiment.Flags = parseExperiments(GOARCH)
  
 -var regabiSupported = GOARCH == "amd64" && (GOOS == "android" || GOOS == "linux" || GOOS == "darwin" || GOOS == "windows")
 +var regabiSupported = GOARCH == "amd64" || GOARCH == "arm64"
 +var regabiDeveloping = false
  
  // experimentBaseline specifies the experiment flags that are enabled by
  // default in the current toolchain. This is, in effect, the "control"
@@@ -95,14 -98,12 +95,14 @@@ func parseExperiments(goarch string) go
                }
        }
  
 -      // regabi is only supported on amd64.
 -      if goarch != "amd64" {
 +      // regabiwrappers is always enabled on amd64.
-       if GOARCH == "amd64" {
++      if goarch == "amd64" {
 +              flags.RegabiWrappers = true
 +      }
 +      // regabi is only supported on amd64 and arm64.
-       if GOARCH != "amd64" && GOARCH != "arm64" {
++      if goarch != "amd64" && goarch != "arm64" {
                flags.RegabiWrappers = false
 -              flags.RegabiG = false
                flags.RegabiReflect = false
 -              flags.RegabiDefer = false
                flags.RegabiArgs = false
        }
        // Check regabi dependencies.
Simple merge