@@ -103,7 +103,7 @@ internal struct _ConcreteHashableBox<Base: Hashable>: _AnyHashableBox {
103103 internal
104104 func _downCastConditional< T> ( into result: UnsafeMutablePointer < T > ) -> Bool {
105105 guard let value = _baseHashable as? T else { return false }
106- result. initialize ( to: value)
106+ unsafe result. initialize ( to: value)
107107 return true
108108 }
109109}
@@ -165,8 +165,8 @@ public struct AnyHashable {
165165 }
166166
167167 self . init ( _box: _ConcreteHashableBox ( false ) ) // Dummy value
168- _withUnprotectedUnsafeMutablePointer ( to: & self ) {
169- _makeAnyHashableUpcastingToHashableBaseType (
168+ unsafe _withUnprotectedUnsafeMutablePointer( to: & self ) {
169+ unsafe _makeAnyHashableUpcastingToHashableBaseType(
170170 base,
171171 storingResultInto: $0)
172172 }
@@ -197,13 +197,13 @@ public struct AnyHashable {
197197 internal
198198 func _downCastConditional< T> ( into result: UnsafeMutablePointer < T > ) -> Bool {
199199 // Attempt the downcast.
200- if _box. _downCastConditional ( into: result) { return true }
200+ if unsafe _box. _downCastConditional ( into: result) { return true }
201201
202202 #if _runtime(_ObjC)
203203 // Bridge to Objective-C and then attempt the cast from there.
204204 // FIXME: This should also work without the Objective-C runtime.
205205 if let value = _bridgeAnythingToObjectiveC ( _box. _base) as? T {
206- result. initialize ( to: value)
206+ unsafe result. initialize ( to: value)
207207 return true
208208 }
209209 #endif
@@ -308,7 +308,7 @@ internal func _makeAnyHashableUsingDefaultRepresentation<H: Hashable>(
308308 of value: H ,
309309 storingResultInto result: UnsafeMutablePointer < AnyHashable >
310310) {
311- result. pointee = AnyHashable ( _usingDefaultRepresentationOf: value)
311+ unsafe result. pointee = AnyHashable ( _usingDefaultRepresentationOf: value)
312312}
313313
314314/// Provided by AnyHashable.cpp.
@@ -333,7 +333,7 @@ internal func _convertToAnyHashableIndirect<H: Hashable>(
333333 _ value: H ,
334334 _ target: UnsafeMutablePointer < AnyHashable >
335335) {
336- target. initialize ( to: AnyHashable ( value) )
336+ unsafe target. initialize ( to: AnyHashable ( value) )
337337}
338338
339339/// Called by the casting machinery.
@@ -343,5 +343,5 @@ internal func _anyHashableDownCastConditionalIndirect<T>(
343343 _ value: UnsafePointer < AnyHashable > ,
344344 _ target: UnsafeMutablePointer < T >
345345) -> Bool {
346- return value. pointee. _downCastConditional ( into: target)
346+ return unsafe value. pointee . _downCastConditional ( into: target)
347347}
0 commit comments