Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
5dc80dc3
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,发现更多精彩内容 >>
未验证
提交
5dc80dc3
编写于
3月 28, 2018
作者:
K
kennytm
提交者:
GitHub
3月 28, 2018
浏览文件
操作
浏览文件
下载
差异文件
Rollup merge of #49442 - GuillaumeGomez:text-overlap, r=QuietMisdreavus
Fix text overlap Fixes #49006. r? @QuietMisdreavus
上级
1a892503
51f26aca
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
55 addition
and
32 deletion
+55
-32
src/librustdoc/html/render.rs
src/librustdoc/html/render.rs
+17
-16
src/librustdoc/html/static/rustdoc.css
src/librustdoc/html/static/rustdoc.css
+26
-4
src/test/rustdoc/synthetic_auto/complex.rs
src/test/rustdoc/synthetic_auto/complex.rs
+1
-1
src/test/rustdoc/synthetic_auto/lifetimes.rs
src/test/rustdoc/synthetic_auto/lifetimes.rs
+2
-2
src/test/rustdoc/synthetic_auto/manual.rs
src/test/rustdoc/synthetic_auto/manual.rs
+2
-2
src/test/rustdoc/synthetic_auto/negative.rs
src/test/rustdoc/synthetic_auto/negative.rs
+2
-2
src/test/rustdoc/synthetic_auto/nested.rs
src/test/rustdoc/synthetic_auto/nested.rs
+2
-2
src/test/rustdoc/synthetic_auto/no-redundancy.rs
src/test/rustdoc/synthetic_auto/no-redundancy.rs
+1
-1
src/test/rustdoc/synthetic_auto/project.rs
src/test/rustdoc/synthetic_auto/project.rs
+2
-2
未找到文件。
src/librustdoc/html/render.rs
浏览文件 @
5dc80dc3
...
...
@@ -2243,14 +2243,7 @@ fn item_function(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item,
fn
render_implementor
(
cx
:
&
Context
,
implementor
:
&
Impl
,
w
:
&
mut
fmt
::
Formatter
,
implementor_dups
:
&
FxHashMap
<&
str
,
(
DefId
,
bool
)
>
)
->
Result
<
(),
fmt
::
Error
>
{
write!
(
w
,
"<li>"
)
?
;
if
let
Some
(
l
)
=
(
Item
{
cx
,
item
:
&
implementor
.impl_item
})
.src_href
()
{
write!
(
w
,
"<div class='out-of-band'>"
)
?
;
write!
(
w
,
"<a class='srclink' href='{}' title='{}'>[src]</a>"
,
l
,
"goto source code"
)
?
;
write!
(
w
,
"</div>"
)
?
;
}
write!
(
w
,
"<code>"
)
?
;
write!
(
w
,
"<li><table class='table-display'><tbody><tr><td><code>"
)
?
;
// If there's already another implementor that has the same abbridged name, use the
// full path, for example in `std::iter::ExactSizeIterator`
let
use_absolute
=
match
implementor
.inner_impl
()
.for_
{
...
...
@@ -2269,7 +2262,14 @@ fn render_implementor(cx: &Context, implementor: &Impl, w: &mut fmt::Formatter,
write!
(
w
,
";</span>"
)
?
;
}
}
writeln!
(
w
,
"</code></li>"
)
?
;
write!
(
w
,
"</code><td>"
)
?
;
if
let
Some
(
l
)
=
(
Item
{
cx
,
item
:
&
implementor
.impl_item
})
.src_href
()
{
write!
(
w
,
"<div class='out-of-band'>"
)
?
;
write!
(
w
,
"<a class='srclink' href='{}' title='{}'>[src]</a>"
,
l
,
"goto source code"
)
?
;
write!
(
w
,
"</div>"
)
?
;
}
writeln!
(
w
,
"</td></tr></tbody></table></li>"
)
?
;
Ok
(())
}
...
...
@@ -3314,10 +3314,11 @@ fn render_impl(w: &mut fmt::Formatter, cx: &Context, i: &Impl, link: AssocItemLi
Some
(
ref
t
)
=>
format!
(
"impl-{}"
,
small_url_encode
(
&
format!
(
"{:#}"
,
t
))),
None
=>
"impl"
.to_string
(),
});
write!
(
w
,
"<h3 id='{}' class='impl'><span class='in-band'><code>{}</code>"
,
write!
(
w
,
"<h3 id='{}' class='impl'><span class='in-band'><table class='table-display'>
\
<tbody><tr><td><code>{}</code>"
,
id
,
i
.inner_impl
())
?
;
write!
(
w
,
"<a href='#{}' class='anchor'></a>"
,
id
)
?
;
write!
(
w
,
"</span><span class='out-of-band'>"
)
?
;
write!
(
w
,
"</span><
/td><td><
span class='out-of-band'>"
)
?
;
let
since
=
i
.impl_item.stability
.as_ref
()
.map
(|
s
|
&
s
.since
[
..
]);
if
let
Some
(
l
)
=
(
Item
{
item
:
&
i
.impl_item
,
cx
:
cx
})
.src_href
()
{
write!
(
w
,
"<div class='ghost'></div>"
)
?
;
...
...
@@ -3327,8 +3328,7 @@ fn render_impl(w: &mut fmt::Formatter, cx: &Context, i: &Impl, link: AssocItemLi
}
else
{
render_stability_since_raw
(
w
,
since
,
outer_version
)
?
;
}
write!
(
w
,
"</span>"
)
?
;
write!
(
w
,
"</h3>
\n
"
)
?
;
write!
(
w
,
"</span></td></tr></tbody></table></h3>"
)
?
;
if
let
Some
(
ref
dox
)
=
cx
.shared
.maybe_collapsed_doc_value
(
&
i
.impl_item
)
{
write!
(
w
,
"<div class='docblock'>{}</div>"
,
Markdown
(
&*
dox
,
&
i
.impl_item
.links
()))
?
;
...
...
@@ -3357,19 +3357,20 @@ fn doc_impl_item(w: &mut fmt::Formatter, cx: &Context, item: &clean::Item,
write!
(
w
,
"<h4 id='{}' class=
\"
{}
\"
>"
,
id
,
item_type
)
?
;
write!
(
w
,
"{}"
,
spotlight_decl
(
decl
)
?
)
?
;
write!
(
w
,
"<span id='{}' class='invisible'>"
,
ns_id
)
?
;
write!
(
w
,
"<code>"
)
?
;
write!
(
w
,
"<
table class='table-display'><tbody><tr><td><
code>"
)
?
;
render_assoc_item
(
w
,
item
,
link
.anchor
(
&
id
),
ItemType
::
Impl
)
?
;
write!
(
w
,
"</code>"
)
?
;
if
let
Some
(
l
)
=
(
Item
{
cx
,
item
})
.src_href
()
{
write!
(
w
,
"</span><span class='out-of-band'>"
)
?
;
write!
(
w
,
"</span><
/td><td><
span class='out-of-band'>"
)
?
;
write!
(
w
,
"<div class='ghost'></div>"
)
?
;
render_stability_since_raw
(
w
,
item
.stable_since
(),
outer_version
)
?
;
write!
(
w
,
"<a class='srclink' href='{}' title='{}'>[src]</a>"
,
l
,
"goto source code"
)
?
;
}
else
{
write!
(
w
,
"</td><td>"
)
?
;
render_stability_since_raw
(
w
,
item
.stable_since
(),
outer_version
)
?
;
}
write!
(
w
,
"</
span></h4>
\n
"
)
?
;
write!
(
w
,
"</
td></tr></tbody></table></span></h4>
"
)
?
;
}
}
clean
::
TypedefItem
(
ref
tydef
,
_
)
=>
{
...
...
src/librustdoc/html/static/rustdoc.css
浏览文件 @
5dc80dc3
...
...
@@ -392,8 +392,6 @@ h4 > code, h3 > code, .invisible > code {
.content
.in-band
{
margin
:
0px
;
padding
:
0px
;
display
:
inline-block
;
max-width
:
calc
(
100%
-
43px
);
}
.in-band
>
code
{
...
...
@@ -408,7 +406,7 @@ h4 > code, h3 > code, .invisible > code {
font-family
:
"Fira Sans"
,
"Helvetica Neue"
,
Helvetica
,
Arial
,
sans-serif
;
}
.content
table
{
.content
table
:not
(
.table-display
)
{
border-spacing
:
0
5px
;
border-collapse
:
separate
;
}
...
...
@@ -475,7 +473,6 @@ h4 > code, h3 > code, .invisible > code {
.content
.methods
>
div
:not
(
.important-traits
)
{
margin-left
:
40px
;
}
.content
.impl-items
.docblock
,
.content
.impl-items
.stability
{
margin-left
:
40px
;
margin-bottom
:
.6em
;
}
.content
.impl-items
.method
,
.content
.impl-items
>
.type
,
.impl-items
>
.associatedconstant
{
...
...
@@ -1267,3 +1264,28 @@ kbd {
/* important because of conflicting rule for small screens */
display
:
none
!important
;
}
#implementations-list
>
h3
>
span
.in-band
{
width
:
100%
;
}
.table-display
{
width
:
100%
;
border
:
0
;
border-collapse
:
collapse
;
border-spacing
:
0
;
font-size
:
16px
;
}
.table-display
tr
td
:first-child
{
padding-right
:
0
;
}
.table-display
tr
td
:last-child
{
float
:
right
;
}
.table-display
.out-of-band
{
position
:
relative
;
font-size
:
19px
;
display
:
block
;
}
src/test/rustdoc/synthetic_auto/complex.rs
浏览文件 @
5dc80dc3
...
...
@@ -30,7 +30,7 @@ pub struct Foo<T> {
}
// @has complex/struct.NotOuter.html
// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]/*/code' "impl<'a, T, K: \
// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]/
/
*/code' "impl<'a, T, K: \
// ?Sized> Send for NotOuter<'a, T, K> where K: for<'b> Fn((&'b bool, &'a u8)) \
// -> &'b i8, T: MyTrait<'a>, <T as MyTrait<'a>>::MyItem: Copy, 'a: 'static"
...
...
src/test/rustdoc/synthetic_auto/lifetimes.rs
浏览文件 @
5dc80dc3
...
...
@@ -18,10 +18,10 @@ unsafe impl<'a, T> Send for Inner<'a, T>
{}
// @has lifetimes/struct.Foo.html
// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]/*/code' "impl<'c, K> Send \
// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]/
/
*/code' "impl<'c, K> Send \
// for Foo<'c, K> where K: for<'b> Fn(&'b bool) -> &'c u8, 'c: 'static"
//
// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]/*/code' "impl<'c, K> Sync \
// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]/
/
*/code' "impl<'c, K> Sync \
// for Foo<'c, K> where K: Sync"
pub
struct
Foo
<
'c
,
K
:
'c
>
{
inner_field
:
Inner
<
'c
,
K
>
,
...
...
src/test/rustdoc/synthetic_auto/manual.rs
浏览文件 @
5dc80dc3
...
...
@@ -9,10 +9,10 @@
// except according to those terms.
// @has manual/struct.Foo.html
// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]/*/code' 'impl<T> Sync for \
// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]/
/
*/code' 'impl<T> Sync for \
// Foo<T> where T: Sync'
//
// @has - '//*[@id="implementations-list"]/*[@class="impl"]/*/code' \
// @has - '//*[@id="implementations-list"]/*[@class="impl"]/
/
*/code' \
// 'impl<T> Send for Foo<T>'
//
// @count - '//*[@id="implementations-list"]/*[@class="impl"]' 1
...
...
src/test/rustdoc/synthetic_auto/negative.rs
浏览文件 @
5dc80dc3
...
...
@@ -13,10 +13,10 @@ pub struct Inner<T: Copy> {
}
// @has negative/struct.Outer.html
// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]/*/code' "impl<T> !Send for \
// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]/
/
*/code' "impl<T> !Send for \
// Outer<T>"
//
// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]/*/code' "impl<T> \
// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]/
/
*/code' "impl<T> \
// !Sync for Outer<T>"
pub
struct
Outer
<
T
:
Copy
>
{
inner_field
:
Inner
<
T
>
,
...
...
src/test/rustdoc/synthetic_auto/nested.rs
浏览文件 @
5dc80dc3
...
...
@@ -18,10 +18,10 @@ unsafe impl<T> Send for Inner<T>
}
// @has nested/struct.Foo.html
// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]/*/code' 'impl<T> Send for \
// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]/
/
*/code' 'impl<T> Send for \
// Foo<T> where T: Copy'
//
// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]/*/code' \
// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]/
/
*/code' \
// 'impl<T> Sync for Foo<T> where T: Sync'
pub
struct
Foo
<
T
>
{
inner_field
:
Inner
<
T
>
,
...
...
src/test/rustdoc/synthetic_auto/no-redundancy.rs
浏览文件 @
5dc80dc3
...
...
@@ -19,7 +19,7 @@ unsafe impl<T> Send for Inner<T>
}
// @has no_redundancy/struct.Outer.html
// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]/*/code' "impl<T> Send for \
// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]/
/
*/code' "impl<T> Send for \
// Outer<T> where T: Copy + Send"
pub
struct
Outer
<
T
>
{
inner_field
:
Inner
<
T
>
,
...
...
src/test/rustdoc/synthetic_auto/project.rs
浏览文件 @
5dc80dc3
...
...
@@ -33,10 +33,10 @@ unsafe impl<'a, T> Sync for Inner<'a, T>
}
// @has project/struct.Foo.html
// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]/*/code' "impl<'c, K> Send \
// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]/
/
*/code' "impl<'c, K> Send \
// for Foo<'c, K> where K: MyTrait<MyItem = bool>, 'c: 'static"
//
// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]/*/code' "impl<'c, K> Sync \
// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]/
/
*/code' "impl<'c, K> Sync \
// for Foo<'c, K> where K: MyTrait, <K as MyTrait>::MyItem: OtherTrait, 'c: 'static,"
pub
struct
Foo
<
'c
,
K
:
'c
>
{
inner_field
:
Inner
<
'c
,
K
>
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录