@@ -103,7 +103,7 @@ internal struct _ConcreteHashableBox<Base: Hashable>: _AnyHashableBox {
103
103
internal
104
104
func _downCastConditional< T> ( into result: UnsafeMutablePointer < T > ) -> Bool {
105
105
guard let value = _baseHashable as? T else { return false }
106
- result. initialize ( to: value)
106
+ unsafe result. initialize ( to: value)
107
107
return true
108
108
}
109
109
}
@@ -165,8 +165,8 @@ public struct AnyHashable {
165
165
}
166
166
167
167
self . init ( _box: _ConcreteHashableBox ( false ) ) // Dummy value
168
- _withUnprotectedUnsafeMutablePointer ( to: & self ) {
169
- _makeAnyHashableUpcastingToHashableBaseType (
168
+ unsafe _withUnprotectedUnsafeMutablePointer( to: & self ) {
169
+ unsafe _makeAnyHashableUpcastingToHashableBaseType(
170
170
base,
171
171
storingResultInto: $0)
172
172
}
@@ -197,13 +197,13 @@ public struct AnyHashable {
197
197
internal
198
198
func _downCastConditional< T> ( into result: UnsafeMutablePointer < T > ) -> Bool {
199
199
// Attempt the downcast.
200
- if _box. _downCastConditional ( into: result) { return true }
200
+ if unsafe _box. _downCastConditional ( into: result) { return true }
201
201
202
202
#if _runtime(_ObjC)
203
203
// Bridge to Objective-C and then attempt the cast from there.
204
204
// FIXME: This should also work without the Objective-C runtime.
205
205
if let value = _bridgeAnythingToObjectiveC ( _box. _base) as? T {
206
- result. initialize ( to: value)
206
+ unsafe result. initialize ( to: value)
207
207
return true
208
208
}
209
209
#endif
@@ -308,7 +308,7 @@ internal func _makeAnyHashableUsingDefaultRepresentation<H: Hashable>(
308
308
of value: H ,
309
309
storingResultInto result: UnsafeMutablePointer < AnyHashable >
310
310
) {
311
- result. pointee = AnyHashable ( _usingDefaultRepresentationOf: value)
311
+ unsafe result. pointee = AnyHashable ( _usingDefaultRepresentationOf: value)
312
312
}
313
313
314
314
/// Provided by AnyHashable.cpp.
@@ -333,7 +333,7 @@ internal func _convertToAnyHashableIndirect<H: Hashable>(
333
333
_ value: H ,
334
334
_ target: UnsafeMutablePointer < AnyHashable >
335
335
) {
336
- target. initialize ( to: AnyHashable ( value) )
336
+ unsafe target. initialize ( to: AnyHashable ( value) )
337
337
}
338
338
339
339
/// Called by the casting machinery.
@@ -343,5 +343,5 @@ internal func _anyHashableDownCastConditionalIndirect<T>(
343
343
_ value: UnsafePointer < AnyHashable > ,
344
344
_ target: UnsafeMutablePointer < T >
345
345
) -> Bool {
346
- return value. pointee. _downCastConditional ( into: target)
346
+ return unsafe value. pointee . _downCastConditional ( into: target)
347
347
}
0 commit comments