@@ -36,7 +36,7 @@ public struct MutableSpan<Element: ~Copyable>
3636 _unchecked start: UnsafeMutableRawPointer ? ,
3737 count: Int
3838 ) {
39- _pointer = unsafe start
39+ unsafe _pointer = start
4040 _count = count
4141 }
4242}
@@ -54,7 +54,7 @@ extension MutableSpan where Element: ~Copyable {
5454 internal init(
5555 _unchecked elements: UnsafeMutableBufferPointer < Element >
5656 ) {
57- _pointer = . init( elements. baseAddress)
57+ unsafe _pointer = . init ( elements. baseAddress)
5858 _count = elements. count
5959 }
6060
@@ -190,7 +190,7 @@ extension RawSpan {
190190 public init < Element: BitwiseCopyable > (
191191 _mutableSpan mutableSpan: borrowing MutableSpan < Element >
192192 ) {
193- let pointer = mutableSpan. _pointer
193+ let pointer = unsafe mutableSpan. _pointer
194194 let byteCount = mutableSpan. count &* MemoryLayout< Element> . stride
195195 let buffer = unsafe UnsafeRawBufferPointer( start: pointer, count: byteCount)
196196 let rawSpan = unsafe RawSpan( _unsafeBytes: buffer)
@@ -203,7 +203,7 @@ extension MutableSpan where Element: ~Copyable {
203203
204204 @_alwaysEmitIntoClient
205205 public var _description : String {
206- let addr = String (
206+ let addr = unsafe String(
207207 UInt ( bitPattern: _pointer) , radix: 16 , uppercase: false
208208 )
209209 return " (0x \( addr) , \( _count) ) "
@@ -376,7 +376,7 @@ extension MutableSpan where Element: ~Copyable {
376376 public func withUnsafeBufferPointer< E: Error , Result: ~ Copyable> (
377377 _ body: ( _ buffer: UnsafeBufferPointer < Element > ) throws ( E ) -> Result
378378 ) throws ( E ) -> Result {
379- try Span( _mutableSpan: self ) . withUnsafeBufferPointer( body)
379+ try unsafe Span( _mutableSpan: self ) . withUnsafeBufferPointer( body)
380380 }
381381
382382 //FIXME: mark closure parameter as non-escaping
@@ -387,7 +387,7 @@ extension MutableSpan where Element: ~Copyable {
387387 > (
388388 _ body: ( UnsafeMutableBufferPointer < Element > ) throws ( E ) -> Result
389389 ) throws ( E ) -> Result {
390- guard let pointer = _pointer, count > 0 else {
390+ guard let pointer = unsafe _pointer, count > 0 else {
391391 return try unsafe body( . init( start: nil , count: 0 ) )
392392 }
393393 // bind memory by hand to sidestep alignment concerns
@@ -407,7 +407,7 @@ extension MutableSpan where Element: BitwiseCopyable {
407407 public func withUnsafeBytes< E: Error, Result: ~ Copyable> (
408408 _ body: ( _ buffer: UnsafeRawBufferPointer ) throws ( E ) -> Result
409409 ) throws ( E ) -> Result {
410- try RawSpan( _mutableSpan: self ) . withUnsafeBytes( body )
410+ try unsafe RawSpan( _mutableSpan: self ) . withUnsafeBytes( body )
411411 }
412412
413413 //FIXME: mark closure parameter as non-escaping
@@ -494,7 +494,7 @@ extension MutableSpan {
494494 unsafe _start( ) . withMemoryRebound (
495495 to: Element . self, capacity: source. count
496496 ) { dest in
497- source. withUnsafeBufferPointer {
497+ unsafe source. withUnsafeBufferPointer {
498498 unsafe dest. update ( from: $0. baseAddress!, count: $0. count)
499499 }
500500 }
@@ -537,7 +537,7 @@ extension MutableSpan where Element: ~Copyable {
537537 ) -> Index {
538538// let source = OutputSpan(_initializing: source, initialized: source.count)
539539// return self.moveUpdate(fromContentsOf: source)
540- withUnsafeMutableBufferPointer {
540+ unsafe withUnsafeMutableBufferPointer {
541541 unsafe $0. moveUpdate ( fromContentsOf: source)
542542 }
543543 }
@@ -551,7 +551,7 @@ extension MutableSpan {
551551 public mutating func moveUpdate(
552552 fromContentsOf source: Slice < UnsafeMutableBufferPointer < Element > >
553553 ) -> Index {
554- moveUpdate ( fromContentsOf: unsafe . init ( rebasing: source) )
554+ unsafe moveUpdate( fromContentsOf: . init( rebasing: source) )
555555 }
556556}
557557
@@ -565,7 +565,7 @@ extension MutableSpan where Element: BitwiseCopyable {
565565 ) where Element: BitwiseCopyable {
566566 guard count > 0 else { return }
567567 // rebind _start manually in order to avoid assumptions about alignment.
568- let rp = _start ( ) . _rawValue
568+ let rp = unsafe _start( ) . _rawValue
569569 let binding = Builtin . bindMemory ( rp, count. _builtinWordValue, Element . self)
570570 let rebound = unsafe UnsafeMutablePointer< Element > ( rp)
571571 unsafe rebound. update ( repeating: repeatedValue, count: count)
@@ -630,7 +630,7 @@ extension MutableSpan where Element: BitwiseCopyable {
630630 source. count <= self . count,
631631 " destination span cannot contain every element from source. "
632632 )
633- source. withUnsafeBufferPointer {
633+ unsafe source. withUnsafeBufferPointer {
634634 unsafe _start( ) . copyMemory (
635635 from: $0. baseAddress!,
636636 byteCount: $0. count &* MemoryLayout< Element> . stride
0 commit comments