Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
81a5b94a
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,发现更多精彩内容 >>
提交
81a5b94a
编写于
1月 10, 2020
作者:
G
Guillaume Gomez
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
formatting
上级
fd4a88f3
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
28 addition
and
49 deletion
+28
-49
src/librustdoc/clean/inline.rs
src/librustdoc/clean/inline.rs
+3
-5
src/librustdoc/clean/mod.rs
src/librustdoc/clean/mod.rs
+2
-16
src/librustdoc/html/render.rs
src/librustdoc/html/render.rs
+8
-12
src/librustdoc/html/render/cache.rs
src/librustdoc/html/render/cache.rs
+15
-16
未找到文件。
src/librustdoc/clean/inline.rs
浏览文件 @
81a5b94a
...
...
@@ -284,11 +284,9 @@ fn build_type_alias_type(cx: &DocContext<'_>, did: DefId) -> Option<clean::Type>
pub
fn
build_ty
(
cx
:
&
DocContext
,
did
:
DefId
)
->
Option
<
clean
::
Type
>
{
match
cx
.tcx
.def_kind
(
did
)
?
{
DefKind
::
Struct
|
DefKind
::
Union
|
DefKind
::
Enum
|
DefKind
::
Const
|
DefKind
::
Static
=>
Some
(
cx
.tcx
.type_of
(
did
)
.clean
(
cx
)),
DefKind
::
Struct
|
DefKind
::
Union
|
DefKind
::
Enum
|
DefKind
::
Const
|
DefKind
::
Static
=>
{
Some
(
cx
.tcx
.type_of
(
did
)
.clean
(
cx
))
}
DefKind
::
TyAlias
=>
build_type_alias_type
(
cx
,
did
),
_
=>
None
,
}
...
...
src/librustdoc/clean/mod.rs
浏览文件 @
81a5b94a
...
...
@@ -1124,14 +1124,7 @@ fn clean(&self, cx: &DocContext<'_>) -> Item {
hir
::
ImplItemKind
::
TyAlias
(
ref
ty
)
=>
{
let
type_
=
ty
.clean
(
cx
);
let
item_type
=
type_
.def_id
()
.and_then
(|
did
|
inline
::
build_ty
(
cx
,
did
));
TypedefItem
(
Typedef
{
type_
,
generics
:
Generics
::
default
(),
item_type
,
},
true
,
)
TypedefItem
(
Typedef
{
type_
,
generics
:
Generics
::
default
(),
item_type
},
true
)
}
hir
::
ImplItemKind
::
OpaqueTy
(
ref
bounds
)
=>
OpaqueTyItem
(
OpaqueTy
{
bounds
:
bounds
.clean
(
cx
),
generics
:
Generics
::
default
()
},
...
...
@@ -2011,14 +2004,7 @@ fn clean(&self, cx: &DocContext<'_>) -> Item {
visibility
:
self
.vis
.clean
(
cx
),
stability
:
cx
.stability
(
self
.id
)
.clean
(
cx
),
deprecation
:
cx
.deprecation
(
self
.id
)
.clean
(
cx
),
inner
:
TypedefItem
(
Typedef
{
type_
,
generics
:
self
.gen
.clean
(
cx
),
item_type
,
},
false
,
),
inner
:
TypedefItem
(
Typedef
{
type_
,
generics
:
self
.gen
.clean
(
cx
),
item_type
},
false
),
}
}
}
...
...
src/librustdoc/html/render.rs
浏览文件 @
81a5b94a
...
...
@@ -3474,12 +3474,10 @@ fn render_deref_methods(
.items
.iter
()
.filter_map
(|
item
|
match
item
.inner
{
clean
::
TypedefItem
(
ref
t
,
true
)
=>
{
Some
(
match
*
t
{
clean
::
Typedef
{
item_type
:
Some
(
ref
type_
),
..
}
=>
(
&
t
.type_
,
type_
),
_
=>
(
&
t
.type_
,
&
t
.type_
),
})
}
clean
::
TypedefItem
(
ref
t
,
true
)
=>
Some
(
match
*
t
{
clean
::
Typedef
{
item_type
:
Some
(
ref
type_
),
..
}
=>
(
&
t
.type_
,
type_
),
_
=>
(
&
t
.type_
,
&
t
.type_
),
}),
_
=>
None
,
})
.next
()
...
...
@@ -4133,12 +4131,10 @@ fn sidebar_assoc_items(it: &clean::Item) -> String {
.items
.iter
()
.filter_map
(|
item
|
match
item
.inner
{
clean
::
TypedefItem
(
ref
t
,
true
)
=>
{
Some
(
match
*
t
{
clean
::
Typedef
{
item_type
:
Some
(
ref
type_
),
..
}
=>
(
&
t
.type_
,
type_
),
_
=>
(
&
t
.type_
,
&
t
.type_
),
})
}
clean
::
TypedefItem
(
ref
t
,
true
)
=>
Some
(
match
*
t
{
clean
::
Typedef
{
item_type
:
Some
(
ref
type_
),
..
}
=>
(
&
t
.type_
,
type_
),
_
=>
(
&
t
.type_
,
&
t
.type_
),
}),
_
=>
None
,
})
.next
()
...
...
src/librustdoc/html/render/cache.rs
浏览文件 @
81a5b94a
...
...
@@ -574,7 +574,8 @@ fn build_index(krate: &clean::Crate, cache: &mut Cache) -> String {
// has since been learned.
for
&
(
did
,
ref
item
)
in
orphan_impl_items
{
if
let
Some
(
&
(
ref
fqp
,
_
))
=
paths
.get
(
&
did
)
{
if
item
.name
.is_none
()
{
// this is most likely from a typedef
if
item
.name
.is_none
()
{
// this is most likely from a typedef
continue
;
}
search_index
.push
(
IndexItem
{
...
...
@@ -596,22 +597,20 @@ fn build_index(krate: &clean::Crate, cache: &mut Cache) -> String {
for
item
in
search_index
{
item
.parent_idx
=
match
item
.parent
{
Some
(
nodeid
)
=>
{
Some
(
if
nodeid_to_pathid
.contains_key
(
&
nodeid
)
{
*
nodeid_to_pathid
.get
(
&
nodeid
)
.expect
(
"no pathid"
)
}
else
{
let
pathid
=
lastpathid
;
nodeid_to_pathid
.insert
(
nodeid
,
pathid
);
lastpathid
+=
1
;
Some
(
nodeid
)
=>
Some
(
if
nodeid_to_pathid
.contains_key
(
&
nodeid
)
{
*
nodeid_to_pathid
.get
(
&
nodeid
)
.expect
(
"no pathid"
)
}
else
{
let
pathid
=
lastpathid
;
nodeid_to_pathid
.insert
(
nodeid
,
pathid
);
lastpathid
+=
1
;
if
let
Some
(
&
(
ref
fqp
,
short
))
=
paths
.get
(
&
nodeid
)
{
crate_paths
.push
((
short
,
fqp
.last
()
.expect
(
"no fqp"
)
.clone
()));
}
else
{
continue
}
pathid
})
}
if
let
Some
(
&
(
ref
fqp
,
short
))
=
paths
.get
(
&
nodeid
)
{
crate_paths
.push
((
short
,
fqp
.last
()
.expect
(
"no fqp"
)
.clone
()));
}
else
{
continue
;
}
pathid
}),
None
=>
None
,
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录