mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
AST: Promote AssociatedTypeImplements feature to baseline.
This commit is contained in:
@@ -189,7 +189,7 @@ BASELINE_LANGUAGE_FEATURE(Extern, 0, "@_extern")
|
||||
BASELINE_LANGUAGE_FEATURE(ExpressionMacroDefaultArguments, 422, "Expression macro as caller-side default argument")
|
||||
BASELINE_LANGUAGE_FEATURE(BuiltinStoreRaw, 0, "Builtin.storeRaw")
|
||||
BASELINE_LANGUAGE_FEATURE(BuiltinCreateTask, 0, "Builtin.createTask and Builtin.createDiscardingTask")
|
||||
SUPPRESSIBLE_LANGUAGE_FEATURE(AssociatedTypeImplements, 0, "@_implements on associated types")
|
||||
BASELINE_LANGUAGE_FEATURE(AssociatedTypeImplements, 0, "@_implements on associated types")
|
||||
LANGUAGE_FEATURE(BuiltinAddressOfRawLayout, 0, "Builtin.addressOfRawLayout")
|
||||
BASELINE_LANGUAGE_FEATURE(MoveOnlyPartialConsumption, 429, "Partial consumption of noncopyable values")
|
||||
BASELINE_LANGUAGE_FEATURE(BitwiseCopyable, 426, "BitwiseCopyable protocol")
|
||||
|
||||
@@ -3048,14 +3048,6 @@ suppressingFeatureSendingArgsAndResults(PrintOptions &options,
|
||||
action();
|
||||
}
|
||||
|
||||
static void suppressingFeatureAssociatedTypeImplements(PrintOptions &options,
|
||||
llvm::function_ref<void()> action) {
|
||||
unsigned originalExcludeAttrCount = options.ExcludeAttrList.size();
|
||||
options.ExcludeAttrList.push_back(DeclAttrKind::Implements);
|
||||
action();
|
||||
options.ExcludeAttrList.resize(originalExcludeAttrCount);
|
||||
}
|
||||
|
||||
static void
|
||||
suppressingFeatureBitwiseCopyable2(PrintOptions &options,
|
||||
llvm::function_ref<void()> action) {
|
||||
|
||||
@@ -63,10 +63,6 @@ static bool usesFeatureSpecializeAttributeWithAvailability(Decl *decl) {
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool usesFeatureAssociatedTypeImplements(Decl *decl) {
|
||||
return isa<TypeDecl>(decl) && decl->getAttrs().hasAttribute<ImplementsAttr>();
|
||||
}
|
||||
|
||||
UNINTERESTING_FEATURE(BuiltinAddressOfRawLayout)
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
@@ -94,10 +94,6 @@ extension AsyncCompactMapSequence: AsyncSequence {
|
||||
public struct Iterator: AsyncIteratorProtocol {
|
||||
public typealias Element = ElementOfResult
|
||||
|
||||
// FIXME: Remove when $AssociatedTypeImplements is no longer needed
|
||||
@available(SwiftStdlib 6.0, *)
|
||||
public typealias Failure = Base.Failure
|
||||
|
||||
@usableFromInline
|
||||
var baseIterator: Base.AsyncIterator
|
||||
|
||||
|
||||
@@ -81,10 +81,6 @@ extension AsyncDropFirstSequence: AsyncSequence {
|
||||
|
||||
/// The iterator that produces elements of the drop-first sequence.
|
||||
public struct Iterator: AsyncIteratorProtocol {
|
||||
// FIXME: Remove when $AssociatedTypeImplements is no longer needed
|
||||
@available(SwiftStdlib 6.0, *)
|
||||
public typealias Failure = Base.Failure
|
||||
|
||||
@usableFromInline
|
||||
var baseIterator: Base.AsyncIterator
|
||||
|
||||
|
||||
@@ -90,10 +90,6 @@ extension AsyncDropWhileSequence: AsyncSequence {
|
||||
|
||||
/// The iterator that produces elements of the drop-while sequence.
|
||||
public struct Iterator: AsyncIteratorProtocol {
|
||||
// FIXME: Remove when $AssociatedTypeImplements is no longer needed
|
||||
@available(SwiftStdlib 6.0, *)
|
||||
public typealias Failure = Base.Failure
|
||||
|
||||
@usableFromInline
|
||||
var baseIterator: Base.AsyncIterator
|
||||
|
||||
|
||||
@@ -80,10 +80,6 @@ extension AsyncFilterSequence: AsyncSequence {
|
||||
|
||||
/// The iterator that produces elements of the filter sequence.
|
||||
public struct Iterator: AsyncIteratorProtocol {
|
||||
// FIXME: Remove when $AssociatedTypeImplements is no longer needed
|
||||
@available(SwiftStdlib 6.0, *)
|
||||
public typealias Failure = Base.Failure
|
||||
|
||||
@usableFromInline
|
||||
var baseIterator: Base.AsyncIterator
|
||||
|
||||
|
||||
@@ -197,10 +197,6 @@ extension AsyncFlatMapSequence: AsyncSequence {
|
||||
|
||||
/// The iterator that produces elements of the flat map sequence.
|
||||
public struct Iterator: AsyncIteratorProtocol {
|
||||
// FIXME: Remove when $AssociatedTypeImplements is no longer needed
|
||||
@available(SwiftStdlib 6.0, *)
|
||||
public typealias Failure = Base.Failure
|
||||
|
||||
@usableFromInline
|
||||
var baseIterator: Base.AsyncIterator
|
||||
|
||||
|
||||
@@ -90,10 +90,6 @@ extension AsyncMapSequence: AsyncSequence {
|
||||
|
||||
/// The iterator that produces elements of the map sequence.
|
||||
public struct Iterator: AsyncIteratorProtocol {
|
||||
// FIXME: Remove when $AssociatedTypeImplements is no longer needed
|
||||
@available(SwiftStdlib 6.0, *)
|
||||
public typealias Failure = Base.Failure
|
||||
|
||||
@usableFromInline
|
||||
var baseIterator: Base.AsyncIterator
|
||||
|
||||
|
||||
@@ -81,10 +81,6 @@ extension AsyncPrefixSequence: AsyncSequence {
|
||||
|
||||
/// The iterator that produces elements of the prefix sequence.
|
||||
public struct Iterator: AsyncIteratorProtocol {
|
||||
// FIXME: Remove when $AssociatedTypeImplements is no longer needed
|
||||
@available(SwiftStdlib 6.0, *)
|
||||
public typealias Failure = Base.Failure
|
||||
|
||||
@usableFromInline
|
||||
var baseIterator: Base.AsyncIterator
|
||||
|
||||
|
||||
@@ -85,10 +85,6 @@ extension AsyncPrefixWhileSequence: AsyncSequence {
|
||||
|
||||
/// The iterator that produces elements of the prefix-while sequence.
|
||||
public struct Iterator: AsyncIteratorProtocol {
|
||||
// FIXME: Remove when $AssociatedTypeImplements is no longer needed
|
||||
@available(SwiftStdlib 6.0, *)
|
||||
public typealias Failure = Base.Failure
|
||||
|
||||
@usableFromInline
|
||||
var predicateHasFailed = false
|
||||
|
||||
|
||||
@@ -11,14 +11,9 @@ public struct SequenceAdapter<Base: AsyncSequence>: AsyncSequence {
|
||||
// CHECK: @available{{.*}}macOS 10.15
|
||||
// CHECK-NEXT: public typealias Element = Base.Element
|
||||
|
||||
// CHECK: #if compiler(>=5.3) && $AssociatedTypeImplements
|
||||
// CHECK: @available(
|
||||
// CHECK: @_implements(_Concurrency.AsyncIteratorProtocol, Failure)
|
||||
// CHECK-SAME: public typealias __AsyncIteratorProtocol_Failure = Base.Failure
|
||||
// CHECK-NEXT: #else
|
||||
// CHECK-NOT: @_implements
|
||||
// CHECK: public typealias __AsyncIteratorProtocol_Failure = Base.Failure
|
||||
// CHECK-NEXT: #endif
|
||||
public typealias Element = Base.Element
|
||||
|
||||
public struct AsyncIterator: AsyncIteratorProtocol {
|
||||
|
||||
Reference in New Issue
Block a user