Skip to content

Commit 12933bf

Browse files
committed
Mark a few API uses in Swift Compiler Sources as unsafe.
1 parent 09384be commit 12933bf

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

SwiftCompilerSources/Sources/Basic/SourceLoc.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public struct SourceLoc {
2727
guard bridged.isValid() else {
2828
return nil
2929
}
30-
self.locationInFile = bridged.getOpaquePointerValue().assumingMemoryBound(to: UInt8.self)
30+
self.locationInFile = bridged.__getOpaquePointerValueUnsafe().assumingMemoryBound(to: UInt8.self)
3131
}
3232

3333
public var bridged: swift.SourceLoc {
@@ -57,7 +57,7 @@ public struct CharSourceRange {
5757
}
5858

5959
public init?(bridged: swift.CharSourceRange) {
60-
guard let start = SourceLoc(bridged: bridged.getStart()) else {
60+
guard let start = SourceLoc(bridged: bridged.__getStartUnsafe()) else {
6161
return nil
6262
}
6363
self.init(start: start, byteLength: bridged.getByteLength())

SwiftCompilerSources/Sources/Basic/Utils.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ extension String {
6565
/// Underscored to avoid name collision with the std overlay.
6666
/// To be replaced with an overlay call once the CI uses SDKs built with Swift 5.8.
6767
public init(_cxxString s: std.string) {
68-
self.init(cString: s.c_str())
68+
self.init(cString: s.__c_strUnsafe())
6969
withExtendedLifetime(s) {}
7070
}
7171
}

0 commit comments

Comments
 (0)