mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
AST: Adjust declaration printing when NoncopyableGenerics2 is suppressed.
When printing declarations with `NoncopyableGenerics2` suppressed we must avoid printing the `@_preInverseGenerics` attribute and any `borrowing` or `consuming` parameter ownership modifiers.
This commit is contained in:
@@ -144,8 +144,18 @@ import NoncopyableGenerics_Misc
|
||||
|
||||
// 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: #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
|
||||
|
||||
import Swiftskell
|
||||
|
||||
// CHECK: #if compiler(>=5.3) && $NoncopyableGenerics
|
||||
|
||||
Reference in New Issue
Block a user