Skip to content

Fix parameter, doc comments in Span family #82102

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

Merged
merged 7 commits into from
Jun 12, 2025
Merged

Conversation

valeriyvan
Copy link
Contributor

No description provided.

@valeriyvan valeriyvan requested a review from a team as a code owner June 9, 2025 08:58
@stephentyrone
Copy link
Contributor

CC @glessard

glessard
glessard previously approved these changes Jun 9, 2025
Copy link
Contributor

@glessard glessard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @valeriyvan!

@glessard
Copy link
Contributor

glessard commented Jun 9, 2025

@swift-ci please smoke test

@glessard glessard enabled auto-merge June 9, 2025 14:33
@glessard glessard dismissed their stale review June 9, 2025 14:46

misread a change

@glessard glessard disabled auto-merge June 9, 2025 14:46
@@ -301,11 +301,11 @@ extension RawSpan {
@lifetime(borrow pointer)
public init<T: BitwiseCopyable>(
_unsafeStart pointer: UnsafePointer<T>,
count: Int
byteCount: Int
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This really is count. It is the number of T elements. Below, we passed count * MemoryLayout<T>.stride to the byteCount-taking initializer. It would also be source-breaking, which we will only want to do when we officially review the RawSpan initializers and deprecate this spelling.

For now, let's remove the changes from lines 304-308. Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have reverted this change and fixed this func's doc comment to match parameters naming.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@valeriyvan valeriyvan requested a review from glessard June 9, 2025 15:04
@glessard
Copy link
Contributor

glessard commented Jun 9, 2025

@swift-ci please smoke test

Copy link
Contributor

@glessard glessard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's have the initializer doc-comment mention elements rather than bytes, it will be more logical.

@valeriyvan valeriyvan requested a review from glessard June 9, 2025 17:20
@glessard
Copy link
Contributor

glessard commented Jun 9, 2025

@swift-ci please smoke test

@glessard
Copy link
Contributor

@swift-ci please smoke test linux platform

@stephentyrone
Copy link
Contributor

@swift-ci smoke test linux

@glessard
Copy link
Contributor

@swift-ci smoke test Linux platform

1 similar comment
@glessard
Copy link
Contributor

@swift-ci smoke test Linux platform

@glessard glessard merged commit 3b9ec94 into swiftlang:main Jun 12, 2025
3 checks passed
@valeriyvan valeriyvan deleted the span branch June 12, 2025 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants