Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
10602f1d
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,发现更多精彩内容 >>
提交
10602f1d
编写于
2月 15, 2019
作者:
V
varkor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Drive-by cleanup
Co-Authored-By:
N
Gabriel Smith
<
yodaldevoid@users.noreply.github.com
>
上级
7f3c6d7c
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
10 addition
and
20 deletion
+10
-20
src/librustc/hir/def.rs
src/librustc/hir/def.rs
+1
-1
src/librustc/hir/pat_util.rs
src/librustc/hir/pat_util.rs
+0
-13
src/librustc/middle/reachable.rs
src/librustc/middle/reachable.rs
+5
-2
src/librustdoc/clean/mod.rs
src/librustdoc/clean/mod.rs
+3
-3
src/librustdoc/core.rs
src/librustdoc/core.rs
+1
-1
未找到文件。
src/librustc/hir/def.rs
浏览文件 @
10602f1d
...
...
@@ -52,13 +52,13 @@ pub enum Def {
AssociatedExistential
(
DefId
),
PrimTy
(
hir
::
PrimTy
),
TyParam
(
DefId
),
ConstParam
(
DefId
),
SelfTy
(
Option
<
DefId
>
/* trait */
,
Option
<
DefId
>
/* impl */
),
ToolMod
,
// e.g., `rustfmt` in `#[rustfmt::skip]`
// Value namespace
Fn
(
DefId
),
Const
(
DefId
),
ConstParam
(
DefId
),
Static
(
DefId
,
bool
/* is_mutbl */
),
StructCtor
(
DefId
,
CtorKind
),
// `DefId` refers to `NodeId` of the struct's constructor
VariantCtor
(
DefId
,
CtorKind
),
// `DefId` refers to the enum variant
...
...
src/librustc/hir/pat_util.rs
浏览文件 @
10602f1d
...
...
@@ -64,19 +64,6 @@ pub fn is_refutable(&self) -> bool {
}
}
pub
fn
is_const
(
&
self
)
->
bool
{
match
self
.node
{
PatKind
::
Path
(
hir
::
QPath
::
TypeRelative
(
..
))
=>
true
,
PatKind
::
Path
(
hir
::
QPath
::
Resolved
(
_
,
ref
path
))
=>
{
match
path
.def
{
Def
::
Const
(
..
)
|
Def
::
AssociatedConst
(
..
)
=>
true
,
_
=>
false
}
}
_
=>
false
}
}
/// Call `f` on every "binding" in a pattern, e.g., on `a` in
/// `match foo() { Some(a) => (), None => () }`
pub
fn
each_binding
<
F
>
(
&
self
,
mut
f
:
F
)
...
...
src/librustc/middle/reachable.rs
浏览文件 @
10602f1d
...
...
@@ -315,8 +315,11 @@ fn propagate_node(&mut self, node: &Node<'tcx>,
Node
::
Ty
(
_
)
|
Node
::
MacroDef
(
_
)
=>
{}
_
=>
{
bug!
(
"found unexpected thingy in worklist: {}"
,
self
.tcx
.hir
()
.node_to_string
(
search_item
))
bug!
(
"found unexpected node kind in worklist: {} ({:?})"
,
self
.tcx
.hir
()
.node_to_string
(
search_item
),
node
,
);
}
}
}
...
...
src/librustdoc/clean/mod.rs
浏览文件 @
10602f1d
...
...
@@ -1502,7 +1502,7 @@ fn clean(&self, cx: &DocContext) -> GenericParamDef {
};
(
name
,
GenericParamDefKind
::
Lifetime
)
}
hir
::
GenericParamKind
::
Type
{
ref
default
,
synthetic
,
..
}
=>
{
hir
::
GenericParamKind
::
Type
{
ref
default
,
synthetic
}
=>
{
(
self
.name
.ident
()
.name
.clean
(
cx
),
GenericParamDefKind
::
Type
{
did
:
cx
.tcx
.hir
()
.local_def_id
(
self
.id
),
bounds
:
self
.bounds
.clean
(
cx
),
...
...
@@ -2577,7 +2577,7 @@ fn clean(&self, cx: &DocContext) -> Type {
let
mut
j
=
0
;
let
lifetime
=
generic_args
.args
.iter
()
.find_map
(|
arg
|
{
match
arg
{
GenericArg
::
Lifetime
(
lt
)
=>
{
hir
::
GenericArg
::
Lifetime
(
lt
)
=>
{
if
indices
.lifetimes
==
j
{
return
Some
(
lt
);
}
...
...
@@ -2602,7 +2602,7 @@ fn clean(&self, cx: &DocContext) -> Type {
let
mut
j
=
0
;
let
type_
=
generic_args
.args
.iter
()
.find_map
(|
arg
|
{
match
arg
{
GenericArg
::
Type
(
ty
)
=>
{
hir
::
GenericArg
::
Type
(
ty
)
=>
{
if
indices
.types
==
j
{
return
Some
(
ty
);
}
...
...
src/librustdoc/core.rs
浏览文件 @
10602f1d
...
...
@@ -218,7 +218,7 @@ pub fn generics_to_path_params(&self, generics: ty::Generics) -> hir::GenericArg
name
:
hir
::
LifetimeName
::
Param
(
name
),
}));
}
ty
::
GenericParamDefKind
::
Type
{
..
}
=>
{
ty
::
GenericParamDefKind
::
Type
{
..
}
=>
{
args
.push
(
hir
::
GenericArg
::
Type
(
self
.ty_param_to_ty
(
param
.clone
())));
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录