Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
7967152e
R
Rust
项目概览
int
/
Rust
11 个月 前同步成功
通知
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,发现更多精彩内容 >>
提交
7967152e
编写于
7月 06, 2022
作者:
G
Guillaume Gomez
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add test for inherent impls anchors
上级
7d205afa
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
56 addition
and
0 deletion
+56
-0
src/test/rustdoc/anchors.no_const_anchor.html
src/test/rustdoc/anchors.no_const_anchor.html
+1
-0
src/test/rustdoc/anchors.no_const_anchor2.html
src/test/rustdoc/anchors.no_const_anchor2.html
+1
-0
src/test/rustdoc/anchors.no_method_anchor.html
src/test/rustdoc/anchors.no_method_anchor.html
+1
-0
src/test/rustdoc/anchors.no_trait_method_anchor.html
src/test/rustdoc/anchors.no_trait_method_anchor.html
+1
-0
src/test/rustdoc/anchors.no_tymethod_anchor.html
src/test/rustdoc/anchors.no_tymethod_anchor.html
+1
-0
src/test/rustdoc/anchors.no_type_anchor.html
src/test/rustdoc/anchors.no_type_anchor.html
+1
-0
src/test/rustdoc/anchors.no_type_anchor2.html
src/test/rustdoc/anchors.no_type_anchor2.html
+1
-0
src/test/rustdoc/anchors.rs
src/test/rustdoc/anchors.rs
+49
-0
未找到文件。
src/test/rustdoc/anchors.no_const_anchor.html
0 → 100644
浏览文件 @
7967152e
<div
id=
"associatedconstant.YOLO"
class=
"method has-srclink"
><div
class=
"rightside"
><a
class=
"srclink"
href=
"../src/foo/anchors.rs.html#16"
>
source
</a></div><h4
class=
"code-header"
>
const
<a
href=
"#associatedconstant.YOLO"
class=
"constant"
>
YOLO
</a>
:
<a
class=
"primitive"
href=
"{{channel}}/std/primitive.u32.html"
>
u32
</a></h4></div>
src/test/rustdoc/anchors.no_const_anchor2.html
0 → 100644
浏览文件 @
7967152e
<section
id=
"associatedconstant.X"
class=
"associatedconstant has-srclink"
><span
class=
"rightside"
><a
class=
"srclink"
href=
"../src/foo/anchors.rs.html#42"
>
source
</a></span><h4
class=
"code-header"
>
pub const
<a
href=
"#associatedconstant.X"
class=
"constant"
>
X
</a>
:
<a
class=
"primitive"
href=
"{{channel}}/std/primitive.i32.html"
>
i32
</a>
= 0i32
</h4></section>
src/test/rustdoc/anchors.no_method_anchor.html
0 → 100644
浏览文件 @
7967152e
<section
id=
"method.new"
class=
"method has-srclink"
><span
class=
"rightside"
><a
class=
"srclink"
href=
"../src/foo/anchors.rs.html#48"
>
source
</a></span><h4
class=
"code-header"
>
pub fn
<a
href=
"#method.new"
class=
"fnname"
>
new
</a>
() -
>
Self
</h4></section>
\ No newline at end of file
src/test/rustdoc/anchors.no_trait_method_anchor.html
0 → 100644
浏览文件 @
7967152e
<div
id=
"method.bar"
class=
"method has-srclink"
><div
class=
"rightside"
><a
class=
"srclink"
href=
"../src/foo/anchors.rs.html#23"
>
source
</a></div><h4
class=
"code-header"
>
fn
<a
href=
"#method.bar"
class=
"fnname"
>
bar
</a>
()
</h4></div>
\ No newline at end of file
src/test/rustdoc/anchors.no_tymethod_anchor.html
0 → 100644
浏览文件 @
7967152e
<div
id=
"tymethod.foo"
class=
"method has-srclink"
><div
class=
"rightside"
><a
class=
"srclink"
href=
"../src/foo/anchors.rs.html#20"
>
source
</a></div><h4
class=
"code-header"
>
fn
<a
href=
"#tymethod.foo"
class=
"fnname"
>
foo
</a>
()
</h4></div>
\ No newline at end of file
src/test/rustdoc/anchors.no_type_anchor.html
0 → 100644
浏览文件 @
7967152e
<div
id=
"associatedtype.T"
class=
"method has-srclink"
><div
class=
"rightside"
><a
class=
"srclink"
href=
"../src/foo/anchors.rs.html#13"
>
source
</a></div><h4
class=
"code-header"
>
type
<a
href=
"#associatedtype.T"
class=
"associatedtype"
>
T
</a></h4></div>
\ No newline at end of file
src/test/rustdoc/anchors.no_type_anchor2.html
0 → 100644
浏览文件 @
7967152e
<section
id=
"associatedtype.Y"
class=
"associatedtype has-srclink"
><h4
class=
"code-header"
>
type
<a
href=
"#associatedtype.Y"
class=
"associatedtype"
>
Y
</a>
=
<a
class=
"primitive"
href=
"{{channel}}/std/primitive.u32.html"
>
u32
</a></h4></section>
src/test/rustdoc/anchors.rs
0 → 100644
浏览文件 @
7967152e
// This test ensures that anchors are generated in the right places.
#![feature(inherent_associated_types)]
#![allow(incomplete_features)]
#![crate_name
=
"foo"
]
pub
struct
Foo
;
// @has 'foo/trait.Bar.html'
pub
trait
Bar
{
// There should be no anchors here.
// @snapshot no_type_anchor - '//*[@id="associatedtype.T"]'
type
T
;
// There should be no anchors here.
// @snapshot no_const_anchor - '//*[@id="associatedconstant.YOLO"]'
const
YOLO
:
u32
;
// There should be no anchors here.
// @snapshot no_tymethod_anchor - '//*[@id="tymethod.foo"]'
fn
foo
();
// There should be no anchors here.
// @snapshot no_trait_method_anchor - '//*[@id="method.bar"]'
fn
bar
()
{}
}
// @has 'foo/struct.Foo.html'
impl
Bar
for
Foo
{
// @has - '//*[@id="associatedtype.T"]/a[@class="anchor"]' ''
type
T
=
u32
;
// @has - '//*[@id="associatedconstant.YOLO"]/a[@class="anchor"]' ''
const
YOLO
:
u32
=
0
;
// @has - '//*[@id="method.foo"]/a[@class="anchor"]' ''
fn
foo
()
{}
// Same check for provided "bar" method.
// @has - '//*[@id="method.bar"]/a[@class="anchor"]' ''
}
impl
Foo
{
// @snapshot no_const_anchor2 - '//*[@id="associatedconstant.X"]'
// There should be no anchors here.
pub
const
X
:
i32
=
0
;
// @snapshot no_type_anchor2 - '//*[@id="associatedtype.Y"]'
// There should be no anchors here.
pub
type
Y
=
u32
;
// @snapshot no_method_anchor - '//*[@id="method.new"]'
// There should be no anchors here.
pub
fn
new
()
->
Self
{
Self
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录