mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
stdlib: Adopt internal imports to suppress some warnings in tests.
This commit is contained in:
@@ -40,22 +40,22 @@ import SwiftPrivate
|
||||
import SwiftPrivateLibcExtras
|
||||
import SwiftPrivateThreadExtras
|
||||
#if canImport(Darwin)
|
||||
import Darwin
|
||||
internal import Darwin
|
||||
#elseif canImport(Glibc)
|
||||
import Glibc
|
||||
internal import Glibc
|
||||
#elseif canImport(Musl)
|
||||
import Musl
|
||||
internal import Musl
|
||||
#elseif canImport(Android)
|
||||
import Android
|
||||
internal import Android
|
||||
#elseif os(WASI)
|
||||
import WASILibc
|
||||
internal import WASILibc
|
||||
#elseif os(Windows)
|
||||
import CRT
|
||||
import WinSDK
|
||||
internal import CRT
|
||||
internal import WinSDK
|
||||
#endif
|
||||
|
||||
#if _runtime(_ObjC)
|
||||
import ObjectiveC
|
||||
internal import ObjectiveC
|
||||
#else
|
||||
func autoreleasepool(invoking code: () -> Void) {
|
||||
// Native runtime does not have autorelease pools. Execute the code
|
||||
|
||||
@@ -13,21 +13,21 @@
|
||||
import SwiftPrivate
|
||||
import SwiftPrivateLibcExtras
|
||||
#if canImport(Darwin)
|
||||
import Darwin
|
||||
internal import Darwin
|
||||
#elseif canImport(Glibc)
|
||||
import Glibc
|
||||
internal import Glibc
|
||||
#elseif canImport(Musl)
|
||||
import Musl
|
||||
internal import Musl
|
||||
#elseif canImport(Android)
|
||||
import Android
|
||||
internal import Android
|
||||
#elseif os(WASI)
|
||||
import WASILibc
|
||||
internal import WASILibc
|
||||
#elseif os(Windows)
|
||||
import CRT
|
||||
internal import CRT
|
||||
#endif
|
||||
|
||||
#if _runtime(_ObjC)
|
||||
import Foundation
|
||||
internal import Foundation
|
||||
#endif
|
||||
|
||||
//
|
||||
|
||||
@@ -17,25 +17,25 @@ import SwiftPrivateLibcExtras
|
||||
|
||||
#if canImport(Darwin)
|
||||
#if _runtime(_ObjC)
|
||||
import Foundation
|
||||
internal import Foundation
|
||||
#endif
|
||||
import Darwin
|
||||
import var Darwin.errno
|
||||
internal import Darwin
|
||||
internal import var Darwin.errno
|
||||
#elseif canImport(Glibc)
|
||||
import Glibc
|
||||
internal import Glibc
|
||||
#elseif canImport(Musl)
|
||||
import Musl
|
||||
internal import Musl
|
||||
#elseif canImport(Android)
|
||||
import Android
|
||||
internal import Android
|
||||
#elseif os(WASI)
|
||||
import WASILibc
|
||||
internal import WASILibc
|
||||
#elseif os(Windows)
|
||||
import CRT
|
||||
import WinSDK
|
||||
internal import CRT
|
||||
internal import WinSDK
|
||||
#endif
|
||||
|
||||
#if _runtime(_ObjC)
|
||||
import ObjectiveC
|
||||
internal import ObjectiveC
|
||||
#endif
|
||||
|
||||
#if SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY
|
||||
|
||||
@@ -29,9 +29,9 @@ let RequestPointerSize = "p"
|
||||
|
||||
|
||||
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS) || os(visionOS)
|
||||
import MachO
|
||||
import Darwin
|
||||
import var Darwin.errno
|
||||
internal import MachO
|
||||
internal import Darwin
|
||||
internal import var Darwin.errno
|
||||
|
||||
#if arch(x86_64) || arch(arm64)
|
||||
typealias MachHeader = mach_header_64
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
import StdlibUnittest
|
||||
import EnableIf
|
||||
|
||||
|
||||
let x = HasMethodWithEnableIf()
|
||||
x.onlyEnabledForBool("a")
|
||||
// CHECK: error: could not substitute parameters for C++ function template 'HasMethodWithEnableIf::onlyEnabledForBool': NSString *
|
||||
// CHECK: error: could not generate C++ types from the generic Swift types provided; the following Swift type(s) provided to 'HasMethodWithEnableIf::onlyEnabledForBool' could not be converted: String
|
||||
|
||||
Reference in New Issue
Block a user