mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Sema: discard self should not be allowed in inlinable methods of non-frozen types.
`discard self` requires knowledge of the internal layout of the type in order to clean up its fields while bypassing its public `deinit`. Inlinable code can get copied into and run from outside of the defining module, so this is impossible to implement. Fixes rdar://160815058.
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
// CHECK: @_alwaysEmitIntoClient public consuming func AEIC_discard() { discard self }
|
||||
// CHECK: @inlinable public consuming func inlinable_discard() { discard self }
|
||||
|
||||
@frozen
|
||||
public struct MoveOnlyStruct: ~Copyable {
|
||||
let x = 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user