Make raw standard stream constructors const

This commit is contained in:
Tomasz Miąsko
2020-08-20 00:00:00 +00:00
parent 479c23bb49
commit 4a00421ba4
10 changed files with 33 additions and 30 deletions

View File

@@ -50,7 +50,8 @@ struct StderrRaw(stdio::Stderr);
/// handles is **not** available to raw handles returned from this function.
///
/// The returned handle has no external synchronization or buffering.
fn stdin_raw() -> StdinRaw {
#[unstable(feature = "libstd_sys_internals", issue = "none")]
const fn stdin_raw() -> StdinRaw {
StdinRaw(stdio::Stdin::new())
}
@@ -63,7 +64,8 @@ fn stdin_raw() -> StdinRaw {
///
/// The returned handle has no external synchronization or buffering layered on
/// top.
fn stdout_raw() -> StdoutRaw {
#[unstable(feature = "libstd_sys_internals", issue = "none")]
const fn stdout_raw() -> StdoutRaw {
StdoutRaw(stdio::Stdout::new())
}
@@ -74,7 +76,8 @@ fn stdout_raw() -> StdoutRaw {
///
/// The returned handle has no external synchronization or buffering layered on
/// top.
fn stderr_raw() -> StderrRaw {
#[unstable(feature = "libstd_sys_internals", issue = "none")]
const fn stderr_raw() -> StderrRaw {
StderrRaw(stdio::Stderr::new())
}