File tree 1 file changed +2
-2
lines changed
1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ fileprivate func castElementAs<T>(_ ptr: DataElementPtr) -> UnsafePointer<T> {
32
32
33
33
fileprivate func castElementAs< T> ( _ ptr: MutableDataElementPtr ) -> UnsafeMutablePointer < T > {
34
34
assert ( MemoryLayout < T > . alignment <= MemoryLayout< RawSyntaxDataElement> . alignment)
35
- return UnsafeMutablePointer < T > ( ptr)
35
+ return UnsafeMutableRawPointer ( ptr) . assumingMemoryBound ( to : T . self )
36
36
}
37
37
38
38
/// Calculates the number of `RawSyntaxDataElement`s needed to fit the given
@@ -146,7 +146,7 @@ fileprivate struct TokenData {
146
146
if hasCustomText {
147
147
// Copy the full token text, including trivia.
148
148
let startOffset = Int ( cnode. range. offset)
149
- var charPtr = UnsafeMutablePointer < UInt8 > ( curPtr)
149
+ var charPtr = UnsafeMutableRawPointer ( curPtr) . assumingMemoryBound ( to : UInt8 . self )
150
150
let utf8 = source. utf8
151
151
let begin = utf8. index ( utf8. startIndex, offsetBy: startOffset)
152
152
let end = utf8. index ( begin, offsetBy: Int ( cnode. range. length) )
You can’t perform that action at this time.
0 commit comments