Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
322aedd4
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,发现更多精彩内容 >>
提交
322aedd4
编写于
10月 15, 2014
作者:
L
Luqman Aden
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
librustdoc: Remove all uses of {:?}.
上级
c5a8bad1
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
15 addition
and
14 deletion
+15
-14
src/librustdoc/clean/mod.rs
src/librustdoc/clean/mod.rs
+8
-8
src/librustdoc/core.rs
src/librustdoc/core.rs
+1
-1
src/librustdoc/doctree.rs
src/librustdoc/doctree.rs
+1
-0
src/librustdoc/html/render.rs
src/librustdoc/html/render.rs
+2
-2
src/librustdoc/lib.rs
src/librustdoc/lib.rs
+2
-2
src/librustdoc/visit_ast.rs
src/librustdoc/visit_ast.rs
+1
-1
未找到文件。
src/librustdoc/clean/mod.rs
浏览文件 @
322aedd4
...
...
@@ -1251,7 +1251,7 @@ fn clean(&self, cx: &DocContext) -> Type {
TyBareFn
(
ref
barefn
)
=>
BareFunction
(
box
barefn
.clean
(
cx
)),
TyParen
(
ref
ty
)
=>
ty
.clean
(
cx
),
TyBot
=>
Bottom
,
ref
x
=>
fail
!
(
"Unimplemented type {
:?
}"
,
x
),
ref
x
=>
fail
!
(
"Unimplemented type {}"
,
x
),
}
}
}
...
...
@@ -1575,7 +1575,7 @@ fn clean(&self, cx: &DocContext) -> VariantKind {
}
}
#[deriving(Clone,
Encodable,
Decodable)]
#[deriving(Clone,
Encodable,
Decodable
,
Show
)]
pub
struct
Span
{
pub
filename
:
String
,
pub
loline
:
uint
,
...
...
@@ -1714,7 +1714,7 @@ fn clean(&self, cx: &DocContext) -> BareFunctionDecl {
}
}
#[deriving(Clone,
Encodable,
Decodable)]
#[deriving(Clone,
Encodable,
Decodable
,
Show
)]
pub
struct
Static
{
pub
type_
:
Type
,
pub
mutability
:
Mutability
,
...
...
@@ -1726,7 +1726,7 @@ pub struct Static {
impl
Clean
<
Item
>
for
doctree
::
Static
{
fn
clean
(
&
self
,
cx
:
&
DocContext
)
->
Item
{
debug!
(
"claning static {}: {
:?
}"
,
self
.name
.clean
(
cx
),
self
);
debug!
(
"claning static {}: {}"
,
self
.name
.clean
(
cx
),
self
);
Item
{
name
:
Some
(
self
.name
.clean
(
cx
)),
attrs
:
self
.attrs
.clean
(
cx
),
...
...
@@ -2004,7 +2004,7 @@ trait ToSource {
impl
ToSource
for
syntax
::
codemap
::
Span
{
fn
to_src
(
&
self
,
cx
:
&
DocContext
)
->
String
{
debug!
(
"converting span {
:?
} to snippet"
,
self
.clean
(
cx
));
debug!
(
"converting span {} to snippet"
,
self
.clean
(
cx
));
let
sn
=
match
cx
.sess
()
.codemap
()
.span_to_snippet
(
*
self
)
{
Some
(
x
)
=>
x
.to_string
(),
None
=>
""
.to_string
()
...
...
@@ -2017,7 +2017,7 @@ fn to_src(&self, cx: &DocContext) -> String {
fn
lit_to_string
(
lit
:
&
ast
::
Lit
)
->
String
{
match
lit
.node
{
ast
::
LitStr
(
ref
st
,
_
)
=>
st
.get
()
.to_string
(),
ast
::
LitBinary
(
ref
data
)
=>
format!
(
"{
:?}"
,
data
.as_slice
()
),
ast
::
LitBinary
(
ref
data
)
=>
format!
(
"{
}"
,
data
),
ast
::
LitByte
(
b
)
=>
{
let
mut
res
=
String
::
from_str
(
"b'"
);
(
b
as
char
)
.escape_default
(|
c
|
{
...
...
@@ -2037,7 +2037,7 @@ fn lit_to_string(lit: &ast::Lit) -> String {
fn
name_from_pat
(
p
:
&
ast
::
Pat
)
->
String
{
use
syntax
::
ast
::
*
;
debug!
(
"Trying to get a name from pattern: {
:?
}"
,
p
);
debug!
(
"Trying to get a name from pattern: {}"
,
p
);
match
p
.node
{
PatWild
(
PatWildSingle
)
=>
"_"
.to_string
(),
...
...
@@ -2082,7 +2082,7 @@ fn resolve_type(cx: &DocContext, path: Path,
// If we're extracting tests, this return value doesn't matter.
None
=>
return
Primitive
(
Bool
),
};
debug!
(
"searching for {
:?
} in defmap"
,
id
);
debug!
(
"searching for {} in defmap"
,
id
);
let
def
=
match
tcx
.def_map
.borrow
()
.find
(
&
id
)
{
Some
(
&
k
)
=>
k
,
None
=>
fail
!
(
"unresolved id not in defmap"
)
...
...
src/librustdoc/core.rs
浏览文件 @
322aedd4
...
...
@@ -135,7 +135,7 @@ pub fn run_core(libs: Vec<Path>, cfgs: Vec<String>, externs: Externs,
inlined
:
RefCell
::
new
(
Some
(
HashSet
::
new
())),
populated_crate_impls
:
RefCell
::
new
(
HashSet
::
new
()),
};
debug!
(
"crate: {
:?
}"
,
ctxt
.krate
);
debug!
(
"crate: {}"
,
ctxt
.krate
);
let
analysis
=
CrateAnalysis
{
exported_items
:
exported_items
,
...
...
src/librustdoc/doctree.rs
浏览文件 @
322aedd4
...
...
@@ -141,6 +141,7 @@ pub struct Typedef {
pub
stab
:
Option
<
attr
::
Stability
>
,
}
#[deriving(Show)]
pub
struct
Static
{
pub
type_
:
P
<
ast
::
Ty
>
,
pub
mutability
:
ast
::
Mutability
,
...
...
src/librustdoc/html/render.rs
浏览文件 @
322aedd4
...
...
@@ -1042,7 +1042,7 @@ impl Context {
/// sure it always points to the top (relatively)
fn
recurse
<
T
>
(
&
mut
self
,
s
:
String
,
f
:
|
&
mut
Context
|
->
T
)
->
T
{
if
s
.len
()
==
0
{
fail
!
(
"
what {:?}"
,
self
);
fail
!
(
"
Unexpected empty destination: {}"
,
self
.current
);
}
let
prev
=
self
.dst
.clone
();
self
.dst
.push
(
s
.as_slice
());
...
...
@@ -1491,7 +1491,7 @@ fn cmp(i1: &clean::Item, i2: &clean::Item, idx1: uint, idx2: uint) -> Ordering {
indices
.sort_by
(|
&
i1
,
&
i2
|
cmp
(
&
items
[
i1
],
&
items
[
i2
],
i1
,
i2
));
debug!
(
"{
:?
}"
,
indices
);
debug!
(
"{}"
,
indices
);
let
mut
curty
=
None
;
for
&
idx
in
indices
.iter
()
{
let
myitem
=
&
items
[
idx
];
...
...
src/librustdoc/lib.rs
浏览文件 @
322aedd4
...
...
@@ -333,7 +333,7 @@ fn rust_input(cratefile: &str, externs: core::Externs, matches: &getopts::Matche
let
(
mut
krate
,
analysis
)
=
std
::
task
::
try
(
proc
()
{
let
cr
=
cr
;
core
::
run_core
(
libs
,
cfgs
,
externs
,
&
cr
,
triple
)
})
.map_err
(|
boxed_any
|
format!
(
"{:?}"
,
boxed_any
)
)
.unwrap
();
})
.map_err
(|
_
|
"rustc failed"
)
.unwrap
();
info!
(
"finished with rustc"
);
analysiskey
.replace
(
Some
(
analysis
));
...
...
@@ -480,7 +480,7 @@ fn json_output(krate: clean::Crate, res: Vec<plugins::PluginJson> ,
};
let
crate_json
=
match
json
::
from_str
(
crate_json_str
.as_slice
())
{
Ok
(
j
)
=>
j
,
Err
(
e
)
=>
fail
!
(
"Rust generated JSON is invalid: {
:?
}"
,
e
)
Err
(
e
)
=>
fail
!
(
"Rust generated JSON is invalid: {}"
,
e
)
};
json
.insert
(
"crate"
.to_string
(),
crate_json
);
...
...
src/librustdoc/visit_ast.rs
浏览文件 @
322aedd4
...
...
@@ -264,7 +264,7 @@ fn resolve_id(&mut self, id: ast::NodeId, renamed: Option<ast::Ident>,
pub
fn
visit_item
(
&
mut
self
,
item
:
&
ast
::
Item
,
renamed
:
Option
<
ast
::
Ident
>
,
om
:
&
mut
Module
)
{
debug!
(
"Visiting item {
:?
}"
,
item
);
debug!
(
"Visiting item {}"
,
item
);
let
name
=
renamed
.unwrap_or
(
item
.ident
);
match
item
.node
{
ast
::
ItemMod
(
ref
m
)
=>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录