mirror of
https://github.com/apple/swift-collections
synced 2026-11-30 05:18:44 +00:00
[ContainersPreview] Ref: Disable Builtin.Borrow for now
This commit is contained in:
2 files changed
+7
-4
No files matched your search
@@ -86,6 +86,9 @@ var defines: [SwiftSetting] = [
|
||||
|
||||
// Enables longer, more exhaustive tests.
|
||||
// .define("COLLECTIONS_LONG_TESTS"),
|
||||
|
||||
// Enable the use of `Builtin.Borrow` in `struct Ref`.
|
||||
// .define("COLLECTIONS_BORROW_BUILTIN")
|
||||
]
|
||||
|
||||
let availabilityMacros: KeyValuePairs<String, String> = [
|
||||
|
||||
@@ -17,7 +17,7 @@ import Builtin
|
||||
@available(*, deprecated, renamed: "Ref")
|
||||
public typealias Borrow = Ref
|
||||
|
||||
#if compiler(>=6.4)
|
||||
#if compiler(>=6.4) && COLLECTIONS_BORROW_BUILTIN
|
||||
/// A safe reference allowing in-place reads to a shared value.
|
||||
@available(SwiftStdlib 5.0, *)
|
||||
@frozen
|
||||
@@ -71,7 +71,7 @@ extension Ref where Value: ~Copyable {
|
||||
}
|
||||
}
|
||||
|
||||
#else // compiler(>=6.3) && compiler(<6.4)
|
||||
#else
|
||||
|
||||
/// A safe reference allowing in-place reads to a shared value.
|
||||
@available(SwiftStdlib 5.0, *)
|
||||
@@ -141,7 +141,7 @@ extension Ref where Value: ~Copyable {
|
||||
unsafeAddress pointer: UnsafePointer<Value>,
|
||||
copying owner: borrowing Owner
|
||||
) {
|
||||
#if compiler(>=6.4)
|
||||
#if compiler(>=6.4) && COLLECTIONS_BORROW_BUILTIN
|
||||
_builtin = unsafe Builtin.makeBorrow(pointer.pointee)
|
||||
#else
|
||||
_pointer = pointer
|
||||
@@ -151,7 +151,7 @@ extension Ref where Value: ~Copyable {
|
||||
|
||||
@available(SwiftStdlib 5.0, *)
|
||||
extension Ref where Value: ~Copyable {
|
||||
#if compiler(>=6.4)
|
||||
#if compiler(>=6.4) && COLLECTIONS_BORROW_BUILTIN
|
||||
@_alwaysEmitIntoClient
|
||||
@available(*, deprecated, renamed: "value")
|
||||
public subscript() -> Value {
|
||||
|
||||
Reference in new issue
Block a user