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

Implements Default for mutable slices. Fixes: #29244 #29245

Merged
merged 1 commit into from
Oct 24, 2015
Merged

Implements Default for mutable slices. Fixes: #29244 #29245

merged 1 commit into from
Oct 24, 2015

Conversation

WildCryptoFox
Copy link
Contributor

No description provided.

@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 @aturon (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. 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.

@@ -655,6 +655,12 @@ impl<'a, T> Default for &'a [T] {
fn default() -> &'a [T] { &[] }
}

#[stable(feature = "rust1", since = "1.5.0")]
impl<'a, T> Default for &'a mut [T] {
#[stable(feature = "rust1", since = "1.5.0")]
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't believe the method itself needs/desires the annotation (you can't partially-stabley implement a trait). The fact that the &[T] impl does is basically cargo-culting because these annotations are useless today.

@petrochenkov can probably best speak to what the heck the "right" thing is here, though.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah the methods on a trait impl don't need these annotations, and can you also rename the "rust1" feature to something like "mut_slice_default"? Currently we require that a feature name is all stabilized within the same "since".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@alexcrichton done, noted and amended. Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@gankro As @alexcrichton said, although we don't need it - we have mut_slice_default instead.

@bluss bluss added the relnotes Marks issues that should be documented in the release notes of the next release. label Oct 23, 2015
@alexcrichton
Copy link
Member

@bors: r+ 36ce1c0

Thanks @james-darkfox!

@bors
Copy link
Contributor

bors commented Oct 24, 2015

⌛ Testing commit 36ce1c0 with merge d689182...

@bors bors merged commit 36ce1c0 into rust-lang:master Oct 24, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
relnotes Marks issues that should be documented in the release notes of the next release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants