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

Deprecate UnsafeCell::value #25867

Merged
merged 1 commit into from
Jun 3, 2015
Merged

Deprecate UnsafeCell::value #25867

merged 1 commit into from
Jun 3, 2015

Conversation

petrochenkov
Copy link
Contributor

Now when const functions are implemented and used, the value field of UnsafeCell can be made deprecated (and then private as intended).

@rust-highfive
Copy link
Collaborator

r? @pcwalton

(rust_highfive has picked a reviewer for you, use r? to override)

@alexcrichton
Copy link
Member

Nice! Could this actually take the route of #[deprecated] instead as there may be a large-ish number of crates using this? That way it can also have a message indicating how to enable the const fn feature. I believe @nikomatsakis is working on a patch to gate all const fn usage in statics in stable code right now.

@petrochenkov
Copy link
Contributor Author

Done.
(The message describing how to enable const functions will come from the feature gate itself.)

@petrochenkov petrochenkov changed the title Make UnsafeCell::value private Deprecate UnsafeCell::value May 29, 2015
@@ -641,6 +641,8 @@ pub struct UnsafeCell<T: ?Sized> {
///
/// This field should not be accessed directly, it is made public for static
/// initializers.
#[deprecated(since = "1.2.0", reason = "use `get` to access the wrapped value or `new` to
Copy link
Member

Choose a reason for hiding this comment

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

I think this message may be a bit off-kilter due to the newline, could this use \ at the end of the string to make sure it's parsed as one line?

Copy link
Member

Choose a reason for hiding this comment

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

Also, could you be sure to wrap this line to 80 characters? (the surrounding style)

@alexcrichton
Copy link
Member

@bors: r+ 019ab5d

Thanks! Also feel free to ping PRs whenever you update them, unfortunately no notifications are sent out otherwise :(

@alexcrichton alexcrichton added the T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. label Jun 2, 2015
@bors
Copy link
Contributor

bors commented Jun 2, 2015

⌛ Testing commit 019ab5d with merge e8af475...

bors added a commit that referenced this pull request Jun 2, 2015
Now when const functions are implemented and used, the `value` field of `UnsafeCell` can be made deprecated (and then private as intended).
@bors bors merged commit 019ab5d into rust-lang:master Jun 3, 2015
mokus0 added a commit to mokus0/zinc that referenced this pull request Aug 16, 2015
@petrochenkov petrochenkov deleted the ucellv branch September 21, 2015 13:02
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