Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
e955bebc
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,发现更多精彩内容 >>
提交
e955bebc
编写于
7月 02, 2020
作者:
G
Guillaume Gomez
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove render-redirect-pages option in rustdoc
上级
af296202
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
1 addition
and
86 deletion
+1
-86
src/bootstrap/bin/rustdoc.rs
src/bootstrap/bin/rustdoc.rs
+1
-14
src/bootstrap/doc.rs
src/bootstrap/doc.rs
+0
-1
src/librustdoc/config.rs
src/librustdoc/config.rs
+0
-4
src/librustdoc/html/item_type.rs
src/librustdoc/html/item_type.rs
+0
-37
src/librustdoc/html/render.rs
src/librustdoc/html/render.rs
+0
-12
src/librustdoc/lib.rs
src/librustdoc/lib.rs
+0
-7
src/test/rustdoc/issue-19190.rs
src/test/rustdoc/issue-19190.rs
+0
-3
src/test/rustdoc/structfields.rs
src/test/rustdoc/structfields.rs
+0
-8
未找到文件。
src/bootstrap/bin/rustdoc.rs
浏览文件 @
e955bebc
...
...
@@ -13,7 +13,6 @@ fn main() {
let
libdir
=
env
::
var_os
(
"RUSTDOC_LIBDIR"
)
.expect
(
"RUSTDOC_LIBDIR was not set"
);
let
stage
=
env
::
var
(
"RUSTC_STAGE"
)
.expect
(
"RUSTC_STAGE was not set"
);
let
sysroot
=
env
::
var_os
(
"RUSTC_SYSROOT"
)
.expect
(
"RUSTC_SYSROOT was not set"
);
let
mut
has_unstable
=
false
;
use
std
::
str
::
FromStr
;
...
...
@@ -55,22 +54,10 @@ fn main() {
cmd
.arg
(
"--crate-version"
)
.arg
(
version
);
}
// Needed to be able to run all rustdoc tests.
if
env
::
var_os
(
"RUSTDOC_GENERATE_REDIRECT_PAGES"
)
.is_some
()
{
// This "unstable-options" can be removed when `--generate-redirect-pages` is stabilized
if
!
has_unstable
{
cmd
.arg
(
"-Z"
)
.arg
(
"unstable-options"
);
}
cmd
.arg
(
"--generate-redirect-pages"
);
has_unstable
=
true
;
}
// Needed to be able to run all rustdoc tests.
if
let
Some
(
ref
x
)
=
env
::
var_os
(
"RUSTDOC_RESOURCE_SUFFIX"
)
{
// This "unstable-options" can be removed when `--resource-suffix` is stabilized
if
!
has_unstable
{
cmd
.arg
(
"-Z"
)
.arg
(
"unstable-options"
);
}
cmd
.arg
(
"-Z"
)
.arg
(
"unstable-options"
);
cmd
.arg
(
"--resource-suffix"
)
.arg
(
x
);
}
...
...
src/bootstrap/doc.rs
浏览文件 @
e955bebc
...
...
@@ -451,7 +451,6 @@ fn run(self, builder: &Builder<'_>) {
.arg
(
"--markdown-css"
)
.arg
(
"rust.css"
)
.arg
(
"--markdown-no-toc"
)
.arg
(
"--generate-redirect-pages"
)
.arg
(
"-Z"
)
.arg
(
"unstable-options"
)
.arg
(
"--resource-suffix"
)
...
...
src/librustdoc/config.rs
浏览文件 @
e955bebc
...
...
@@ -242,8 +242,6 @@ pub struct RenderOptions {
/// If false, the `select` element to have search filtering by crates on rendered docs
/// won't be generated.
pub
generate_search_filter
:
bool
,
/// Option (disabled by default) to generate files used by RLS and some other tools.
pub
generate_redirect_pages
:
bool
,
/// Document items that have lower than `pub` visibility.
pub
document_private
:
bool
,
/// Document items that have `doc(hidden)`.
...
...
@@ -528,7 +526,6 @@ fn println_condition(condition: Condition) {
let
static_root_path
=
matches
.opt_str
(
"static-root-path"
);
let
generate_search_filter
=
!
matches
.opt_present
(
"disable-per-crate-search"
);
let
persist_doctests
=
matches
.opt_str
(
"persist-doctests"
)
.map
(
PathBuf
::
from
);
let
generate_redirect_pages
=
matches
.opt_present
(
"generate-redirect-pages"
);
let
test_builder
=
matches
.opt_str
(
"test-builder"
)
.map
(
PathBuf
::
from
);
let
codegen_options_strs
=
matches
.opt_strs
(
"C"
);
let
debugging_options_strs
=
matches
.opt_strs
(
"Z"
);
...
...
@@ -592,7 +589,6 @@ fn println_condition(condition: Condition) {
markdown_css
,
markdown_playground_url
,
generate_search_filter
,
generate_redirect_pages
,
document_private
,
document_hidden
,
},
...
...
src/librustdoc/html/item_type.rs
浏览文件 @
e955bebc
...
...
@@ -154,38 +154,6 @@ pub fn as_str(&self) -> &'static str {
ItemType
::
TraitAlias
=>
"traitalias"
,
}
}
pub
fn
name_space
(
&
self
)
->
&
'static
str
{
match
*
self
{
ItemType
::
Struct
|
ItemType
::
Union
|
ItemType
::
Enum
|
ItemType
::
Module
|
ItemType
::
Typedef
|
ItemType
::
Trait
|
ItemType
::
Primitive
|
ItemType
::
AssocType
|
ItemType
::
OpaqueTy
|
ItemType
::
TraitAlias
|
ItemType
::
ForeignType
=>
NAMESPACE_TYPE
,
ItemType
::
ExternCrate
|
ItemType
::
Import
|
ItemType
::
Function
|
ItemType
::
Static
|
ItemType
::
Impl
|
ItemType
::
TyMethod
|
ItemType
::
Method
|
ItemType
::
StructField
|
ItemType
::
Variant
|
ItemType
::
Constant
|
ItemType
::
AssocConst
=>
NAMESPACE_VALUE
,
ItemType
::
Macro
|
ItemType
::
ProcAttribute
|
ItemType
::
ProcDerive
=>
NAMESPACE_MACRO
,
ItemType
::
Keyword
=>
NAMESPACE_KEYWORD
,
}
}
}
impl
fmt
::
Display
for
ItemType
{
...
...
@@ -193,8 +161,3 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!
(
f
,
"{}"
,
self
.as_str
())
}
}
pub
const
NAMESPACE_TYPE
:
&
str
=
"t"
;
pub
const
NAMESPACE_VALUE
:
&
str
=
"v"
;
pub
const
NAMESPACE_MACRO
:
&
str
=
"m"
;
pub
const
NAMESPACE_KEYWORD
:
&
str
=
"k"
;
src/librustdoc/html/render.rs
浏览文件 @
e955bebc
...
...
@@ -195,8 +195,6 @@ struct Context {
/// Optional path string to be used to load static files on output pages. If not set, uses
/// combinations of `../` to reach the documentation root.
pub
static_root_path
:
Option
<
String
>
,
/// Option disabled by default to generate files used by RLS and some other tools.
pub
generate_redirect_pages
:
bool
,
/// The fs handle we are working with.
pub
fs
:
DocFS
,
/// The default edition used to parse doctests.
...
...
@@ -468,7 +466,6 @@ pub fn run(
resource_suffix
,
static_root_path
,
generate_search_filter
,
generate_redirect_pages
,
document_private
,
..
}
=
options
;
...
...
@@ -536,7 +533,6 @@ pub fn run(
themes
,
resource_suffix
,
static_root_path
,
generate_redirect_pages
,
fs
:
DocFS
::
new
(
&
errors
),
edition
,
codes
:
ErrorCodes
::
from
(
UnstableFeatures
::
from_environment
()
.is_nightly_build
()),
...
...
@@ -1556,14 +1552,6 @@ fn item<F>(&mut self, item: clean::Item, all: &mut AllTypes, mut f: F) -> Result
if
!
self
.render_redirect_pages
{
all
.append
(
full_path
(
self
,
&
item
),
&
item_type
);
}
if
self
.shared.generate_redirect_pages
{
// Redirect from a sane URL using the namespace to Rustdoc's
// URL for the page.
let
redir_name
=
format!
(
"{}.{}.html"
,
name
,
item_type
.name_space
());
let
redir_dst
=
self
.dst
.join
(
redir_name
);
let
v
=
layout
::
redirect
(
file_name
);
self
.shared.fs
.write
(
&
redir_dst
,
v
.as_bytes
())
?
;
}
// If the item is a macro, redirect from the old macro URL (with !)
// to the new one (without).
if
item_type
==
ItemType
::
Macro
{
...
...
src/librustdoc/lib.rs
浏览文件 @
e955bebc
...
...
@@ -374,13 +374,6 @@ fn opts() -> Vec<RustcOptGroup> {
"PATH"
,
)
}),
unstable
(
"generate-redirect-pages"
,
|
o
|
{
o
.optflag
(
""
,
"generate-redirect-pages"
,
"Generate extra pages to support legacy URLs and tool links"
,
)
}),
unstable
(
"show-coverage"
,
|
o
|
{
o
.optflag
(
""
,
...
...
src/test/rustdoc/issue-19190.rs
浏览文件 @
e955bebc
// compile-flags:-Z unstable-options --generate-redirect-pages
use
std
::
ops
::
Deref
;
pub
struct
Foo
;
...
...
@@ -15,7 +13,6 @@ impl Deref for Bar {
fn
deref
(
&
self
)
->
&
Foo
{
loop
{}
}
}
// @has issue_19190/Bar.t.html
// @has issue_19190/struct.Bar.html
// @has - '//*[@id="method.foo"]//code' 'fn foo(&self)'
// @has - '//*[@id="method.foo"]' 'fn foo(&self)'
...
...
src/test/rustdoc/structfields.rs
浏览文件 @
e955bebc
// compile-flags:-Z unstable-options --generate-redirect-pages
// @has structfields/Foo.t.html
// @has - struct.Foo.html
// @has structfields/struct.Foo.html
pub
struct
Foo
{
// @has - //pre "pub a: ()"
...
...
@@ -16,8 +12,6 @@ pub struct Foo {
pub
d
:
usize
,
}
// @has structfields/Bar.t.html
// @has - struct.Bar.html
// @has structfields/struct.Bar.html
pub
struct
Bar
{
// @has - //pre "pub a: ()"
...
...
@@ -25,8 +19,6 @@ pub struct Bar {
// @!has - //pre "// some fields omitted"
}
// @has structfields/Qux.t.html
// @has - enum.Qux.html
// @has structfields/enum.Qux.html
pub
enum
Qux
{
Quz
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录