-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
std: Second-pass stabilization of mem
/default
#19902
Conversation
This commit takes a second pass through the `std::mem` module for stabilization. The only remaining non-stable items in this module were `forget`, `transmute`, `copy_lifetime`, and `copy_lifetime_mut`. The `forget` and `transmute` intrinsics themselves were marked `#[stable]` to propgate into the `core::mem` module so they would be marked stable. The `copy_lifetime` functions were left `unstable`, but `Sized?` annotations were added to the parameters to allow more general use with DSTs. The `size_of_val`, `min_align_of_val`, and `align_of_val` functions would like to grow `Sized?` bounds, but this is a backwards compatible change that currently ICEs the compiler, so this change was not made at this time. Finally, the module itself was declared `#![stable]` in this pass.
cc0c5aa
to
23bae85
Compare
This commit performs a second pass stabilization of the `std::default` module. The module was already marked `#[stable]`, and the inheritance of `#[stable]` was removed since this attribute was applied. This commit adds the `#[stable]` attribute to the trait definition and one method name, along with all implementations found in the standard distribution.
mem
mem
/default
Threw in an easy commit for |
@@ -1044,8 +1044,9 @@ impl<'a, T, Sized? U: AsSlice<T>> AsSlice<T> for &'a mut U { | |||
fn as_slice<'a>(&'a self) -> &'a [T] { AsSlice::as_slice(*self) } | |||
} | |||
|
|||
#[unstable = "waiting for DST"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seemed suspicious to me, @aturon do you remember why this was here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect there was some question whether Default
should be implemented for [T]
instead/as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But that doesn't actually make sense, of course :-)
This looks fine to me. I think we've since come around to the utility of |
std: Second-pass stabilization of `mem`/`default` Reviewed-by: aturon
I am a strong believer in something like |
It's certainly a pretty harmless function to stabilize, I figured for now we could let feedback drive whether we stabilize it because I saw very few usages in the standard distribution at least. |
This commit stabilizes the `mem` and `default` modules of std.
std: Second-pass stabilization of `mem`/`default` Reviewed-by: aturon
Using a type alias for iterator implementations is fragile since this exposes the implementation to users of the iterator, and any changes could break existing code. This commit changes the iterators of `VecMap` to use proper new types, rather than type aliases. However, since it is fair-game to treat a type-alias as the aliased type, this is a: [breaking-change].
This commit stabilizes the `mem` and `default` modules of std.
This commit stabilizes the
mem
anddefault
modules of std.