remove support for _forget, the old spelling of discard

resolves rdar://112549258
This commit is contained in:
Kavon Farvardin
2023-08-11 15:29:08 -07:00
parent 5ab33b44b1
commit 4e7e6f41cb
7 changed files with 8 additions and 113 deletions

View File

@@ -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 {}
}