Skip to content

Commit

Permalink
Rollup merge of rust-lang#57656 - scottmcm:deprecate-resize_default, …
Browse files Browse the repository at this point in the history
…r=SimonSapin

Deprecate the unstable Vec::resize_default

As a way to either get additional feedback to stabilize or help move nightly users off it.

Tracking issue: rust-lang#41758 (comment)

r? @SimonSapin
  • Loading branch information
Centril authored Feb 22, 2019
2 parents 599ddc5 + 81cd1e6 commit 90a122e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/liballoc/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1365,6 +1365,7 @@ impl<T: Default> Vec<T> {
/// # Examples
///
/// ```
/// # #![allow(deprecated)]
/// #![feature(vec_resize_default)]
///
/// let mut vec = vec![1, 2, 3];
Expand All @@ -1381,6 +1382,9 @@ impl<T: Default> Vec<T> {
/// [`Default`]: ../../std/default/trait.Default.html
/// [`Clone`]: ../../std/clone/trait.Clone.html
#[unstable(feature = "vec_resize_default", issue = "41758")]
#[rustc_deprecated(reason = "This is moving towards being removed in favor \
of `.resize_with(Default::default)`. If you disagree, please comment \
in the tracking issue.", since = "1.33.0")]
pub fn resize_default(&mut self, new_len: usize) {
let len = self.len();

Expand Down

0 comments on commit 90a122e

Please sign in to comment.