Skip to content
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

Clarify unaligned fields in ptr::{read,write}_unaligned #62323

Merged
merged 2 commits into from
Jul 5, 2019

Conversation

Centril
Copy link
Contributor

@Centril Centril commented Jul 3, 2019

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 3, 2019
@RalfJung
Copy link
Member

RalfJung commented Jul 3, 2019

write_unaligned contains a similar example, you probably want to do the same there.

@Centril Centril changed the title Clarify unaligned fields in ptr::read_unaligned Clarify unaligned fields in ptr::{read,write}_unaligned Jul 4, 2019
@RalfJung
Copy link
Member

RalfJung commented Jul 4, 2019

Please don't force-push while review is still in progress, unless necessary for a rebase. (a) force-pushes don't trigger email notifications, and (b) that makes it harder to figure out what changed since the last review. (I am aware that GitHub shows those diffs, but e.g. it does not show the full diff when you do multiple force-pushes in a row.)

rust-highfive even says this when welcoming new users, but I guess it's been a while since you got that message. ;)

src/libcore/ptr/mod.rs Outdated Show resolved Hide resolved
src/libcore/ptr/mod.rs Outdated Show resolved Hide resolved
@Centril
Copy link
Contributor Author

Centril commented Jul 4, 2019

(a) force-pushes don't trigger email notifications,

No, but a comment in thread does, which I did make... ;)

(b) that makes it harder to figure out what changed since the last review. (I am aware that GitHub shows those diffs, but e.g. it does not show the full diff when you do multiple force-pushes in a row.)

It does, you can click on each "force-push" link in sequence and it will show the relative diff. I am aware that force pushing makes it harder to figure out what changed since last review when the diff and PR is large (and then I wouldn't do it) but in this case it's small, so a cleaner history is imo to be preferred.

@RalfJung
Copy link
Member

RalfJung commented Jul 4, 2019

It does, you can click on each "force-push" link in sequence and it will show the relative diff.

That is incorrect. When you do two force-pushes in a row with no other event in between, GH will just say "force-pushed twice, most recently from X to Y", with no way to get the full diff.

a cleaner history is imo to be preferred.

You can squash after I am done with reviewing. But please don't while review is still in progress. Please follow the process we also expect new contributors to follow.

src/libcore/ptr/mod.rs Outdated Show resolved Hide resolved
src/libcore/ptr/mod.rs Outdated Show resolved Hide resolved
@RalfJung
Copy link
Member

RalfJung commented Jul 4, 2019

Thanks a lot! r=me, after squashing if you want.

@Centril
Copy link
Contributor Author

Centril commented Jul 4, 2019

Too much going on today... so I'll just...

@bors r=RalfJung rollup

@bors
Copy link
Contributor

bors commented Jul 4, 2019

📌 Commit 54527db has been approved by RalfJung

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 4, 2019
Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this pull request Jul 4, 2019
…alfJung

Clarify unaligned fields in ptr::{read,write}_unaligned

r? @RalfJung
Centril added a commit to Centril/rust that referenced this pull request Jul 5, 2019
…alfJung

Clarify unaligned fields in ptr::{read,write}_unaligned

r? @RalfJung
Centril added a commit to Centril/rust that referenced this pull request Jul 5, 2019
…alfJung

Clarify unaligned fields in ptr::{read,write}_unaligned

r? @RalfJung
bors added a commit that referenced this pull request Jul 5, 2019
Rollup of 10 pull requests

Successful merges:

 - #62123 ( Remove needless lifetimes (std))
 - #62150 (Implement mem::{zeroed,uninitialized} in terms of MaybeUninit.)
 - #62169 (Derive which queries to save using the proc macro)
 - #62238 (Fix code block information icon position)
 - #62292 (Move `async || ...` closures into `#![feature(async_closure)]`)
 - #62323 (Clarify unaligned fields in ptr::{read,write}_unaligned)
 - #62324 (Reduce reliance on `await!(...)` macro)
 - #62371 (Add tracking issue for Box::into_pin)
 - #62383 (Improve error span for async type inference error)
 - #62388 (Break out of the correct number of scopes in loops)

Failed merges:

r? @ghost
@bors bors merged commit 54527db into rust-lang:master Jul 5, 2019
@Centril Centril deleted the clarify-read-unaligned branch July 5, 2019 16:15
Centril added a commit to Centril/rust that referenced this pull request Jul 10, 2019
…unaligned, r=rkruppe

rust-lang#62357: doc(ptr): add example for {read,write}_unaligned

related to rust-lang#62357

> With rust-lang#62323 the only example (that had UB and was thus invalid) in std::ptr::read_unaligned and std::ptr::write_unaligned is removed.

> We should add a valid example of using the aforementioned functions.

Signed-off-by: Freyskeyd <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants