Update to go1.24.0
This commit is contained in:
@@ -73,6 +73,7 @@ func l(x, y int) (int, int, error) { // ERROR "can inline l"
|
||||
f := e
|
||||
f(nil) // ERROR "inlining call to l.func1"
|
||||
}
|
||||
_ = e // prevent simple deadcode elimination
|
||||
return y, x, nil
|
||||
}
|
||||
|
||||
@@ -109,6 +110,7 @@ func p() int { // ERROR "can inline p"
|
||||
|
||||
func q(x int) int { // ERROR "can inline q"
|
||||
foo := func() int { return x * 2 } // ERROR "can inline q.func1" "func literal does not escape"
|
||||
_ = foo // prevent simple deadcode elimination
|
||||
return foo() // ERROR "inlining call to q.func1"
|
||||
}
|
||||
|
||||
@@ -121,6 +123,8 @@ func r(z int) int { // ERROR "can inline r"
|
||||
return 2*y + x*z
|
||||
}(x) // ERROR "inlining call to r.func2.1"
|
||||
}
|
||||
_ = foo // prevent simple deadcode elimination
|
||||
_ = bar // prevent simple deadcode elimination
|
||||
return foo(42) + bar(42) // ERROR "inlining call to r.func1" "inlining call to r.func2" "inlining call to r.r.func2.func3"
|
||||
}
|
||||
|
||||
@@ -128,7 +132,8 @@ func s0(x int) int { // ERROR "can inline s0"
|
||||
foo := func() { // ERROR "can inline s0.func1" "func literal does not escape"
|
||||
x = x + 1
|
||||
}
|
||||
foo() // ERROR "inlining call to s0.func1"
|
||||
foo() // ERROR "inlining call to s0.func1"
|
||||
_ = foo // prevent simple deadcode elimination
|
||||
return x
|
||||
}
|
||||
|
||||
@@ -137,6 +142,7 @@ func s1(x int) int { // ERROR "can inline s1"
|
||||
return x
|
||||
}
|
||||
x = x + 1
|
||||
_ = foo // prevent simple deadcode elimination
|
||||
return foo() // ERROR "inlining call to s1.func1"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user