Skip to content

Commit

Permalink
liballoc/{String,Vec}: set const_vec_string_slice issue number
Browse files Browse the repository at this point in the history
  • Loading branch information
mammothbane committed Sep 5, 2024
1 parent b45fec3 commit e6ee5d4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions library/alloc/src/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1006,7 +1006,7 @@ impl String {
#[inline]
#[must_use = "`self` will be dropped if the result is not used"]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_vec_string_slice", issue = "none")]
#[rustc_const_unstable(feature = "const_vec_string_slice", issue = "129041")]
pub const fn into_bytes(self) -> Vec<u8> {
self.vec
}
Expand All @@ -1023,7 +1023,7 @@ impl String {
#[inline]
#[must_use]
#[stable(feature = "string_as_str", since = "1.7.0")]
#[rustc_const_unstable(feature = "const_vec_string_slice", issue = "none")]
#[rustc_const_unstable(feature = "const_vec_string_slice", issue = "129041")]
pub const fn as_str(&self) -> &str {
unsafe { str::from_utf8_unchecked(self.vec.as_slice()) }
}
Expand Down Expand Up @@ -1114,7 +1114,7 @@ impl String {
#[inline]
#[must_use]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_vec_string_slice", issue = "none")]
#[rustc_const_unstable(feature = "const_vec_string_slice", issue = "129041")]
pub const fn capacity(&self) -> usize {
self.vec.capacity()
}
Expand Down Expand Up @@ -1378,7 +1378,7 @@ impl String {
#[inline]
#[must_use]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_vec_string_slice", issue = "none")]
#[rustc_const_unstable(feature = "const_vec_string_slice", issue = "129041")]
pub const fn as_bytes(&self) -> &[u8] {
self.vec.as_slice()
}
Expand Down Expand Up @@ -1752,7 +1752,7 @@ impl String {
#[inline]
#[must_use]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_vec_string_slice", issue = "none")]
#[rustc_const_unstable(feature = "const_vec_string_slice", issue = "129041")]
#[rustc_confusables("length", "size")]
pub const fn len(&self) -> usize {
self.vec.len()
Expand All @@ -1772,7 +1772,7 @@ impl String {
#[inline]
#[must_use]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_vec_string_slice", issue = "none")]
#[rustc_const_unstable(feature = "const_vec_string_slice", issue = "129041")]
pub const fn is_empty(&self) -> bool {
self.len() == 0
}
Expand Down
10 changes: 5 additions & 5 deletions library/alloc/src/vec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -946,7 +946,7 @@ impl<T, A: Allocator> Vec<T, A> {
/// ```
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_vec_string_slice", issue = "none")]
#[rustc_const_unstable(feature = "const_vec_string_slice", issue = "129041")]
pub const fn capacity(&self) -> usize {
self.buf.capacity()
}
Expand Down Expand Up @@ -1254,7 +1254,7 @@ impl<T, A: Allocator> Vec<T, A> {
/// ```
#[inline]
#[stable(feature = "vec_as_slice", since = "1.7.0")]
#[rustc_const_unstable(feature = "const_vec_string_slice", issue = "none")]
#[rustc_const_unstable(feature = "const_vec_string_slice", issue = "129041")]
pub const fn as_slice(&self) -> &[T] {
unsafe { slice::from_raw_parts(self.as_ptr(), self.len) }
}
Expand Down Expand Up @@ -1328,7 +1328,7 @@ impl<T, A: Allocator> Vec<T, A> {
/// [`as_mut_ptr`]: Vec::as_mut_ptr
/// [`as_ptr`]: Vec::as_ptr
#[stable(feature = "vec_as_ptr", since = "1.37.0")]
#[rustc_const_unstable(feature = "const_vec_string_slice", issue = "none")]
#[rustc_const_unstable(feature = "const_vec_string_slice", issue = "129041")]
#[rustc_never_returns_null_ptr]
#[inline]
pub const fn as_ptr(&self) -> *const T {
Expand Down Expand Up @@ -2265,7 +2265,7 @@ impl<T, A: Allocator> Vec<T, A> {
/// ```
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_vec_string_slice", issue = "none")]
#[rustc_const_unstable(feature = "const_vec_string_slice", issue = "129041")]
#[rustc_confusables("length", "size")]
pub const fn len(&self) -> usize {
self.len
Expand All @@ -2283,7 +2283,7 @@ impl<T, A: Allocator> Vec<T, A> {
/// assert!(!v.is_empty());
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_vec_string_slice", issue = "none")]
#[rustc_const_unstable(feature = "const_vec_string_slice", issue = "129041")]
pub const fn is_empty(&self) -> bool {
self.len() == 0
}
Expand Down

0 comments on commit e6ee5d4

Please sign in to comment.