mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
remove support for _forget, the old spelling of discard
resolves rdar://112549258
This commit is contained in:
@@ -3,26 +3,16 @@
|
||||
// RUN: %target-swift-typecheck-module-from-interface(%t/Library.swiftinterface) -I %t -enable-experimental-feature MoveOnlyResilientTypes
|
||||
// RUN: %FileCheck %s < %t/Library.swiftinterface
|
||||
|
||||
// This test makes sure that discard and _forget are emitted correctly in the
|
||||
// interfaces. We expect that if you use the old name _forget, you'll get that
|
||||
// in the interface file.
|
||||
// This test makes sure that discard is emitted correctly in the interfaces.
|
||||
|
||||
// CHECK: @_alwaysEmitIntoClient public consuming func AEIC_discard() { discard self }
|
||||
// CHECK: @inlinable public consuming func inlinable_discard() { discard self }
|
||||
|
||||
// CHECK: @_alwaysEmitIntoClient public consuming func AEIC_forget() { _forget self }
|
||||
// CHECK: @inlinable public consuming func inlinable_forget() { _forget self }
|
||||
|
||||
public struct MoveOnlyStruct: ~Copyable {
|
||||
let x = 0
|
||||
|
||||
@_alwaysEmitIntoClient public consuming func AEIC_discard() { discard self }
|
||||
@inlinable public consuming func inlinable_discard() { discard self }
|
||||
|
||||
@_alwaysEmitIntoClient public consuming func AEIC_forget() { _forget self }
|
||||
// expected-warning@-1 {{'_forget' keyword is deprecated and will be removed soon; use 'discard' instead}}
|
||||
@inlinable public consuming func inlinable_forget() { _forget self }
|
||||
// expected-warning@-1 {{'_forget' keyword is deprecated and will be removed soon; use 'discard' instead}}
|
||||
|
||||
deinit {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user