Skip to content

Commit 435ba8d

Browse files
committed
all: merge master (ab04c19) into gopls-release-branch.0.18
Also add back the replace directive. For golang/go#71607 Merge List: + 2025-02-13 ab04c19 gopls/internal/analysis/modernize: improve rangeint transformation + 2025-02-13 ddd4bde gopls/internal/golang: avoid PackageSymbols errors with missing packages + 2025-02-13 44b61a1 x/tools: eliminate various unparen (et al) helpers + 2025-02-13 d0d86e4 x/tools: run gopls/internal/analysis/gofix/main.go -fix + 2025-02-13 2f1b076 x/tools: add //go:fix inline + 2025-02-12 86f13a9 gopls/internal/analysis/gofix: rename local + 2025-02-12 5762944 gopls/internal/analysis/gofix: check package visibility + 2025-02-12 f9aad70 go/types/typeutil: avoid shifting uintptr by 32 on 32-bit archs Change-Id: Iec742aa4d8dc370d050b8f33a5dd11838cdb7888
2 parents 2639392 + ab04c19 commit 435ba8d

File tree

42 files changed

+199
-148
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+199
-148
lines changed

go.mod

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,5 @@ require (
1212
)
1313

1414
require golang.org/x/sys v0.30.0 // indirect
15+
16+
replace golang.org/x/tools => ../

go/analysis/checker/checker.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ func (act *Action) exportPackageFact(fact analysis.Fact) {
594594

595595
func factType(fact analysis.Fact) reflect.Type {
596596
t := reflect.TypeOf(fact)
597-
if t.Kind() != reflect.Ptr {
597+
if t.Kind() != reflect.Pointer {
598598
log.Fatalf("invalid Fact type: got %T, want pointer", fact)
599599
}
600600
return t

go/analysis/passes/copylock/copylock.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ var lockerType *types.Interface
378378

379379
// Construct a sync.Locker interface type.
380380
func init() {
381-
nullary := types.NewSignature(nil, nil, nil, false) // func()
381+
nullary := types.NewSignatureType(nil, nil, nil, nil, nil, false) // func()
382382
methods := []*types.Func{
383383
types.NewFunc(token.NoPos, nil, "Lock", nullary),
384384
types.NewFunc(token.NoPos, nil, "Unlock", nullary),

go/analysis/passes/unusedresult/unusedresult.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,7 @@ func run(pass *analysis.Pass) (interface{}, error) {
130130
}
131131

132132
// func() string
133-
var sigNoArgsStringResult = types.NewSignature(nil, nil,
134-
types.NewTuple(types.NewParam(token.NoPos, nil, "", types.Typ[types.String])),
135-
false)
133+
var sigNoArgsStringResult = types.NewSignatureType(nil, nil, nil, nil, types.NewTuple(types.NewParam(token.NoPos, nil, "", types.Typ[types.String])), false)
136134

137135
type stringSetFlag map[string]bool
138136

go/analysis/validate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func Validate(analyzers []*Analyzer) error {
6363
return fmt.Errorf("fact type %s registered by two analyzers: %v, %v",
6464
t, a, prev)
6565
}
66-
if t.Kind() != reflect.Ptr {
66+
if t.Kind() != reflect.Pointer {
6767
return fmt.Errorf("%s: fact type %s is not a pointer", a, t)
6868
}
6969
factTypes[t] = a

go/ast/astutil/rewrite.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ type application struct {
183183

184184
func (a *application) apply(parent ast.Node, name string, iter *iterator, n ast.Node) {
185185
// convert typed nil into untyped nil
186-
if v := reflect.ValueOf(n); v.Kind() == reflect.Ptr && v.IsNil() {
186+
if v := reflect.ValueOf(n); v.Kind() == reflect.Pointer && v.IsNil() {
187187
n = nil
188188
}
189189

go/ast/astutil/util.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@ import "go/ast"
88

99
// Unparen returns e with any enclosing parentheses stripped.
1010
// Deprecated: use [ast.Unparen].
11+
//
12+
//go:fix inline
1113
func Unparen(e ast.Expr) ast.Expr { return ast.Unparen(e) }

go/callgraph/vta/propagation_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ func testSuite() map[string]*vtaGraph {
203203
a := newNamedType("A")
204204
b := newNamedType("B")
205205
c := newNamedType("C")
206-
sig := types.NewSignature(nil, types.NewTuple(), types.NewTuple(), false)
206+
sig := types.NewSignatureType(nil, nil, nil, types.NewTuple(), types.NewTuple(), false)
207207

208208
f1 := &ssa.Function{Signature: sig}
209209
setName(f1, "F1")

go/internal/gccgoimporter/parser.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ func (p *parser) parseNamedType(nlist []interface{}) types.Type {
619619
p.skipInlineBody()
620620
p.expectEOL()
621621

622-
sig := types.NewSignature(receiver, params, results, isVariadic)
622+
sig := types.NewSignatureType(receiver, nil, nil, params, results, isVariadic)
623623
nt.AddMethod(types.NewFunc(token.NoPos, pkg, name, sig))
624624
}
625625
}
@@ -800,7 +800,7 @@ func (p *parser) parseFunctionType(pkg *types.Package, nlist []interface{}) *typ
800800
params, isVariadic := p.parseParamList(pkg)
801801
results := p.parseResultList(pkg)
802802

803-
*t = *types.NewSignature(nil, params, results, isVariadic)
803+
*t = *types.NewSignatureType(nil, nil, nil, params, results, isVariadic)
804804
return t
805805
}
806806

go/packages/packages.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@ const (
141141
LoadAllSyntax = LoadSyntax | NeedDeps
142142

143143
// Deprecated: NeedExportsFile is a historical misspelling of NeedExportFile.
144+
//
145+
//go:fix inline
144146
NeedExportsFile = NeedExportFile
145147
)
146148

0 commit comments

Comments
 (0)