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
[stdlib] Restore MemoryLayout.*(ofValue:) #4041
Conversation
@swift-ci test |
@@ -284,9 +284,6 @@ func _MemoryLayout<T>(t: T) { | |||
_ = sizeof(T.self) // expected-error {{'sizeof' is unavailable: use MemoryLayout<T>.size instead.}} {{7-14=MemoryLayout<}} {{15-21=>.size}} {{none}} | |||
_ = alignof(T.self) // expected-error {{'alignof' is unavailable: use MemoryLayout<T>.alignment instead.}} {{7-15=MemoryLayout<}} {{16-22=>.alignment}} {{none}} | |||
_ = strideof(T.self) // expected-error {{'strideof' is unavailable: use MemoryLayout<T>.stride instead.}} {{7-16=MemoryLayout<}} {{17-23=>.stride}} {{none}} | |||
_ = sizeofValue(t) // expected-error {{'sizeofValue' is unavailable: use MemoryLayout<T>.size instead.}} {{7-21=MemoryLayout<T>.size}} {{none}} | |||
_ = alignofValue(t) // expected-error {{'alignofValue' is unavailable: use MemoryLayout<T>.alignment instead.}} {{7-22=MemoryLayout<T>.alignment}} {{none}} | |||
_ = strideofValue(t) // expected-error {{'strideofValue' is unavailable: use MemoryLayout<T>.stride instead.}} {{7-23=MemoryLayout<T>.stride}} {{none}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add tests for the new migration fixits that you added?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do, as soon as I'm in front of a computer this afternoon.
Edit: done.
@swift-ci test |
@swift-ci Please smoke test |
@swift-ci Please smoke test Linux platform |
@dabrahams Does the Linux failure look related to you? |
@swift-ci Please smoke test Linux platform |
on Fri Aug 05 2016, Xiaodi Wu <notifications-AT-github.com> wrote:
I can imagine one way they might be related, but it seems like a -Dave |
/// Returns the contiguous memory footprint of `T`. | ||
/// | ||
/// Does not include any dynamically-allocated or "remote" storage. In | ||
/// particular, `MemoryLayout(ofValue: x).size`, when `x` is a class instance, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in documentation comment: MemoryLayout(ofValue: x).size
=> MemoryLayout.size(ofValue: x)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Nate Cook has just cleaned up the documentation for the existing bits of MemoryLayout quite a bit, so I'll either rebase or submit a follow-up patch and incorporate a correction.
@dabrahams Second thoughts on kicking off the review? |
@xwu No, darnit. I was having technical issues with my email 😣. Should have gone out now. |
(Rebased.) |
@xwu rebasing doesn't really help unless someone added a merge conflict upstrea. It just means we need to test again |
@swift-ci Please test |
I'm aware. Nate Cook did a massive doc comment update that included MemoryLayout; this was not an optional rebase. |
@swift-ci please smoke test OS X platform. |
What's in this pull request?
This PR, requested by Dave Abrahams, restores
ofValue
variants ofsize
,stride
, andalignment
.I removed the hardcoded fix-its for migrating away from
sizeofValue(_:)
and friends, since the restoration of these counterparts means that a simplerenamed
will do.I also took the liberty of a little gardening on the doc comments (80-character columns, etc.).
Before merging this pull request to apple/swift repository:
Triggering Swift CI
The swift-ci is triggered by writing a comment on this PR addressed to the GitHub user @swift-ci. Different tests will run depending on the specific comment that you use. The currently available comments are:
Smoke Testing
A smoke test on macOS does the following:
device standard libraries are not built.
version of these tests are not run.
A smoke test on Linux does the following:
tests are not run.
Validation Testing
Lint Testing
Note: Only members of the Apple organization can trigger swift-ci.