mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Usage of Span was temporarily behind an experimental feature flag. Now that SE-0447 has been accepted, remove the experimental feature flag and allow Span usage everywhere. Implements rdar://144819992.
17 lines
714 B
Swift
17 lines
714 B
Swift
// REQUIRES: swift_swift_parser
|
|
|
|
// RUN: not %target-swift-frontend %s -swift-version 5 -module-name main -disable-availability-checking -typecheck -plugin-path %swift-plugin-dir -dump-macro-expansions > %t.log 2>&1
|
|
// RUN: %FileCheck --match-full-lines %s < %t.log
|
|
|
|
@_SwiftifyImport(.countedBy(pointer: .param(1), count: "len"), .nonescaping(pointer: .param(1)))
|
|
func myFunc(_ ptr: UnsafeMutablePointer<CInt>, _ len: CInt) {
|
|
}
|
|
|
|
// CHECK: @_alwaysEmitIntoClient
|
|
// CHECK-NEXT: func myFunc(_ ptr: MutableSpan<CInt>) {
|
|
// CHECK-NEXT: return ptr.withUnsafeBufferPointer { _ptrPtr in
|
|
// CHECK-NEXT: return myFunc(_ptrPtr.baseAddress!, CInt(exactly: ptr.count)!)
|
|
// CHECK-NEXT: }
|
|
// CHECK-NEXT: }
|
|
|