When typechecking the constraint inout $T1 < UnsafeMutablePointer<Void>, bind $T1 to Void as a last resort.

Revert stdlib changes in r25921.

<rdar://problem/19835413> Reference to value from array changed

Swift SVN r25939
This commit is contained in:
Chris Willmore
2015-03-10 18:54:36 +00:00
parent c0bf1f54ff
commit 44da3ceb8c
3 changed files with 22 additions and 7 deletions

View File

@@ -298,8 +298,8 @@ public func ==(lhs: String, rhs: String) -> Bool {
return false
}
return memcmp(
UnsafeMutablePointer<UTF8.CodeUnit>(lhs._core.startASCII),
UnsafeMutablePointer<UTF8.CodeUnit>(rhs._core.startASCII),
UnsafeMutablePointer(lhs._core.startASCII),
UnsafeMutablePointer(rhs._core.startASCII),
rhs._core.count) == 0
}
return lhs._compareString(rhs) == 0
@@ -322,8 +322,8 @@ extension String {
public // @testable
func _compareASCII(rhs: String) -> Int {
var compare = Int(memcmp(
UnsafeMutablePointer<UTF8.CodeUnit>(self._core.startASCII),
UnsafeMutablePointer<UTF8.CodeUnit>(rhs._core.startASCII),
UnsafeMutablePointer(self._core.startASCII),
UnsafeMutablePointer(rhs._core.startASCII),
min(self._core.count, rhs._core.count)))
if compare == 0 {
compare = self._core.count - rhs._core.count