1
Fork 0

Stabilize const_io_structs

This commit is contained in:
Slanterns 2024-04-17 08:09:13 +08:00
parent ad18fe08de
commit b7f4332737
No known key found for this signature in database
GPG key ID: 1AA37EE7FAAE433A
3 changed files with 6 additions and 7 deletions

View file

@ -95,7 +95,7 @@ impl<T> Cursor<T> {
/// # force_inference(&buff);
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_io_structs", issue = "78812")]
#[rustc_const_stable(feature = "const_io_structs", since = "CURRENT_RUSTC_VERSION")]
pub const fn new(inner: T) -> Cursor<T> {
Cursor { pos: 0, inner }
}
@ -132,7 +132,7 @@ impl<T> Cursor<T> {
/// let reference = buff.get_ref();
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_io_structs", issue = "78812")]
#[rustc_const_stable(feature = "const_io_structs", since = "CURRENT_RUSTC_VERSION")]
pub const fn get_ref(&self) -> &T {
&self.inner
}
@ -178,7 +178,7 @@ impl<T> Cursor<T> {
/// assert_eq!(buff.position(), 1);
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_io_structs", issue = "78812")]
#[rustc_const_stable(feature = "const_io_structs", since = "CURRENT_RUSTC_VERSION")]
pub const fn position(&self) -> u64 {
self.pos
}

View file

@ -51,7 +51,7 @@ pub struct Empty;
/// ```
#[must_use]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_io_structs", issue = "78812")]
#[rustc_const_stable(feature = "const_io_structs", since = "CURRENT_RUSTC_VERSION")]
pub const fn empty() -> Empty {
Empty
}
@ -173,7 +173,7 @@ pub struct Repeat {
/// ```
#[must_use]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_io_structs", issue = "78812")]
#[rustc_const_stable(feature = "const_io_structs", since = "CURRENT_RUSTC_VERSION")]
pub const fn repeat(byte: u8) -> Repeat {
Repeat { byte }
}
@ -276,7 +276,7 @@ pub struct Sink;
/// ```
#[must_use]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_io_structs", issue = "78812")]
#[rustc_const_stable(feature = "const_io_structs", since = "CURRENT_RUSTC_VERSION")]
pub const fn sink() -> Sink {
Sink
}