From: Cuong Manh Le Date: Wed, 16 Jun 2021 07:52:05 +0000 (+0700) Subject: [dev.typeparams] all: merge master (785a8f6) into dev.typeparams X-Git-Tag: go1.18beta1~1818^2^2~356 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=4d6f9d60cf;p=gostls13.git [dev.typeparams] all: merge master (785a8f6) into dev.typeparams - test/run.go CL 328050 added fixedbugs/issue46749.go to -G=3 excluded files list Merge List: + 2021-06-16 785a8f677f cmd/compile: better error message for invalid untyped operation + 2021-06-16 a752bc0746 syscall: fix TestGroupCleanupUserNamespace test failure on Fedora + 2021-06-15 d77f4c0c5c net/http: improve some server docs + 2021-06-15 219fe9d547 cmd/go: ignore UTF8 BOM when reading source code + 2021-06-15 723f199edd cmd/link: set correct flags in .dynamic for PIE buildmode + 2021-06-15 4d2d89ff42 cmd/go, go/build: update docs to use //go:build syntax + 2021-06-15 033d885315 doc/go1.17: document go run pkg@version + 2021-06-15 ea8612ef42 syscall: disable c-shared test when no cgo, for windows/arm + 2021-06-15 abc56fd1a0 internal/bytealg: remove duplicate go:build line + 2021-06-15 4061d3463b syscall: rewrite handle inheritance test to use C rather than Powershell + 2021-06-15 cf4e3e3d3b reflect: explain why convertible or comparable types may still panic + 2021-06-14 7841cb14d9 doc/go1.17: assorted fixes + 2021-06-14 8a5a6f46dc debug/elf: don't apply DWARF relocations for ET_EXEC binaries + 2021-06-14 9d13f8d43e runtime: update the variable name in comment + 2021-06-14 0fd20ed5b6 reflect: use same conversion panic in reflect and runtime + 2021-06-14 6bbb0a9d4a cmd/internal/sys: mark windows/arm64 as c-shared-capable + 2021-06-14 d4f34f8c63 doc/go1.17: reword "results" in stack trace printing Change-Id: I60d1f67c4d48cd4093c350fc89bd60c454d23944 --- 4d6f9d60cf597a49b918fc1d445251d6b643f860 diff --cc test/run.go index 656519e301,d7f5d02391..1273b8edd6 --- a/test/run.go +++ b/test/run.go @@@ -2088,98 -2002,5 +2088,99 @@@ var excludedFiles = map[string]bool "fixedbugs/issue7525c.go": true, // types2 reports init cycle error on different line - ok otherwise "fixedbugs/issue7525d.go": true, // types2 reports init cycle error on different line - ok otherwise "fixedbugs/issue7525e.go": true, // types2 reports init cycle error on different line - ok otherwise + "fixedbugs/issue7525.go": true, // types2 reports init cycle error on different line - ok otherwise + "fixedbugs/issue46749.go": true, // types2 reports can not convert error instead of type mismatched + "fixedbugs/issue9691.go": true, // "cannot assign to int(.autotmp_4)" (probably irgen's fault) + + // tests that rely on -m diagnostics, which currently differ with -G=3 + // + // TODO(mdempsky): Triage, though most of the issues seem to fall into: + // - Anonymous result parameters given different names (e.g., ~r0 vs ~r1) + // - Some escape analysis diagnostics being printed without position information + // - Some expressions printed differently (e.g., "int(100)" instead + // of "100" or "&composite literal" instead of "&[4]int{...}"). + "closure3.go": true, + "escape2.go": true, + "escape2n.go": true, + "escape4.go": true, + "escape_calls.go": true, + "escape_field.go": true, + "escape_iface.go": true, + "escape_indir.go": true, + "escape_level.go": true, + "escape_map.go": true, + "escape_param.go": true, + "escape_slice.go": true, + "escape_struct_param1.go": true, + "escape_struct_param2.go": true, + "fixedbugs/issue12006.go": true, + "fixedbugs/issue13799.go": true, + "fixedbugs/issue21709.go": true, + "fixedbugs/issue31573.go": true, + "fixedbugs/issue37837.go": true, + "fixedbugs/issue39292.go": true, + "fixedbugs/issue7921.go": true, + "inline.go": true, +} + +// splitQuoted splits the string s around each instance of one or more consecutive +// white space characters while taking into account quotes and escaping, and +// returns an array of substrings of s or an empty list if s contains only white space. +// Single quotes and double quotes are recognized to prevent splitting within the +// quoted region, and are removed from the resulting substrings. If a quote in s +// isn't closed err will be set and r will have the unclosed argument as the +// last element. The backslash is used for escaping. +// +// For example, the following string: +// +// a b:"c d" 'e''f' "g\"" +// +// Would be parsed as: +// +// []string{"a", "b:c d", "ef", `g"`} +// +// [copied from src/go/build/build.go] +func splitQuoted(s string) (r []string, err error) { + var args []string + arg := make([]rune, len(s)) + escaped := false + quoted := false + quote := '\x00' + i := 0 + for _, rune := range s { + switch { + case escaped: + escaped = false + case rune == '\\': + escaped = true + continue + case quote != '\x00': + if rune == quote { + quote = '\x00' + continue + } + case rune == '"' || rune == '\'': + quoted = true + quote = rune + continue + case unicode.IsSpace(rune): + if quoted || i > 0 { + quoted = false + args = append(args, string(arg[:i])) + i = 0 + } + continue + } + arg[i] = rune + i++ + } + if quoted || i > 0 { + args = append(args, string(arg[:i])) + } + if quote != 0 { + err = errors.New("unclosed quote") + } else if escaped { + err = errors.New("unfinished escaping") + } + return args, err }