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

Implement RFC #1725 (read_unaligned, write_unaligned) #38309

Merged
merged 1 commit into from Dec 13, 2016

Conversation

sfackler
Copy link
Member

copy_nonoverlapping(&src as *const T as *const u8,
dst as *mut u8,
mem::size_of::<T>());
}
Copy link
Member

Choose a reason for hiding this comment

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

This consumes src and must forget src here. This calls for a test!

Copy link
Member

Choose a reason for hiding this comment

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

lol, the RFC forgot to even talk about ownership semantics. Following how ptr::write works is the obvious thing.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed and added a test.

Copy link
Member

Choose a reason for hiding this comment

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

Great

@bluss bluss changed the title Implement RFC #1725 Implement RFC #1725 (read_unaligned, write_unaligned) Dec 12, 2016
@bluss
Copy link
Member

bluss commented Dec 12, 2016

(I was just chasing another PR that didn't have anything recognizable in the name.. so I took the liberty of adding to the name here.)

@alexcrichton
Copy link
Member

Looks good to me, thanks @sfackler!

r=me with @bluss's comments and some tests.

@sfackler
Copy link
Member Author

@bors r=alexcrichton

@bors
Copy link
Contributor

bors commented Dec 13, 2016

📌 Commit 75fe727 has been approved by alexcrichton

@bors
Copy link
Contributor

bors commented Dec 13, 2016

⌛ Testing commit 75fe727 with merge 0d1b9f4...

bors added a commit that referenced this pull request Dec 13, 2016
Implement RFC #1725 (read_unaligned, write_unaligned)

cc #37955

r? @alexcrichton
@bors bors merged commit 75fe727 into rust-lang:master Dec 13, 2016
@sfackler sfackler deleted the rfc-1725 branch December 25, 2016 21:29
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.

None yet

4 participants