Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
4a00421b
R
Rust
项目概览
int
/
Rust
大约 1 年 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
Rust
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4a00421b
编写于
8月 20, 2020
作者:
T
Tomasz Miąsko
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Make raw standard stream constructors const
上级
479c23bb
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
33 addition
and
30 deletion
+33
-30
library/std/src/io/stdio.rs
library/std/src/io/stdio.rs
+6
-3
library/std/src/sys/cloudabi/stdio.rs
library/std/src/sys/cloudabi/stdio.rs
+3
-3
library/std/src/sys/hermit/stdio.rs
library/std/src/sys/hermit/stdio.rs
+3
-3
library/std/src/sys/sgx/stdio.rs
library/std/src/sys/sgx/stdio.rs
+3
-3
library/std/src/sys/unix/stdio.rs
library/std/src/sys/unix/stdio.rs
+3
-3
library/std/src/sys/unsupported/stdio.rs
library/std/src/sys/unsupported/stdio.rs
+3
-3
library/std/src/sys/vxworks/stdio.rs
library/std/src/sys/vxworks/stdio.rs
+3
-3
library/std/src/sys/wasi/stdio.rs
library/std/src/sys/wasi/stdio.rs
+3
-3
library/std/src/sys/windows/stdio.rs
library/std/src/sys/windows/stdio.rs
+3
-3
library/std/src/sys/windows/stdio_uwp.rs
library/std/src/sys/windows/stdio_uwp.rs
+3
-3
未找到文件。
library/std/src/io/stdio.rs
浏览文件 @
4a00421b
...
...
@@ -50,7 +50,8 @@
/// 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
())
}
...
...
library/std/src/sys/cloudabi/stdio.rs
浏览文件 @
4a00421b
...
...
@@ -6,7 +6,7 @@
pub
struct
Stderr
(());
impl
Stdin
{
pub
fn
new
()
->
Stdin
{
pub
const
fn
new
()
->
Stdin
{
Stdin
(())
}
}
...
...
@@ -18,7 +18,7 @@ fn read(&mut self, _buf: &mut [u8]) -> io::Result<usize> {
}
impl
Stdout
{
pub
fn
new
()
->
Stdout
{
pub
const
fn
new
()
->
Stdout
{
Stdout
(())
}
}
...
...
@@ -37,7 +37,7 @@ fn flush(&mut self) -> io::Result<()> {
}
impl
Stderr
{
pub
fn
new
()
->
Stderr
{
pub
const
fn
new
()
->
Stderr
{
Stderr
(())
}
}
...
...
library/std/src/sys/hermit/stdio.rs
浏览文件 @
4a00421b
...
...
@@ -7,7 +7,7 @@
pub
struct
Stderr
;
impl
Stdin
{
pub
fn
new
()
->
Stdin
{
pub
const
fn
new
()
->
Stdin
{
Stdin
}
}
...
...
@@ -28,7 +28,7 @@ fn is_read_vectored(&self) -> bool {
}
impl
Stdout
{
pub
fn
new
()
->
Stdout
{
pub
const
fn
new
()
->
Stdout
{
Stdout
}
}
...
...
@@ -69,7 +69,7 @@ fn flush(&mut self) -> io::Result<()> {
}
impl
Stderr
{
pub
fn
new
()
->
Stderr
{
pub
const
fn
new
()
->
Stderr
{
Stderr
}
}
...
...
library/std/src/sys/sgx/stdio.rs
浏览文件 @
4a00421b
...
...
@@ -19,7 +19,7 @@ fn with_std_fd<F: FnOnce(&FileDesc) -> R, R>(fd: abi::Fd, f: F) -> R {
}
impl
Stdin
{
pub
fn
new
()
->
Stdin
{
pub
const
fn
new
()
->
Stdin
{
Stdin
(())
}
}
...
...
@@ -31,7 +31,7 @@ fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
}
impl
Stdout
{
pub
fn
new
()
->
Stdout
{
pub
const
fn
new
()
->
Stdout
{
Stdout
(())
}
}
...
...
@@ -47,7 +47,7 @@ fn flush(&mut self) -> io::Result<()> {
}
impl
Stderr
{
pub
fn
new
()
->
Stderr
{
pub
const
fn
new
()
->
Stderr
{
Stderr
(())
}
}
...
...
library/std/src/sys/unix/stdio.rs
浏览文件 @
4a00421b
...
...
@@ -7,7 +7,7 @@
pub
struct
Stderr
(());
impl
Stdin
{
pub
fn
new
()
->
Stdin
{
pub
const
fn
new
()
->
Stdin
{
Stdin
(())
}
}
...
...
@@ -28,7 +28,7 @@ fn is_read_vectored(&self) -> bool {
}
impl
Stdout
{
pub
fn
new
()
->
Stdout
{
pub
const
fn
new
()
->
Stdout
{
Stdout
(())
}
}
...
...
@@ -53,7 +53,7 @@ fn flush(&mut self) -> io::Result<()> {
}
impl
Stderr
{
pub
fn
new
()
->
Stderr
{
pub
const
fn
new
()
->
Stderr
{
Stderr
(())
}
}
...
...
library/std/src/sys/unsupported/stdio.rs
浏览文件 @
4a00421b
...
...
@@ -5,7 +5,7 @@
pub
struct
Stderr
;
impl
Stdin
{
pub
fn
new
()
->
Stdin
{
pub
const
fn
new
()
->
Stdin
{
Stdin
}
}
...
...
@@ -17,7 +17,7 @@ fn read(&mut self, _buf: &mut [u8]) -> io::Result<usize> {
}
impl
Stdout
{
pub
fn
new
()
->
Stdout
{
pub
const
fn
new
()
->
Stdout
{
Stdout
}
}
...
...
@@ -33,7 +33,7 @@ fn flush(&mut self) -> io::Result<()> {
}
impl
Stderr
{
pub
fn
new
()
->
Stderr
{
pub
const
fn
new
()
->
Stderr
{
Stderr
}
}
...
...
library/std/src/sys/vxworks/stdio.rs
浏览文件 @
4a00421b
...
...
@@ -6,7 +6,7 @@
pub
struct
Stderr
(());
impl
Stdin
{
pub
fn
new
()
->
Stdin
{
pub
const
fn
new
()
->
Stdin
{
Stdin
(())
}
}
...
...
@@ -21,7 +21,7 @@ fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
}
impl
Stdout
{
pub
fn
new
()
->
Stdout
{
pub
const
fn
new
()
->
Stdout
{
Stdout
(())
}
}
...
...
@@ -40,7 +40,7 @@ fn flush(&mut self) -> io::Result<()> {
}
impl
Stderr
{
pub
fn
new
()
->
Stderr
{
pub
const
fn
new
()
->
Stderr
{
Stderr
(())
}
}
...
...
library/std/src/sys/wasi/stdio.rs
浏览文件 @
4a00421b
...
...
@@ -7,7 +7,7 @@
pub
struct
Stderr
;
impl
Stdin
{
pub
fn
new
()
->
Stdin
{
pub
const
fn
new
()
->
Stdin
{
Stdin
}
...
...
@@ -33,7 +33,7 @@ fn is_read_vectored(&self) -> bool {
}
impl
Stdout
{
pub
fn
new
()
->
Stdout
{
pub
const
fn
new
()
->
Stdout
{
Stdout
}
...
...
@@ -62,7 +62,7 @@ fn flush(&mut self) -> io::Result<()> {
}
impl
Stderr
{
pub
fn
new
()
->
Stderr
{
pub
const
fn
new
()
->
Stderr
{
Stderr
}
...
...
library/std/src/sys/windows/stdio.rs
浏览文件 @
4a00421b
...
...
@@ -131,7 +131,7 @@ fn write_u16s(handle: c::HANDLE, data: &[u16]) -> io::Result<usize> {
}
impl
Stdin
{
pub
fn
new
()
->
Stdin
{
pub
const
fn
new
()
->
Stdin
{
Stdin
{
surrogate
:
0
}
}
}
...
...
@@ -255,7 +255,7 @@ fn utf16_to_utf8(utf16: &[u16], utf8: &mut [u8]) -> io::Result<usize> {
}
impl
Stdout
{
pub
fn
new
()
->
Stdout
{
pub
const
fn
new
()
->
Stdout
{
Stdout
}
}
...
...
@@ -271,7 +271,7 @@ fn flush(&mut self) -> io::Result<()> {
}
impl
Stderr
{
pub
fn
new
()
->
Stderr
{
pub
const
fn
new
()
->
Stderr
{
Stderr
}
}
...
...
library/std/src/sys/windows/stdio_uwp.rs
浏览文件 @
4a00421b
...
...
@@ -30,7 +30,7 @@ fn write(handle_id: c::DWORD, data: &[u8]) -> io::Result<usize> {
}
impl
Stdin
{
pub
fn
new
()
->
Stdin
{
pub
const
fn
new
()
->
Stdin
{
Stdin
{}
}
}
...
...
@@ -44,7 +44,7 @@ fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
}
impl
Stdout
{
pub
fn
new
()
->
Stdout
{
pub
const
fn
new
()
->
Stdout
{
Stdout
}
}
...
...
@@ -60,7 +60,7 @@ fn flush(&mut self) -> io::Result<()> {
}
impl
Stderr
{
pub
fn
new
()
->
Stderr
{
pub
const
fn
new
()
->
Stderr
{
Stderr
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录