Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
d8afe98e
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,发现更多精彩内容 >>
提交
d8afe98e
编写于
10月 18, 2020
作者:
C
Camelid
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Clean up docs for 'as' keyword
上级
a4d30a7b
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
13 addition
and
6 deletion
+13
-6
library/std/src/keyword_docs.rs
library/std/src/keyword_docs.rs
+13
-6
未找到文件。
library/std/src/keyword_docs.rs
浏览文件 @
d8afe98e
...
...
@@ -15,18 +15,24 @@
/// ```
///
/// In general, any cast that can be performed via ascribing the type can also be done using `as`,
/// so instead of writing `let x: u32 = 123`, you can write `let x = 123 as u32` (
N
ote: `let x: u32
/// = 123` would be best in that situation). The same is not true in the other direction, however
,
/// so instead of writing `let x: u32 = 123`, you can write `let x = 123 as u32` (
n
ote: `let x: u32
/// = 123` would be best in that situation). The same is not true in the other direction, however
;
/// explicitly using `as` allows a few more coercions that aren't allowed implicitly, such as
/// changing the type of a raw pointer or turning closures into raw pointers.
///
/// Other places `as` is used include as extra syntax for [`crate`] and `use`, to change the name
/// something is imported as.
/// `as` is also used to rename imports in [`use`] and [`extern crate`] statements:
///
/// For more information on what `as` is capable of, see the [Reference]
/// ```
/// # #[allow(unused_imports)]
/// use std::{mem as memory, net as network};
/// // Now you can use the names `memory` and `network` to refer to `std::mem` and `std::net`.
/// ```
///
/// For more information on what `as` is capable of, see the [Reference].
///
/// [Reference]: ../reference/expressions/operator-expr.html#type-cast-expressions
/// [`crate`]: keyword.crate.html
/// [`use`]: keyword.use.html
/// [`extern crate`]: keyword.crate.html
mod
as_keyword
{}
#[doc(keyword
=
"break"
)]
...
...
@@ -397,6 +403,7 @@ mod enum_keyword {}
/// [Rust book]:
/// ../book/ch19-01-unsafe-rust.html#using-extern-functions-to-call-external-code
/// [Reference]: ../reference/items/external-blocks.html
/// [`crate`]: keyword.crate.html
mod
extern_keyword
{}
#[doc(keyword
=
"false"
)]
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录