Rollup merge of #57656 - scottmcm:deprecate-resize_default, 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: https://github.com/rust-lang/rust/issues/41758#issuecomment-449719961 r? @SimonSapin
This commit is contained in:
commit
0bcb66469c
1 changed files with 4 additions and 0 deletions
|
@ -1365,6 +1365,7 @@ impl<T: Default> Vec<T> {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// # #![allow(deprecated)]
|
||||
/// #![feature(vec_resize_default)]
|
||||
///
|
||||
/// let mut vec = vec![1, 2, 3];
|
||||
|
@ -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();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue