mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
AST: Remove NoncopyableGenerics feature suppression.
It is no longer necessary to produce `.swiftinterface` files the support older compilers that lack support for the NoncopyableGenerics feature. Cleaning this up makes the stdlib `.swiftinterface` far more readable.
This commit is contained in:
@@ -57,60 +57,44 @@ import NoncopyableGenerics_Misc
|
||||
|
||||
// CHECK-MISC: public static func allCopyable2<T>(_ s: T) where T : NoncopyableGenerics_Misc._NoCopyP
|
||||
|
||||
// CHECK-MISC: #if compiler(>=5.3) && $NoncopyableGenerics
|
||||
// CHECK-MISC-NEXT: public static func oneCopyable1<T, V>(_ s: T, _ v: borrowing V) where T : {{.*}}._NoCopyP, V : ~Copyable
|
||||
// CHECK-MISC: public static func oneCopyable1<T, V>(_ s: T, _ v: borrowing V) where T : {{.*}}._NoCopyP, V : ~Copyable
|
||||
|
||||
// CHECK-MISC: #if compiler(>=5.3) && $NoncopyableGenerics
|
||||
// CHECK-MISC-NEXT: public static func oneCopyable2<T, V>(_ s: borrowing T, _ v: V) where T : {{.*}}._NoCopyP, T : ~Copyable
|
||||
// CHECK-MISC: public static func oneCopyable2<T, V>(_ s: borrowing T, _ v: V) where T : {{.*}}._NoCopyP, T : ~Copyable
|
||||
|
||||
// CHECK-MISC: #if compiler(>=5.3) && $NoncopyableGenerics
|
||||
// CHECK-MISC-NEXT: public static func oneCopyable3<T, V>(_ s: borrowing T, _ v: V) where T : {{.*}}._NoCopyP, T : ~Copyable
|
||||
// CHECK-MISC: public static func oneCopyable3<T, V>(_ s: borrowing T, _ v: V) where T : {{.*}}._NoCopyP, T : ~Copyable
|
||||
|
||||
// CHECK-MISC: public static func basic_some(_ s: some _NoCopyP)
|
||||
|
||||
// CHECK-MISC: #if compiler(>=5.3) && $NoncopyableGenerics
|
||||
// CHECK-MISC-NEXT: public static func basic_some_nc(_ s: borrowing some _NoCopyP & ~Copyable)
|
||||
// CHECK-MISC: public static func basic_some_nc(_ s: borrowing some _NoCopyP & ~Copyable)
|
||||
|
||||
// CHECK-MISC: #if compiler(>=5.3) && $NoncopyableGenerics
|
||||
// CHECK-MISC-NEXT: public static func oneEscapable<T, V>(_ s: T, _ v: V) where T : NoncopyableGenerics_Misc._NoEscapableP, T : ~Escapable
|
||||
// CHECK-MISC: public static func oneEscapable<T, V>(_ s: T, _ v: V) where T : NoncopyableGenerics_Misc._NoEscapableP, T : ~Escapable
|
||||
|
||||
// CHECK-MISC: public static func canEscapeButConforms<T>(_ t: T) where T : {{.*}}._NoEscapableP
|
||||
|
||||
// CHECK-MISC: #if compiler(>=5.3) && $NoncopyableGenerics
|
||||
// CHECK-MISC-NEXT: public static func opaqueNonEscapable(_ s: some _NoEscapableP & ~Escapable)
|
||||
// CHECK-MISC: public static func opaqueNonEscapable(_ s: some _NoEscapableP & ~Escapable)
|
||||
|
||||
// CHECK-MISC: public static func opaqueEscapable(_ s: some _NoEscapableP)
|
||||
|
||||
// CHECK-MISC: #if compiler(>=5.3) && $NoncopyableGenerics
|
||||
// CHECK-MISC-NEXT: public struct ExplicitHello<T> : ~Swift.Copyable where T : ~Copyable {
|
||||
// CHECK-MISC: public struct ExplicitHello<T> : ~Swift.Copyable where T : ~Copyable {
|
||||
|
||||
// CHECK-MISC: #if compiler(>=5.3) && $NoncopyableGenerics
|
||||
// CHECK-MISC-NEXT: extension {{.*}}.ExplicitHello : Swift.Copyable where T : Swift.Copyable {
|
||||
// CHECK-MISC: extension {{.*}}.ExplicitHello : Swift.Copyable where T : Swift.Copyable {
|
||||
|
||||
// CHECK-MISC: #if compiler(>=5.3) && $NoncopyableGenerics
|
||||
// CHECK-MISC-NEXT: public struct Hello<T> : ~Swift.Copyable, ~Swift.Escapable where T : ~Copyable, T : ~Escapable {
|
||||
// CHECK-MISC: public struct Hello<T> : ~Swift.Copyable, ~Swift.Escapable where T : ~Copyable, T : ~Escapable {
|
||||
|
||||
// CHECK-MISC: #if compiler(>=5.3) && $NoncopyableGenerics
|
||||
// CHECK-MISC-NEXT: extension NoncopyableGenerics_Misc.Hello : Swift.Escapable where T : Swift.Escapable {
|
||||
// CHECK-MISC: extension NoncopyableGenerics_Misc.Hello : Swift.Escapable where T : Swift.Escapable {
|
||||
// CHECK-MISC-NEXT: }
|
||||
// CHECK-MISC: #endif
|
||||
|
||||
// CHECK-MISC: #if compiler(>=5.3) && $NoncopyableGenerics
|
||||
// CHECK-MISC-NEXT: extension NoncopyableGenerics_Misc.Hello : Swift.Copyable where T : Swift.Copyable {
|
||||
// CHECK-MISC: extension NoncopyableGenerics_Misc.Hello : Swift.Copyable where T : Swift.Copyable {
|
||||
// CHECK-MISC-NEXT: }
|
||||
// CHECK-MISC: #endif
|
||||
|
||||
// CHECK-MISC: #if compiler(>=5.3) && $NoncopyableGenerics
|
||||
// CHECK-MISC-NEXT: public protocol TestAssocTypes {
|
||||
// CHECK-MISC: public protocol TestAssocTypes {
|
||||
// CHECK-MISC-NEXT: associatedtype A : {{.*}}._NoCopyP, ~Copyable
|
||||
|
||||
// CHECK-MISC: public typealias SomeAlias<G> = {{.*}}.Hello<G>
|
||||
|
||||
// CHECK-MISC: #if compiler(>=5.3) && $NoncopyableGenerics
|
||||
// CHECK-MISC-NEXT: public typealias AliasWithInverse<G> = {{.*}}.Hello<G> where G : ~Copyable, G : ~Escapable
|
||||
// CHECK-MISC: public typealias AliasWithInverse<G> = {{.*}}.Hello<G> where G : ~Copyable, G : ~Escapable
|
||||
|
||||
// CHECK-MISC: #if compiler(>=5.3) && $NoncopyableGenerics
|
||||
// CHECK-MISC-NEXT: public struct RudePointer<T> : Swift.Copyable where T : ~Copyable {
|
||||
// CHECK-MISC: public struct RudePointer<T> : Swift.Copyable where T : ~Copyable {
|
||||
|
||||
// CHECK-MISC: noInversesSTART
|
||||
// CHECK-MISC-NOT: ~
|
||||
@@ -120,66 +104,35 @@ import NoncopyableGenerics_Misc
|
||||
// CHECK-MISC: public func checkAnyInv2<Result>(_ t: borrowing Result) where Result : ~Copyable, Result : ~Escapable
|
||||
// CHECK-MISC: public func checkAnyObject<Result>(_ t: Result) where Result : AnyObject
|
||||
|
||||
// CHECK-MISC: #if compiler(>=5.3) && $NoncopyableGenerics
|
||||
// CHECK-MISC-NEXT: public struct Outer<A> : ~Swift.Copyable where A : ~Copyable {
|
||||
// CHECK-MISC: public struct Outer<A> : ~Swift.Copyable where A : ~Copyable {
|
||||
// CHECK-MISC-NEXT: public func innerFn<B>(_ b: borrowing B) where B : ~Copyable
|
||||
// CHECK-MISC: public struct InnerStruct<C> : ~Swift.Copyable where C : ~Copyable {
|
||||
// CHECK-MISC-NEXT: public func g<D>(_ d: borrowing D) where D : ~Copyable
|
||||
// CHECK-MISC: public struct InnerVariation1<D> : ~Swift.Copyable, ~Swift.Escapable where D : ~Copyable
|
||||
// CHECK-MISC: public struct InnerVariation2<D> : ~Swift.Copyable, ~Swift.Escapable where D : ~Escapable
|
||||
|
||||
// CHECK-MISC: #if compiler(>=5.3) && $NoncopyableGenerics
|
||||
// CHECK-MISC-NEXT: extension {{.*}}.Outer : Swift.Copyable where A : Swift.Copyable {
|
||||
// CHECK-MISC: #endif
|
||||
// CHECK-MISC: extension {{.*}}.Outer : Swift.Copyable where A : Swift.Copyable {
|
||||
|
||||
// CHECK-MISC: #if compiler(>=5.3) && $NoncopyableGenerics
|
||||
// CHECK-MISC-NEXT: extension {{.*}}.Outer.InnerStruct : Swift.Copyable where A : Swift.Copyable, C : Swift.Copyable {
|
||||
// CHECK-MISC: #endif
|
||||
// CHECK-MISC: extension {{.*}}.Outer.InnerStruct : Swift.Copyable where A : Swift.Copyable, C : Swift.Copyable {
|
||||
|
||||
// CHECK-MISC: #if compiler(>=5.3) && $NoncopyableGenerics
|
||||
// CHECK-MISC-NEXT: extension {{.*}}.Outer.InnerVariation1 : Swift.Copyable where A : Swift.Copyable, D : Swift.Copyable {
|
||||
// CHECK-MISC: #endif
|
||||
// CHECK-MISC: extension {{.*}}.Outer.InnerVariation1 : Swift.Copyable where A : Swift.Copyable, D : Swift.Copyable {
|
||||
|
||||
// CHECK-MISC: #if compiler(>=5.3) && $NoncopyableGenerics
|
||||
// CHECK-MISC-NEXT: extension {{.*}}.Outer.InnerVariation2 : Swift.Escapable where D : Swift.Escapable {
|
||||
// CHECK-MISC: #endif
|
||||
// CHECK-MISC: extension {{.*}}.Outer.InnerVariation2 : Swift.Escapable where D : Swift.Escapable {
|
||||
|
||||
// CHECK-MISC: #if compiler(>=5.3) && $NoncopyableGenerics
|
||||
// CHECK-MISC-NEXT: extension {{.*}}.Outer.InnerStruct {
|
||||
// CHECK-MISC: extension {{.*}}.Outer.InnerStruct {
|
||||
// CHECK-MISC-NEXT: public func hello<T>(_ t: T) where T : ~Escapable
|
||||
// CHECK-MISC: #endif
|
||||
|
||||
// CHECK-MISC: #if compiler(>=5.3) && $NoncopyableGenerics
|
||||
// CHECK-MISC-NEXT: @_preInverseGenerics public func old_swap<T>(_ a: inout T, _ b: inout T) where T : ~Copyable
|
||||
// CHECK-MISC-NEXT: #else
|
||||
// CHECK-MISC-NOT: @_preInverseGenerics
|
||||
// CHECK-MISC-NEXT: public func old_swap<T>(_ a: inout T, _ b: inout T)
|
||||
// CHECK-MISC: #endif
|
||||
// CHECK-MISC: @_preInverseGenerics public func old_swap<T>(_ a: inout T, _ b: inout T) where T : ~Copyable
|
||||
|
||||
// CHECK-MISC: #if compiler(>=5.3) && $NoncopyableGenerics
|
||||
// CHECK-MISC-NEXT: @_preInverseGenerics public func borrowsNoncopyable<T>(_ t: borrowing T) where T : ~Copyable
|
||||
// CHECK-MISC-NEXT: #else
|
||||
// CHECK-MISC-NOT: @_preInverseGenerics
|
||||
// CHECK-MISC-NEXT: public func borrowsNoncopyable<T>(_ t: T)
|
||||
// CHECK-MISC-NEXT: #endif
|
||||
// CHECK-MISC: @_preInverseGenerics public func borrowsNoncopyable<T>(_ t: borrowing T) where T : ~Copyable
|
||||
|
||||
// CHECK-MISC: #if compiler(>=5.3) && $NoncopyableGenerics
|
||||
// CHECK-MISC-NEXT: public func suppressesNoncopyableGenerics<T>(_ t: borrowing T) where T : ~Copyable
|
||||
// CHECK-MISC-NEXT: #endif
|
||||
// CHECK-MISC: public func suppressesNoncopyableGenerics<T>(_ t: borrowing T) where T : ~Copyable
|
||||
|
||||
// CHECK-MISC: #if compiler(>=5.3) && $NoncopyableGenerics
|
||||
// CHECK-MISC-NEXT: public struct LoudlyNC<T> where T : ~Copyable {
|
||||
// CHECK-MISC: public struct LoudlyNC<T> where T : ~Copyable {
|
||||
// CHECK-MISC-NEXT: }
|
||||
// CHECK-MISC-NEXT: #endif
|
||||
// CHECK-MISC-NEXT: public func _indexHumongousDonuts<TTT, T>(_ aggregate: Swift.UnsafePointer<TTT>, _ index: Swift.Int) -> T
|
||||
// CHECK-MISC-NEXT: #if compiler(>=5.3) && $NoncopyableGenerics
|
||||
// CHECK-MISC-NEXT: public func referToLoud(_ t: {{.*}}.LoudlyNC<Swift.String>)
|
||||
// CHECK-MISC-NEXT: #else
|
||||
// CHECK-MISC-NEXT: public func referToLoud(_ t: {{.*}}.LoudlyNC<Swift.String>)
|
||||
// CHECK-MISC-NEXT: #endif
|
||||
// CHECK-MISC-NEXT: #if compiler(>=5.3) && $NoncopyableGenerics
|
||||
// CHECK-MISC-NEXT: public func referToLoudProperGuarding(_ t: {{.*}}.LoudlyNC<Swift.String>)
|
||||
// CHECK-MISC-NEXT: #endif
|
||||
// CHECK-MISC-NEXT: public struct NoCopyPls : ~Swift.Copyable {
|
||||
// CHECK-MISC-NEXT: }
|
||||
// CHECK-MISC-NEXT: public func substCopyable(_ t: Swift.String?)
|
||||
@@ -189,33 +142,15 @@ import NoncopyableGenerics_Misc
|
||||
// below, since the suppressed version isn't valid. We don't have a good way of
|
||||
// fixing that right now, either.
|
||||
|
||||
// CHECK-MISC-NEXT: #if compiler(>=5.3) && $NoncopyableGenerics
|
||||
// CHECK-MISC-NEXT: public func substNC(_ t: borrowing {{.*}}.NoCopyPls?)
|
||||
// CHECK-MISC-NEXT: #else
|
||||
// CHECK-MISC-NEXT: public func substNC(_ t: borrowing {{.*}}.NoCopyPls?)
|
||||
// CHECK-MISC-NEXT: #endif
|
||||
// CHECK-MISC-NEXT: #if compiler(>=5.3) && $NoncopyableGenerics
|
||||
// CHECK-MISC-NEXT: public func substGenericNC<T>(_ t: borrowing T?) where T : ~Copyable
|
||||
// CHECK-MISC-NEXT: #else
|
||||
// CHECK-MISC-NEXT: public func substGenericNC<T>(_ t: borrowing T?)
|
||||
// CHECK-MISC-NEXT: #endif
|
||||
|
||||
// CHECK-MISC: #if compiler(>=5.3) && $NoncopyableGenerics
|
||||
// CHECK-MISC-NEXT: public protocol Publik : ~Copyable {
|
||||
// CHECK-MISC: public protocol Publik : ~Copyable {
|
||||
// CHECK-MISC-NEXT: }
|
||||
// CHECK-MISC-NEXT: #else
|
||||
// CHECK-MISC-NEXT: public protocol Publik {
|
||||
// CHECK-MISC-NEXT: }
|
||||
// CHECK-MISC-NEXT: #endif
|
||||
// CHECK-MISC-NEXT: public struct Concrete : ~Copyable {
|
||||
// CHECK-MISC-NEXT: }
|
||||
// CHECK-MISC-NEXT: #if compiler(>=5.3) && $NoncopyableGenerics
|
||||
// CHECK-MISC-NEXT: public struct Generic<T> : ~Copyable where T : {{.*}}.Publik, T : ~Copyable {
|
||||
// CHECK-MISC-NEXT: }
|
||||
// CHECK-MISC-NEXT: #else
|
||||
// CHECK-MISC-NEXT: public struct Generic<T> where T : {{.*}}.Publik {
|
||||
// CHECK-MISC-NEXT: }
|
||||
// CHECK-MISC-NEXT: #endif
|
||||
// CHECK-MISC-NEXT: public struct VeryNested : ~Copyable {
|
||||
// CHECK-MISC-NEXT: }
|
||||
// CHECK-MISC-NEXT: public struct Twice : ~Copyable, ~Copyable {
|
||||
@@ -223,68 +158,41 @@ import NoncopyableGenerics_Misc
|
||||
// CHECK-MISC-NEXT: public struct RegularTwice : ~Swift.Copyable, ~Swift.Copyable {
|
||||
// CHECK-MISC-NEXT: }
|
||||
|
||||
// CHECK-MISC-NEXT: #if compiler(>=5.3) && $NoncopyableGenerics
|
||||
// CHECK-MISC-NEXT: public struct Continuation<T, E> where E : Swift.Error, T : ~Copyable {
|
||||
// CHECK-MISC-NOT: ~
|
||||
// CHECK-MISC: #endif
|
||||
|
||||
// NOTE: below are extensions emitted at the end of NoncopyableGenerics_Misc.swift
|
||||
// CHECK-MISC: extension {{.*}}.VeryNested : {{.*}}.Publik {}
|
||||
|
||||
import Swiftskell
|
||||
|
||||
// CHECK: #if compiler(>=5.3) && $NoncopyableGenerics
|
||||
// CHECK-NEXT: public protocol Show : ~Copyable {
|
||||
// CHECK: #endif
|
||||
// CHECK: public protocol Show : ~Copyable {
|
||||
|
||||
// CHECK: #if compiler(>=5.3) && $NoncopyableGenerics
|
||||
// CHECK-NEXT: public func print(_ s: borrowing some Show & ~Copyable)
|
||||
// CHECK: #endif
|
||||
// CHECK: public func print(_ s: borrowing some Show & ~Copyable)
|
||||
|
||||
// CHECK: #if compiler(>=5.3) && $NoncopyableGenerics
|
||||
// CHECK-NEXT: public protocol Eq : ~Copyable {
|
||||
// CHECK: #endif
|
||||
// CHECK: public protocol Eq : ~Copyable {
|
||||
|
||||
// CHECK: #if compiler(>=5.3) && $NoncopyableGenerics
|
||||
// CHECK-NEXT: extension Swiftskell.Eq where Self : ~Copyable {
|
||||
// CHECK: #endif
|
||||
// CHECK: extension Swiftskell.Eq where Self : ~Copyable {
|
||||
|
||||
// CHECK: #if compiler(>=5.3) && $NoncopyableGenerics
|
||||
// CHECK-NEXT: public enum Either<Success, Failure> : ~Swift.Copyable where Failure : Swift.Error, Success : ~Copyable {
|
||||
// CHECK: #endif
|
||||
// CHECK: public enum Either<Success, Failure> : ~Swift.Copyable where Failure : Swift.Error, Success : ~Copyable {
|
||||
|
||||
/// This one is position dependent so we can ensure the associated type was printed correctly.
|
||||
// CHECK: public protocol Generator : ~Copyable {
|
||||
// CHECK-NEXT: associatedtype Element : ~Copyable
|
||||
// CHECK: #endif
|
||||
|
||||
// CHECK: #if compiler(>=5.3) && $NoncopyableGenerics
|
||||
// CHECK-NEXT: public enum Pair<L, R> : ~Swift.Copyable where L : ~Copyable, R : ~Copyable {
|
||||
// CHECK: #endif
|
||||
// CHECK: public enum Pair<L, R> : ~Swift.Copyable where L : ~Copyable, R : ~Copyable {
|
||||
|
||||
// CHECK: #if compiler(>=5.3) && $NoncopyableGenerics
|
||||
// CHECK-NEXT: extension Swiftskell.Pair : Swift.Copyable where L : Swift.Copyable, R : Swift.Copyable {
|
||||
// CHECK: #endif
|
||||
// CHECK: extension Swiftskell.Pair : Swift.Copyable where L : Swift.Copyable, R : Swift.Copyable {
|
||||
|
||||
// CHECK: #if compiler(>=5.3) && $NoncopyableGenerics
|
||||
// CHECK-NEXT: public enum Maybe<Wrapped> : ~Swift.Copyable where Wrapped : ~Copyable {
|
||||
// CHECK: #endif
|
||||
// CHECK: public enum Maybe<Wrapped> : ~Swift.Copyable where Wrapped : ~Copyable {
|
||||
|
||||
// CHECK: #if compiler(>=5.3) && $NoncopyableGenerics
|
||||
// CHECK-NEXT: extension Swiftskell.Maybe : Swift.Copyable where Wrapped : Swift.Copyable {
|
||||
// CHECK: #endif
|
||||
// CHECK: extension Swiftskell.Maybe : Swift.Copyable where Wrapped : Swift.Copyable {
|
||||
|
||||
// CHECK: #if compiler(>=5.3) && $NoncopyableGenerics
|
||||
// CHECK-NEXT: extension Swiftskell.Maybe : Swiftskell.Show where Wrapped : Swiftskell.Show, Wrapped : ~Copyable {
|
||||
// CHECK: #endif
|
||||
// CHECK: extension Swiftskell.Maybe : Swiftskell.Show where Wrapped : Swiftskell.Show, Wrapped : ~Copyable {
|
||||
|
||||
// CHECK: #if compiler(>=5.3) && $NoncopyableGenerics
|
||||
// CHECK-NEXT: extension Swiftskell.Maybe : Swiftskell.Eq where Wrapped : Swiftskell.Eq, Wrapped : ~Copyable {
|
||||
// CHECK: #endif
|
||||
// CHECK: extension Swiftskell.Maybe : Swiftskell.Eq where Wrapped : Swiftskell.Eq, Wrapped : ~Copyable {
|
||||
|
||||
// CHECK: #if compiler(>=5.3) && $NoncopyableGenerics
|
||||
// CHECK-NEXT: public func isJust<A>(_ m: borrowing Swiftskell.Maybe<A>) -> Swift.Bool where A : ~Copyable
|
||||
// CHECK: #endif
|
||||
// CHECK: public func isJust<A>(_ m: borrowing Swiftskell.Maybe<A>) -> Swift.Bool where A : ~Copyable
|
||||
|
||||
struct FileDescriptor: ~Copyable, Eq, Show {
|
||||
let id: Int
|
||||
|
||||
Reference in New Issue
Block a user