Skip to content

[stdlib] Make non-frozen types BitwiseCopyable #83630

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions stdlib/public/Concurrency/ContinuousClock.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2021 Apple Inc. and the Swift project authors
// Copyright (c) 2022 - 2025 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
Expand All @@ -22,9 +22,9 @@ import Swift
/// This clock is suitable for high resolution measurements of execution.
@available(StdlibDeploymentTarget 5.7, *)
@_unavailableInEmbedded
public struct ContinuousClock: Sendable {
public struct ContinuousClock: BitwiseCopyable, Sendable {
/// A continuous point in time used for `ContinuousClock`.
public struct Instant: Sendable {
public struct Instant: BitwiseCopyable, Sendable {
internal var _value: Swift.Duration

internal init(_value: Swift.Duration) {
Expand Down
6 changes: 3 additions & 3 deletions stdlib/public/Concurrency/SuspendingClock.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2021 Apple Inc. and the Swift project authors
// Copyright (c) 2022 - 2025 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
Expand All @@ -22,8 +22,8 @@ import Swift
/// This clock is suitable for high resolution measurements of execution.
@available(StdlibDeploymentTarget 5.7, *)
@_unavailableInEmbedded
public struct SuspendingClock: Sendable {
public struct Instant: Sendable {
public struct SuspendingClock: BitwiseCopyable, Sendable {
public struct Instant: BitwiseCopyable, Sendable {
internal var _value: Swift.Duration

internal init(_value: Swift.Duration) {
Expand Down
10 changes: 5 additions & 5 deletions stdlib/public/Platform/POSIXError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
// Copyright (c) 2015 - 2025 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
Expand All @@ -13,7 +13,7 @@
#if os(Linux) || os(Android)

/// Enumeration describing POSIX error codes.
public enum POSIXErrorCode: Int32, Sendable {
public enum POSIXErrorCode: Int32, BitwiseCopyable, Sendable {
/// Operation not permitted.
case EPERM = 1
/// No such file or directory.
Expand Down Expand Up @@ -308,7 +308,7 @@ public enum POSIXErrorCode: Int32, Sendable {
// Matches WASI-libc declarations at https://github.com/WebAssembly/wasi-libc/blob/ad513341/libc-bottom-half/headers/public/wasi/api.h#L106

/// Enumeration describing POSIX error codes.
public enum POSIXErrorCode: Int32, Sendable {
public enum POSIXErrorCode: Int32, BitwiseCopyable, Sendable {
/// Argument list too long.
case E2BIG = 1
/// Permission denied.
Expand Down Expand Up @@ -474,7 +474,7 @@ public enum POSIXErrorCode: Int32, Sendable {
#elseif os(Windows)

/// Enumeration describing POSIX error codes.
public enum POSIXErrorCode: Int32, Sendable {
public enum POSIXErrorCode: Int32, BitwiseCopyable, Sendable {

/// Operation not permitted
case EPERM = 1
Expand Down Expand Up @@ -600,7 +600,7 @@ public enum POSIXErrorCode: Int32, Sendable {
#elseif os(OpenBSD) || os(FreeBSD)

/// Enumeration describing POSIX error codes.
public enum POSIXErrorCode: Int32, Sendable {
public enum POSIXErrorCode: Int32, BitwiseCopyable, Sendable {
/// Operation not permitted
case EPERM = 1
/// No such file or directory
Expand Down
4 changes: 2 additions & 2 deletions stdlib/public/core/FloatingPoint.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2018 Apple Inc. and the Swift project authors
// Copyright (c) 2013 - 2025 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
Expand Down Expand Up @@ -1323,7 +1323,7 @@ public enum FloatingPointClassification: Sendable {
}

/// A rule for rounding a floating-point number.
public enum FloatingPointRoundingRule: Sendable {
public enum FloatingPointRoundingRule: BitwiseCopyable, Sendable {
/// Round to the closest allowed value; if two values are equally close, the
/// one with greater magnitude is chosen.
///
Expand Down
10 changes: 5 additions & 5 deletions stdlib/public/core/UnicodeScalarProperties.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2023 Apple Inc. and the Swift project authors
// Copyright (c) 2018 - 2025 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
Expand All @@ -19,7 +19,7 @@ extension Unicode.Scalar {

/// A value that provides access to properties of a Unicode scalar that are
/// defined by the Unicode standard.
public struct Properties: Sendable {
public struct Properties: BitwiseCopyable, Sendable {
@usableFromInline
internal var _scalar: Unicode.Scalar

Expand Down Expand Up @@ -869,7 +869,7 @@ extension Unicode {
/// The general category of a scalar is its "first-order, most usual
/// categorization". It does not attempt to cover multiple uses of some
/// scalars, such as the use of letters to represent Roman numerals.
public enum GeneralCategory: Sendable {
public enum GeneralCategory: BitwiseCopyable, Sendable {

/// An uppercase letter.
///
Expand Down Expand Up @@ -1324,7 +1324,7 @@ extension Unicode {
/// let overlayClassIsOverlay = overlayClass == .overlay
/// // overlayClassIsOverlay == true
public struct CanonicalCombiningClass:
Comparable, Hashable, RawRepresentable, Sendable
BitwiseCopyable, Comparable, Hashable, RawRepresentable, Sendable
{
/// Base glyphs that occupy their own space and do not combine with others.
public static let notReordered = CanonicalCombiningClass(rawValue: 0)
Expand Down Expand Up @@ -1447,7 +1447,7 @@ extension Unicode {
/// Some letterlike scalars used in numeric systems, such as Greek or Latin
/// letters, do not have a non-nil numeric type, in order to prevent programs
/// from incorrectly interpreting them as numbers in non-numeric contexts.
public enum NumericType: Sendable {
public enum NumericType: BitwiseCopyable, Sendable {

/// A digit that is commonly understood to form base-10 numbers.
///
Expand Down