Files
swift-mirror/test/SILGen/copy_operator_generic_failure.swift
Nate Chandler 06921cfe84 [SIL] Hollow out Builtin.copy, deprecate _copy.
The copy operator has been implemented and doesn't use it.  Remove
`Builtin.copy` and `_copy` as much as currently possible.

Source compatibility requires that `_copy` remain in the stdlib.  It is
deprecated here and just uses the copy operator.

Handling old swiftinterfaces requires that `Builtin.copy` be defined.
Redefine it here as a passthrough--SILGen machinery will produce the
necessary copy_addr.

rdar://127502242
2024-05-03 15:56:25 -07:00

8 lines
191 B
Swift

// RUN: %target-swift-emit-sil -parse-stdlib %s -disable-access-control -disable-objc-attr-requires-foundation-module -verify
import Swift
func addressOnlyCopy<T>(t: T) -> T {
copy t
}