Stabilize const_vec_string_slice · rust-lang/rust@50ea503 (original) (raw)

`@@ -1254,7 +1254,7 @@ impl<T, A: Allocator> Vec<T, A> {

`

1254

1254

```` /// ```


`1255`

`1255`

`#[inline]

`

`1256`

`1256`

`#[stable(feature = "rust1", since = "1.0.0")]

`

`1257`

``

`-

#[rustc_const_unstable(feature = "const_vec_string_slice", issue = "129041")]

`

``

`1257`

`+

#[rustc_const_stable(feature = "const_vec_string_slice", since = "CURRENT_RUSTC_VERSION")]

`

`1258`

`1258`

`pub const fn capacity(&self) -> usize {

`

`1259`

`1259`

`self.buf.capacity()

`

`1260`

`1260`

`}

`

`@@ -1569,7 +1569,7 @@ impl<T, A: Allocator> Vec<T, A> {

`

`1569`

`1569`

`#[inline]

`

`1570`

`1570`

`#[stable(feature = "vec_as_slice", since = "1.7.0")]

`

`1571`

`1571`

`#[rustc_diagnostic_item = "vec_as_slice"]

`

`1572`

``

`-

#[rustc_const_unstable(feature = "const_vec_string_slice", issue = "129041")]

`

``

`1572`

`+

#[rustc_const_stable(feature = "const_vec_string_slice", since = "CURRENT_RUSTC_VERSION")]

`

`1573`

`1573`

`pub const fn as_slice(&self) -> &[T] {

`

`1574`

`1574`

`` // SAFETY: `slice::from_raw_parts` requires pointee is a contiguous, aligned buffer of size

``

`1575`

`1575`

`` // `len` containing properly-initialized `T`s. Data must not be mutated for the returned

``

`@@ -1601,7 +1601,7 @@ impl<T, A: Allocator> Vec<T, A> {

`

`1601`

`1601`

`#[inline]

`

`1602`

`1602`

`#[stable(feature = "vec_as_slice", since = "1.7.0")]

`

`1603`

`1603`

`#[rustc_diagnostic_item = "vec_as_mut_slice"]

`

`1604`

``

`-

#[rustc_const_unstable(feature = "const_vec_string_slice", issue = "129041")]

`

``

`1604`

`+

#[rustc_const_stable(feature = "const_vec_string_slice", since = "CURRENT_RUSTC_VERSION")]

`

`1605`

`1605`

`pub const fn as_mut_slice(&mut self) -> &mut [T] {

`

`1606`

`1606`

`` // SAFETY: `slice::from_raw_parts_mut` requires pointee is a contiguous, aligned buffer of

``

`1607`

`1607`

`` // size `len` containing properly-initialized `T`s. Data must not be accessed through any

``

`@@ -1673,7 +1673,7 @@ impl<T, A: Allocator> Vec<T, A> {

`

`1673`

`1673`

`` /// [`as_ptr`]: Vec::as_ptr

``

`1674`

`1674`

`` /// [`as_non_null`]: Vec::as_non_null

``

`1675`

`1675`

`#[stable(feature = "vec_as_ptr", since = "1.37.0")]

`

`1676`

``

`-

#[rustc_const_unstable(feature = "const_vec_string_slice", issue = "129041")]

`

``

`1676`

`+

#[rustc_const_stable(feature = "const_vec_string_slice", since = "CURRENT_RUSTC_VERSION")]

`

`1677`

`1677`

`#[rustc_never_returns_null_ptr]

`

`1678`

`1678`

`#[rustc_as_ptr]

`

`1679`

`1679`

`#[inline]

`

`@@ -1736,7 +1736,7 @@ impl<T, A: Allocator> Vec<T, A> {

`

`1736`

`1736`

`` /// [`as_ptr`]: Vec::as_ptr

``

`1737`

`1737`

`` /// [`as_non_null`]: Vec::as_non_null

``

`1738`

`1738`

`#[stable(feature = "vec_as_ptr", since = "1.37.0")]

`

`1739`

``

`-

#[rustc_const_unstable(feature = "const_vec_string_slice", issue = "129041")]

`

``

`1739`

`+

#[rustc_const_stable(feature = "const_vec_string_slice", since = "CURRENT_RUSTC_VERSION")]

`

`1740`

`1740`

`#[rustc_never_returns_null_ptr]

`

`1741`

`1741`

`#[rustc_as_ptr]

`

`1742`

`1742`

`#[inline]

`

`@@ -2687,7 +2687,7 @@ impl<T, A: Allocator> Vec<T, A> {

`

`2687`

`2687`

```` /// ```

2688

2688

`#[inline]

`

2689

2689

`#[stable(feature = "rust1", since = "1.0.0")]

`

2690

``

`-

#[rustc_const_unstable(feature = "const_vec_string_slice", issue = "129041")]

`

``

2690

`+

#[rustc_const_stable(feature = "const_vec_string_slice", since = "CURRENT_RUSTC_VERSION")]

`

2691

2691

`#[rustc_confusables("length", "size")]

`

2692

2692

`pub const fn len(&self) -> usize {

`

2693

2693

`let len = self.len;

`

`@@ -2713,7 +2713,7 @@ impl<T, A: Allocator> Vec<T, A> {

`

2713

2713

```` /// ```

````

2714

2714

`#[stable(feature = "rust1", since = "1.0.0")]

`

2715

2715

`#[rustc_diagnostic_item = "vec_is_empty"]

`

2716

``

`-

#[rustc_const_unstable(feature = "const_vec_string_slice", issue = "129041")]

`

``

2716

`+

#[rustc_const_stable(feature = "const_vec_string_slice", since = "CURRENT_RUSTC_VERSION")]

`

2717

2717

`pub const fn is_empty(&self) -> bool {

`

2718

2718

`self.len() == 0

`

2719

2719

`}

`