Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
fe24e815
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,发现更多精彩内容 >>
提交
fe24e815
编写于
9月 27, 2017
作者:
G
Guillaume Gomez
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix invalid rustdoc rendering for FnTy args
上级
3493c62f
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
27 addition
and
15 deletion
+27
-15
src/librustc/hir/intravisit.rs
src/librustc/hir/intravisit.rs
+1
-1
src/librustc/hir/lowering.rs
src/librustc/hir/lowering.rs
+2
-9
src/librustc/hir/mod.rs
src/librustc/hir/mod.rs
+1
-0
src/librustc/hir/print.rs
src/librustc/hir/print.rs
+5
-3
src/librustc/ich/impls_hir.rs
src/librustc/ich/impls_hir.rs
+2
-1
src/librustdoc/clean/mod.rs
src/librustdoc/clean/mod.rs
+1
-1
src/test/rustdoc/fn-pointer-arg-name.rs
src/test/rustdoc/fn-pointer-arg-name.rs
+15
-0
未找到文件。
src/librustc/hir/intravisit.rs
浏览文件 @
fe24e815
...
...
@@ -574,7 +574,7 @@ pub fn walk_ty<'v, V: Visitor<'v>>(visitor: &mut V, typ: &'v Ty) {
TyTup
(
ref
tuple_element_types
)
=>
{
walk_list!
(
visitor
,
visit_ty
,
tuple_element_types
);
}
TyBareFn
(
ref
function_declaration
,
_
)
=>
{
TyBareFn
(
ref
function_declaration
)
=>
{
visitor
.visit_fn_decl
(
&
function_declaration
.decl
);
walk_list!
(
visitor
,
visit_lifetime_def
,
&
function_declaration
.lifetimes
);
}
...
...
src/librustc/hir/lowering.rs
浏览文件 @
fe24e815
...
...
@@ -673,15 +673,8 @@ fn lower_ty(&mut self, t: &Ty) -> P<hir::Ty> {
unsafety
:
self
.lower_unsafety
(
f
.unsafety
),
abi
:
f
.abi
,
decl
:
self
.lower_fn_decl
(
&
f
.decl
),
},
decl
.inputs
.iter
()
.map
(|
arg
|
{
match
arg
.pat.node
{
PatKind
::
Ident
(
_
,
ident
,
None
)
=>
{
respan
(
ident
.span
,
ident
.node.name
)
}
_
=>
respan
(
arg
.pat.span
,
keywords
::
Invalid
.name
()),
}
})
.collect
()))
arg_names
:
self
.lower_fn_args_to_names
(
&
f
.decl
),
}))
}
TyKind
::
Never
=>
hir
::
TyNever
,
TyKind
::
Tup
(
ref
tys
)
=>
{
...
...
src/librustc/hir/mod.rs
浏览文件 @
fe24e815
...
...
@@ -1418,6 +1418,7 @@ pub struct BareFnTy {
pub
abi
:
Abi
,
pub
lifetimes
:
HirVec
<
LifetimeDef
>
,
pub
decl
:
P
<
FnDecl
>
,
pub
arg_names
:
HirVec
<
Spanned
<
Name
>>
,
}
#[derive(Clone,
PartialEq,
Eq,
RustcEncodable,
RustcDecodable,
Hash,
Debug)]
...
...
src/librustc/hir/print.rs
浏览文件 @
fe24e815
...
...
@@ -399,7 +399,8 @@ pub fn print_type(&mut self, ty: &hir::Ty) -> io::Result<()> {
},
span
:
syntax_pos
::
DUMMY_SP
,
};
self
.print_ty_fn
(
f
.abi
,
f
.unsafety
,
&
f
.decl
,
None
,
&
generics
)
?
;
self
.print_ty_fn
(
f
.abi
,
f
.unsafety
,
&
f
.decl
,
None
,
&
generics
,
&
f
.arg_names
[
..
])
?
;
}
hir
::
TyPath
(
ref
qpath
)
=>
{
self
.print_qpath
(
qpath
,
false
)
?
...
...
@@ -2140,7 +2141,8 @@ pub fn print_ty_fn(&mut self,
unsafety
:
hir
::
Unsafety
,
decl
:
&
hir
::
FnDecl
,
name
:
Option
<
ast
::
Name
>
,
generics
:
&
hir
::
Generics
)
generics
:
&
hir
::
Generics
,
arg_names
:
&
[
Spanned
<
ast
::
Name
>
])
->
io
::
Result
<
()
>
{
self
.ibox
(
indent_unit
)
?
;
if
!
generics
.lifetimes
.is_empty
()
||
!
generics
.ty_params
.is_empty
()
{
...
...
@@ -2163,7 +2165,7 @@ pub fn print_ty_fn(&mut self,
name
,
&
generics
,
&
hir
::
Inherited
,
&
[]
,
arg_names
,
None
)
?
;
self
.end
()
}
...
...
src/librustc/ich/impls_hir.rs
浏览文件 @
fe24e815
...
...
@@ -274,7 +274,8 @@ fn hash_stable<W: StableHasherResult>(&self,
unsafety
,
abi
,
lifetimes
,
decl
decl
,
arg_names
});
impl_stable_hash_for!
(
enum
hir
::
Ty_
{
...
...
src/librustdoc/clean/mod.rs
浏览文件 @
fe24e815
...
...
@@ -2491,7 +2491,7 @@ fn clean(&self, cx: &DocContext) -> BareFunctionDecl {
type_params
:
Vec
::
new
(),
where_predicates
:
Vec
::
new
()
},
decl
:
(
&*
self
.decl
,
&
[]
[
..
])
.clean
(
cx
),
decl
:
(
&*
self
.decl
,
&
self
.arg_names
[
..
])
.clean
(
cx
),
abi
:
self
.abi
,
}
}
...
...
src/test/rustdoc/fn-pointer-arg-name.rs
0 → 100644
浏览文件 @
fe24e815
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![crate_name
=
"foo"
]
// @has foo/fn.f.html
// @has - '//*[@class="rust fn"]' 'pub fn f(callback: fn(len: usize, foo: u32))'
pub
fn
f
(
callback
:
fn
(
len
:
usize
,
foo
:
u32
))
{}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录