Skip to content

Commit 83702cc

Browse files
authored
Add an @available renamed attribute for initializeFrom<C : Collection>(_ : C). (#4444)
rdar:27941024 [3.0 migration] Missing fix-it for UnsafePointer<T>.initializeFrom<C : Collection>(_ C)
1 parent 580372b commit 83702cc

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

stdlib/public/core/UnsafePointer.swift.gyb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,11 @@ extension ${Self} {
609609
Builtin.unreachable()
610610
}
611611

612+
@available(*, unavailable, renamed: "initialize(from:)")
613+
public func initializeFrom<C : Collection>(_ source: C) {
614+
Builtin.unreachable()
615+
}
616+
612617
@available(*, unavailable, renamed: "initialize(from:count:)")
613618
public func initializeFrom(_ source: UnsafePointer<Pointee>, count: Int) {
614619
Builtin.unreachable()

test/1_stdlib/Renames.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -606,6 +606,10 @@ func _UnsafePointer<T>(x: UnsafeMutablePointer<T>, e: T) {
606606
ptr2.deallocate(capacity: 1)
607607
}
608608

609+
func _UnsafePointer<T, C : Collection>(x: UnsafeMutablePointer<T>, c: C) where C.Iterator.Element == T {
610+
x.initializeFrom(c) // expected-error {{'initializeFrom' has been renamed to 'initialize(from:)'}}
611+
}
612+
609613
func _VarArgs() {
610614
func fn1(_: CVarArgType) {} // expected-error {{'CVarArgType' has been renamed to 'CVarArg'}} {{15-26=CVarArg}}{{none}}
611615
func fn2(_: VaListBuilder) {} // expected-error {{'VaListBuilder' is unavailable}} {{none}}

0 commit comments

Comments
 (0)