mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 08:44:35 +00:00
Rollup merge of #124049 - slanterns:const_io_structs_stabilize, r=jhpratt
Stabilize `const_io_structs` This PR stabilizes `const_io_structs`. Tracking issue: https://github.com/rust-lang/rust/issues/78812. Implementation PR: https://github.com/rust-lang/rust/pull/78811. FCPs already completed in the tracking issue. Closes https://github.com/rust-lang/rust/issues/78812. ```@rustbot``` label: +T-libs-api r? libs-api
This commit is contained in:
commit
8f3fd9394f
@ -95,7 +95,7 @@ impl<T> Cursor<T> {
|
|||||||
/// # force_inference(&buff);
|
/// # force_inference(&buff);
|
||||||
/// ```
|
/// ```
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[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> {
|
pub const fn new(inner: T) -> Cursor<T> {
|
||||||
Cursor { pos: 0, inner }
|
Cursor { pos: 0, inner }
|
||||||
}
|
}
|
||||||
@ -132,7 +132,7 @@ impl<T> Cursor<T> {
|
|||||||
/// let reference = buff.get_ref();
|
/// let reference = buff.get_ref();
|
||||||
/// ```
|
/// ```
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[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 {
|
pub const fn get_ref(&self) -> &T {
|
||||||
&self.inner
|
&self.inner
|
||||||
}
|
}
|
||||||
@ -178,7 +178,7 @@ impl<T> Cursor<T> {
|
|||||||
/// assert_eq!(buff.position(), 1);
|
/// assert_eq!(buff.position(), 1);
|
||||||
/// ```
|
/// ```
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[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 {
|
pub const fn position(&self) -> u64 {
|
||||||
self.pos
|
self.pos
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,7 @@ pub struct Empty;
|
|||||||
/// ```
|
/// ```
|
||||||
#[must_use]
|
#[must_use]
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[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 {
|
pub const fn empty() -> Empty {
|
||||||
Empty
|
Empty
|
||||||
}
|
}
|
||||||
@ -173,7 +173,7 @@ pub struct Repeat {
|
|||||||
/// ```
|
/// ```
|
||||||
#[must_use]
|
#[must_use]
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[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 {
|
pub const fn repeat(byte: u8) -> Repeat {
|
||||||
Repeat { byte }
|
Repeat { byte }
|
||||||
}
|
}
|
||||||
@ -276,7 +276,7 @@ pub struct Sink;
|
|||||||
/// ```
|
/// ```
|
||||||
#[must_use]
|
#[must_use]
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[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 {
|
pub const fn sink() -> Sink {
|
||||||
Sink
|
Sink
|
||||||
}
|
}
|
||||||
|
@ -407,7 +407,6 @@
|
|||||||
// tidy-alphabetical-start
|
// tidy-alphabetical-start
|
||||||
#![feature(const_collections_with_hasher)]
|
#![feature(const_collections_with_hasher)]
|
||||||
#![feature(const_hash)]
|
#![feature(const_hash)]
|
||||||
#![feature(const_io_structs)]
|
|
||||||
#![feature(const_ip)]
|
#![feature(const_ip)]
|
||||||
#![feature(const_ipv4)]
|
#![feature(const_ipv4)]
|
||||||
#![feature(const_ipv6)]
|
#![feature(const_ipv6)]
|
||||||
|
Loading…
Reference in New Issue
Block a user