about summary refs log tree commit diff
path: root/src/liballoc
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-02-22 14:57:55 +0100
committerGitHub <noreply@github.com>2019-02-22 14:57:55 +0100
commit0bcb66469cbe9e93f077a4c3fe1d5c9a8d615bc8 (patch)
treed6c54a965ecef79c599684325270d9a1b094a919 /src/liballoc
parent1005f3bac79f16ff48fd9fbb6d8de2798115dac9 (diff)
parent81cd1e64f38299276ce131db37994086ec94ad35 (diff)
downloadrust-0bcb66469cbe9e93f077a4c3fe1d5c9a8d615bc8.tar.gz
rust-0bcb66469cbe9e93f077a4c3fe1d5c9a8d615bc8.zip
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
Diffstat (limited to 'src/liballoc')
-rw-r--r--src/liballoc/vec.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/liballoc/vec.rs b/src/liballoc/vec.rs
index a351d482fed..dddfa3f158e 100644
--- a/src/liballoc/vec.rs
+++ b/src/liballoc/vec.rs
@@ -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();