Skip to content

Stabilization for owned (now boxed) and cell #15591

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
wants to merge 1 commit into from

Conversation

aturon
Copy link
Member

@aturon aturon commented Jul 10, 2014

This PR is the outcome of the library stabilization meeting for the
liballoc::owned and libcore::cell modules.

Aside from the stability attributes, there are a few breaking changes:

  • The owned modules is now named boxed, to better represent its
    contents. (box was unavailable, since it's a keyword.) This will
    help avoid the misconception that Box plays a special role wrt
    ownership.
  • The AnyOwnExt extension trait is renamed to BoxAny, and its move
    method is renamed to downcast, in both cases to improve clarity.
  • The recently-added AnySendOwnExt extension trait is removed; it was
    not being used and is unnecessary.

[breaking-change]

/// Returns the boxed value if it is of type `T`, or
/// `Err(Self)` if it isn't.
fn move<T: 'static>(self) -> Result<Box<T>, Self>;
fn downcast<T: 'static>(self) -> Result<Box<T>, Self>;
Copy link
Member

Choose a reason for hiding this comment

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

Could you leave the move method as a #[deprecated] default method for now?

@alexcrichton
Copy link
Member

r=me with just a few nits

This PR is the outcome of the library stabilization meeting for the
`liballoc::owned` and `libcore::cell` modules.

Aside from the stability attributes, there are a few breaking changes:

* The `owned` modules is now named `boxed`, to better represent its
  contents. (`box` was unavailable, since it's a keyword.) This will
  help avoid the misconception that `Box` plays a special role wrt
  ownership.

* The `AnyOwnExt` extension trait is renamed to `BoxAny`, and its `move`
  method is renamed to `downcast`, in both cases to improve clarity.

* The recently-added `AnySendOwnExt` extension trait is removed; it was
  not being used and is unnecessary.

[breaking-change]
bors added a commit that referenced this pull request Jul 13, 2014
This PR is the outcome of the library stabilization meeting for the
`liballoc::owned` and `libcore::cell` modules.

Aside from the stability attributes, there are a few breaking changes:

* The `owned` modules is now named `boxed`, to better represent its
  contents. (`box` was unavailable, since it's a keyword.) This will
  help avoid the misconception that `Box` plays a special role wrt
  ownership.

* The `AnyOwnExt` extension trait is renamed to `BoxAny`, and its `move`
  method is renamed to `downcast`, in both cases to improve clarity.

* The recently-added `AnySendOwnExt` extension trait is removed; it was
  not being used and is unnecessary.

[breaking-change]
@bors bors closed this Jul 13, 2014
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants