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

Allow more Cell methods for non-Copy types #39793

Merged
merged 2 commits into from
Feb 16, 2017
Merged

Conversation

RalfJung
Copy link
Member

Clearly, get_mut is safe for any T. The other two only provide unsafe pointers anyway.

The only remaining inherent method with Copy bound is get, which sounds about right to me.

I found the order if impl blocks in the file a little weird (first inherent impl, then some trait impls, then another inherent impl), but didn't change it to keep the diff small.

Contributes to #39264

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @BurntSushi (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@RalfJung
Copy link
Member Author

RalfJung commented Feb 13, 2017

Reading through #39716 I noticed that there also is a From impl that unnecessarily still has a Copy bound. I could add another commit here removing that bound.

EDIT: The same goes for Default.

@alexcrichton
Copy link
Member

cc @rust-lang/libs

@RalfJung yeah want to remove those bounds as well?

@alexcrichton alexcrichton added the T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. label Feb 13, 2017
@RalfJung
Copy link
Member Author

Done.

@alexcrichton
Copy link
Member

@bors: r+

@bors
Copy link
Contributor

bors commented Feb 14, 2017

📌 Commit 044ed10 has been approved by alexcrichton

frewsxcv added a commit to frewsxcv/rust that referenced this pull request Feb 15, 2017
Allow more Cell methods for non-Copy types

Clearly, `get_mut` is safe for any `T`. The other two only provide unsafe pointers anyway.

The only remaining inherent method with `Copy` bound is `get`, which sounds about right to me.

I found the order if `impl` blocks in the file a little weird (first inherent impl, then some trait impls, then another inherent impl), but didn't change it to keep the diff small.

Contributes to rust-lang#39264
frewsxcv added a commit to frewsxcv/rust that referenced this pull request Feb 15, 2017
Allow more Cell methods for non-Copy types

Clearly, `get_mut` is safe for any `T`. The other two only provide unsafe pointers anyway.

The only remaining inherent method with `Copy` bound is `get`, which sounds about right to me.

I found the order if `impl` blocks in the file a little weird (first inherent impl, then some trait impls, then another inherent impl), but didn't change it to keep the diff small.

Contributes to rust-lang#39264
bors added a commit that referenced this pull request Feb 16, 2017
Rollup of 11 pull requests

- Successful merges: #39775, #39793, #39804, #39824, #39834, #39837, #39839, #39840, #39843, #39844, #39846
- Failed merges:
frewsxcv added a commit to frewsxcv/rust that referenced this pull request Feb 16, 2017
Allow more Cell methods for non-Copy types

Clearly, `get_mut` is safe for any `T`. The other two only provide unsafe pointers anyway.

The only remaining inherent method with `Copy` bound is `get`, which sounds about right to me.

I found the order if `impl` blocks in the file a little weird (first inherent impl, then some trait impls, then another inherent impl), but didn't change it to keep the diff small.

Contributes to rust-lang#39264
frewsxcv added a commit to frewsxcv/rust that referenced this pull request Feb 16, 2017
Allow more Cell methods for non-Copy types

Clearly, `get_mut` is safe for any `T`. The other two only provide unsafe pointers anyway.

The only remaining inherent method with `Copy` bound is `get`, which sounds about right to me.

I found the order if `impl` blocks in the file a little weird (first inherent impl, then some trait impls, then another inherent impl), but didn't change it to keep the diff small.

Contributes to rust-lang#39264
bors added a commit that referenced this pull request Feb 16, 2017
Rollup of 12 pull requests

- Successful merges: #39775, #39793, #39804, #39834, #39836, #39839, #39840, #39843, #39844, #39846, #39857, #39861
- Failed merges:
@bors
Copy link
Contributor

bors commented Feb 16, 2017

⌛ Testing commit 044ed10 with merge d77af7f...

@bors bors merged commit 044ed10 into rust-lang:master Feb 16, 2017
@RalfJung RalfJung deleted the cell branch August 3, 2017 04:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants