Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
6fbe2a0c
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,发现更多精彩内容 >>
提交
6fbe2a0c
编写于
11月 24, 2013
作者:
C
Corey Richardson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rustdoc: pass through --cfg to rustc
Closes #10623
上级
b3ff24ad
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
12 addition
and
6 deletion
+12
-6
mk/docs.mk
mk/docs.mk
+3
-1
src/librustdoc/core.rs
src/librustdoc/core.rs
+6
-4
src/librustdoc/lib.rs
src/librustdoc/lib.rs
+3
-1
未找到文件。
mk/docs.mk
浏览文件 @
6fbe2a0c
...
...
@@ -215,10 +215,12 @@ RUSTDOC = $(HBIN2_H_$(CFG_BUILD))/rustdoc$(X_$(CFG_BUILD))
# $(1) - The crate name (std/extra)
# $(2) - The crate file
# $(3) - The relevant host build triple (to depend on libstd)
#
# Passes --cfg stage2 to rustdoc because it uses the stage2 librustc.
define
libdoc
doc/$(1)/index.html
:
$$(RUSTDOC) $$(TLIB2_T_$(3)_H_$(3))/$(CFG_STDLIB_$(3))
@
$
$(
call
E, rustdoc:
$$
@
)
$(Q)$(RUSTDOC)
$(2)
$(Q)$(RUSTDOC)
--cfg
stage2
$(2)
DOCS
+=
doc/
$(1)
/index.html
endef
...
...
src/librustdoc/core.rs
浏览文件 @
6fbe2a0c
...
...
@@ -37,7 +37,7 @@ pub struct CrateAnalysis {
/// Parses, resolves, and typechecks the given crate
fn
get_ast_and_resolve
(
cpath
:
&
Path
,
libs
:
HashSet
<
Path
>
)
->
(
DocContext
,
CrateAnalysis
)
{
libs
:
HashSet
<
Path
>
,
cfgs
:
~
[
~
str
]
)
->
(
DocContext
,
CrateAnalysis
)
{
use
syntax
::
codemap
::
dummy_spanned
;
use
rustc
::
driver
::
driver
::{
file_input
,
build_configuration
,
phase_1_parse_input
,
...
...
@@ -66,7 +66,9 @@ fn get_ast_and_resolve(cpath: &Path,
span_diagnostic_handler
);
let
mut
cfg
=
build_configuration
(
sess
);
cfg
.push
(
@
dummy_spanned
(
ast
::
MetaWord
(
@
"stage2"
)));
for
cfg_
in
cfgs
.move_iter
()
{
cfg
.push
(
@
dummy_spanned
(
ast
::
MetaWord
(
cfg_
.to_managed
())));
}
let
mut
crate
=
phase_1_parse_input
(
sess
,
cfg
.clone
(),
&
input
);
crate
=
phase_2_configure_and_expand
(
sess
,
cfg
,
crate
);
...
...
@@ -79,8 +81,8 @@ fn get_ast_and_resolve(cpath: &Path,
CrateAnalysis
{
exported_items
:
exported_items
});
}
pub
fn
run_core
(
libs
:
HashSet
<
Path
>
,
path
:
&
Path
)
->
(
clean
::
Crate
,
CrateAnalysis
)
{
let
(
ctxt
,
analysis
)
=
get_ast_and_resolve
(
path
,
libs
);
pub
fn
run_core
(
libs
:
HashSet
<
Path
>
,
cfgs
:
~
[
~
str
],
path
:
&
Path
)
->
(
clean
::
Crate
,
CrateAnalysis
)
{
let
(
ctxt
,
analysis
)
=
get_ast_and_resolve
(
path
,
libs
,
cfgs
);
let
ctxt
=
@
ctxt
;
debug!
(
"defmap:"
);
for
(
k
,
v
)
in
ctxt
.tycx.def_map
.iter
()
{
...
...
src/librustdoc/lib.rs
浏览文件 @
6fbe2a0c
...
...
@@ -96,6 +96,7 @@ pub fn opts() -> ~[groups::OptGroup] {
optopt
(
"o"
,
"output"
,
"where to place the output"
,
"PATH"
),
optmulti
(
"L"
,
"library-path"
,
"directory to add to crate search path"
,
"DIR"
),
optmulti
(
""
,
"cfg"
,
"pass a --cfg to rustc"
,
""
),
optmulti
(
""
,
"plugin-path"
,
"directory to load plugins from"
,
"DIR"
),
optmulti
(
""
,
"passes"
,
"space separated list of passes to also run, a
\
value of `list` will print available passes"
,
...
...
@@ -194,11 +195,12 @@ fn rust_input(cratefile: &str, matches: &getopts::Matches) -> Output {
// First, parse the crate and extract all relevant information.
let
libs
=
Cell
::
new
(
matches
.opt_strs
(
"L"
)
.map
(|
s
|
Path
::
new
(
s
.as_slice
())));
let
cfgs
=
Cell
::
new
(
matches
.opt_strs
(
"cfg"
));
let
cr
=
Cell
::
new
(
Path
::
new
(
cratefile
));
info!
(
"starting to run rustc"
);
let
(
crate
,
analysis
)
=
do
std
::
task
::
try
{
let
cr
=
cr
.take
();
core
::
run_core
(
libs
.take
()
.move_iter
()
.collect
(),
&
cr
)
core
::
run_core
(
libs
.take
()
.move_iter
()
.collect
(),
cfgs
.take
(),
&
cr
)
}
.unwrap
();
info!
(
"finished with rustc"
);
local_data
::
set
(
analysiskey
,
analysis
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录