Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
eb08e8fe
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,发现更多精彩内容 >>
提交
eb08e8fe
编写于
3月 28, 2014
作者:
A
Alex Crichton
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rustdoc: Switch field privacy as necessary
上级
f0ee5092
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
259 addition
and
251 deletion
+259
-251
src/librustdoc/clean.rs
src/librustdoc/clean.rs
+106
-98
src/librustdoc/core.rs
src/librustdoc/core.rs
+4
-4
src/librustdoc/doctree.rs
src/librustdoc/doctree.rs
+81
-81
src/librustdoc/flock.rs
src/librustdoc/flock.rs
+20
-20
src/librustdoc/html/layout.rs
src/librustdoc/html/layout.rs
+6
-6
src/librustdoc/html/render.rs
src/librustdoc/html/render.rs
+18
-18
src/librustdoc/html/toc.rs
src/librustdoc/html/toc.rs
+8
-8
src/librustdoc/plugins.rs
src/librustdoc/plugins.rs
+3
-3
src/librustdoc/test.rs
src/librustdoc/test.rs
+9
-9
src/librustdoc/visit_ast.rs
src/librustdoc/visit_ast.rs
+4
-4
未找到文件。
src/librustdoc/clean.rs
浏览文件 @
eb08e8fe
...
...
@@ -64,9 +64,9 @@ fn clean(&self) -> Vec<U> {
#[deriving(Clone,
Encodable,
Decodable)]
pub
struct
Crate
{
name
:
~
str
,
module
:
Option
<
Item
>
,
externs
:
Vec
<
(
ast
::
CrateNum
,
ExternalCrate
)
>
,
pub
name
:
~
str
,
pub
module
:
Option
<
Item
>
,
pub
externs
:
Vec
<
(
ast
::
CrateNum
,
ExternalCrate
)
>
,
}
impl
<
'a
>
Clean
<
Crate
>
for
visit_ast
::
RustdocVisitor
<
'a
>
{
...
...
@@ -92,8 +92,8 @@ fn clean(&self) -> Crate {
#[deriving(Clone,
Encodable,
Decodable)]
pub
struct
ExternalCrate
{
name
:
~
str
,
attrs
:
Vec
<
Attribute
>
,
pub
name
:
~
str
,
pub
attrs
:
Vec
<
Attribute
>
,
}
impl
Clean
<
ExternalCrate
>
for
cstore
::
crate_metadata
{
...
...
@@ -113,13 +113,13 @@ fn clean(&self) -> ExternalCrate {
#[deriving(Clone,
Encodable,
Decodable)]
pub
struct
Item
{
/// Stringified span
source
:
Span
,
pub
source
:
Span
,
/// Not everything has a name. E.g., impls
name
:
Option
<~
str
>
,
attrs
:
Vec
<
Attribute
>
,
inner
:
ItemEnum
,
visibility
:
Option
<
Visibility
>
,
id
:
ast
::
NodeId
,
pub
name
:
Option
<~
str
>
,
pub
attrs
:
Vec
<
Attribute
>
,
pub
inner
:
ItemEnum
,
pub
visibility
:
Option
<
Visibility
>
,
pub
id
:
ast
::
NodeId
,
}
impl
Item
{
...
...
@@ -192,8 +192,8 @@ pub enum ItemEnum {
#[deriving(Clone,
Encodable,
Decodable)]
pub
struct
Module
{
items
:
Vec
<
Item
>
,
is_crate
:
bool
,
pub
items
:
Vec
<
Item
>
,
pub
is_crate
:
bool
,
}
impl
Clean
<
Item
>
for
doctree
::
Module
{
...
...
@@ -289,9 +289,10 @@ fn name_str_pair(&self) -> Option<(InternedString, InternedString)> {
#[deriving(Clone,
Encodable,
Decodable)]
pub
struct
TyParam
{
name
:
~
str
,
id
:
ast
::
NodeId
,
bounds
:
Vec
<
TyParamBound
>
}
pub
name
:
~
str
,
pub
id
:
ast
::
NodeId
,
pub
bounds
:
Vec
<
TyParamBound
>
,
}
impl
Clean
<
TyParam
>
for
ast
::
TyParam
{
fn
clean
(
&
self
)
->
TyParam
{
...
...
@@ -338,8 +339,9 @@ fn clean(&self) -> Lifetime {
// maybe use a Generic enum and use ~[Generic]?
#[deriving(Clone,
Encodable,
Decodable)]
pub
struct
Generics
{
lifetimes
:
Vec
<
Lifetime
>
,
type_params
:
Vec
<
TyParam
>
}
pub
lifetimes
:
Vec
<
Lifetime
>
,
pub
type_params
:
Vec
<
TyParam
>
,
}
impl
Clean
<
Generics
>
for
ast
::
Generics
{
fn
clean
(
&
self
)
->
Generics
{
...
...
@@ -352,10 +354,10 @@ fn clean(&self) -> Generics {
#[deriving(Clone,
Encodable,
Decodable)]
pub
struct
Method
{
generics
:
Generics
,
self_
:
SelfTy
,
purity
:
ast
::
Purity
,
decl
:
FnDecl
,
pub
generics
:
Generics
,
pub
self_
:
SelfTy
,
pu
b
pu
rity
:
ast
::
Purity
,
pub
decl
:
FnDecl
,
}
impl
Clean
<
Item
>
for
ast
::
Method
{
...
...
@@ -390,10 +392,10 @@ fn clean(&self) -> Item {
#[deriving(Clone,
Encodable,
Decodable)]
pub
struct
TyMethod
{
purity
:
ast
::
Purity
,
decl
:
FnDecl
,
generics
:
Generics
,
self_
:
SelfTy
,
pu
b
pu
rity
:
ast
::
Purity
,
pub
decl
:
FnDecl
,
pub
generics
:
Generics
,
pub
self_
:
SelfTy
,
}
impl
Clean
<
Item
>
for
ast
::
TypeMethod
{
...
...
@@ -447,9 +449,9 @@ fn clean(&self) -> SelfTy {
#[deriving(Clone,
Encodable,
Decodable)]
pub
struct
Function
{
decl
:
FnDecl
,
generics
:
Generics
,
purity
:
ast
::
Purity
,
pub
decl
:
FnDecl
,
pub
generics
:
Generics
,
pu
b
pu
rity
:
ast
::
Purity
,
}
impl
Clean
<
Item
>
for
doctree
::
Function
{
...
...
@@ -471,13 +473,14 @@ fn clean(&self) -> Item {
#[deriving(Clone,
Encodable,
Decodable)]
pub
struct
ClosureDecl
{
sigil
:
ast
::
Sigil
,
region
:
Option
<
Lifetime
>
,
lifetimes
:
Vec
<
Lifetime
>
,
decl
:
FnDecl
,
onceness
:
ast
::
Onceness
,
purity
:
ast
::
Purity
,
bounds
:
Vec
<
TyParamBound
>
}
pub
sigil
:
ast
::
Sigil
,
pub
region
:
Option
<
Lifetime
>
,
pub
lifetimes
:
Vec
<
Lifetime
>
,
pub
decl
:
FnDecl
,
pub
onceness
:
ast
::
Onceness
,
pub
purity
:
ast
::
Purity
,
pub
bounds
:
Vec
<
TyParamBound
>
,
}
impl
Clean
<
ClosureDecl
>
for
ast
::
ClosureTy
{
fn
clean
(
&
self
)
->
ClosureDecl
{
...
...
@@ -498,14 +501,15 @@ fn clean(&self) -> ClosureDecl {
#[deriving(Clone,
Encodable,
Decodable)]
pub
struct
FnDecl
{
inputs
:
Arguments
,
output
:
Type
,
cf
:
RetStyle
,
attrs
:
Vec
<
Attribute
>
}
pub
inputs
:
Arguments
,
pub
output
:
Type
,
pub
cf
:
RetStyle
,
pub
attrs
:
Vec
<
Attribute
>
,
}
#[deriving(Clone,
Encodable,
Decodable)]
pub
struct
Arguments
{
values
:
Vec
<
Argument
>
,
pub
values
:
Vec
<
Argument
>
,
}
impl
Clean
<
FnDecl
>
for
ast
::
FnDecl
{
...
...
@@ -523,9 +527,9 @@ fn clean(&self) -> FnDecl {
#[deriving(Clone,
Encodable,
Decodable)]
pub
struct
Argument
{
type_
:
Type
,
name
:
~
str
,
id
:
ast
::
NodeId
pub
type_
:
Type
,
pub
name
:
~
str
,
pub
id
:
ast
::
NodeId
,
}
impl
Clean
<
Argument
>
for
ast
::
Arg
{
...
...
@@ -555,9 +559,9 @@ fn clean(&self) -> RetStyle {
#[deriving(Clone,
Encodable,
Decodable)]
pub
struct
Trait
{
methods
:
Vec
<
TraitMethod
>
,
generics
:
Generics
,
p
arents
:
Vec
<
Type
>
,
pub
methods
:
Vec
<
TraitMethod
>
,
pub
generics
:
Generics
,
p
ub
parents
:
Vec
<
Type
>
,
}
impl
Clean
<
Item
>
for
doctree
::
Trait
{
...
...
@@ -626,17 +630,17 @@ fn clean(&self) -> TraitMethod {
pub
enum
Type
{
/// structs/enums/traits (anything that'd be an ast::TyPath)
ResolvedPath
{
path
:
Path
,
typarams
:
Option
<
Vec
<
TyParamBound
>
>
,
id
:
ast
::
NodeId
,
p
ub
p
ath
:
Path
,
pub
typarams
:
Option
<
Vec
<
TyParamBound
>
>
,
pub
id
:
ast
::
NodeId
,
},
/// Same as above, but only external variants
ExternalPath
{
path
:
Path
,
typarams
:
Option
<
Vec
<
TyParamBound
>
>
,
fqn
:
Vec
<~
str
>
,
kind
:
TypeKind
,
krate
:
ast
::
CrateNum
,
p
ub
p
ath
:
Path
,
pub
typarams
:
Option
<
Vec
<
TyParamBound
>
>
,
pub
fqn
:
Vec
<~
str
>
,
pub
kind
:
TypeKind
,
pub
krate
:
ast
::
CrateNum
,
},
// I have no idea how to usefully use this.
TyParamBinder
(
ast
::
NodeId
),
...
...
@@ -662,7 +666,11 @@ pub enum Type {
Unique
(
~
Type
),
Managed
(
~
Type
),
RawPointer
(
Mutability
,
~
Type
),
BorrowedRef
{
lifetime
:
Option
<
Lifetime
>
,
mutability
:
Mutability
,
type_
:
~
Type
},
BorrowedRef
{
pub
lifetime
:
Option
<
Lifetime
>
,
pub
mutability
:
Mutability
,
pub
type_
:
~
Type
,
},
// region, raw, other boxes, mutable
}
...
...
@@ -707,7 +715,7 @@ fn clean(&self) -> Type {
#[deriving(Clone,
Encodable,
Decodable)]
pub
struct
StructField
{
type_
:
Type
,
pub
type_
:
Type
,
}
impl
Clean
<
Item
>
for
ast
::
StructField
{
...
...
@@ -739,10 +747,10 @@ fn clean(&self) -> Option<Visibility> {
#[deriving(Clone,
Encodable,
Decodable)]
pub
struct
Struct
{
struct_type
:
doctree
::
StructType
,
generics
:
Generics
,
fields
:
Vec
<
Item
>
,
fields_stripped
:
bool
,
pub
struct_type
:
doctree
::
StructType
,
pub
generics
:
Generics
,
pub
fields
:
Vec
<
Item
>
,
pub
fields_stripped
:
bool
,
}
impl
Clean
<
Item
>
for
doctree
::
Struct
{
...
...
@@ -768,9 +776,9 @@ fn clean(&self) -> Item {
/// only as a variant in an enum.
#[deriving(Clone,
Encodable,
Decodable)]
pub
struct
VariantStruct
{
struct_type
:
doctree
::
StructType
,
fields
:
Vec
<
Item
>
,
fields_stripped
:
bool
,
pub
struct_type
:
doctree
::
StructType
,
pub
fields
:
Vec
<
Item
>
,
pub
fields_stripped
:
bool
,
}
impl
Clean
<
VariantStruct
>
for
syntax
::
ast
::
StructDef
{
...
...
@@ -785,9 +793,9 @@ fn clean(&self) -> VariantStruct {
#[deriving(Clone,
Encodable,
Decodable)]
pub
struct
Enum
{
variants
:
Vec
<
Item
>
,
generics
:
Generics
,
variants_stripped
:
bool
,
pub
variants
:
Vec
<
Item
>
,
pub
generics
:
Generics
,
pub
variants_stripped
:
bool
,
}
impl
Clean
<
Item
>
for
doctree
::
Enum
{
...
...
@@ -809,7 +817,7 @@ fn clean(&self) -> Item {
#[deriving(Clone,
Encodable,
Decodable)]
pub
struct
Variant
{
kind
:
VariantKind
,
pub
kind
:
VariantKind
,
}
impl
Clean
<
Item
>
for
doctree
::
Variant
{
...
...
@@ -851,11 +859,11 @@ fn clean(&self) -> VariantKind {
#[deriving(Clone,
Encodable,
Decodable)]
pub
struct
Span
{
filename
:
~
str
,
loline
:
uint
,
locol
:
uint
,
hiline
:
uint
,
hicol
:
uint
,
pub
filename
:
~
str
,
pub
loline
:
uint
,
pub
locol
:
uint
,
pub
hiline
:
uint
,
pub
hicol
:
uint
,
}
impl
Clean
<
Span
>
for
syntax
::
codemap
::
Span
{
...
...
@@ -876,8 +884,8 @@ fn clean(&self) -> Span {
#[deriving(Clone,
Encodable,
Decodable)]
pub
struct
Path
{
global
:
bool
,
segments
:
Vec
<
PathSegment
>
,
pub
global
:
bool
,
pub
segments
:
Vec
<
PathSegment
>
,
}
impl
Clean
<
Path
>
for
ast
::
Path
{
...
...
@@ -891,9 +899,9 @@ fn clean(&self) -> Path {
#[deriving(Clone,
Encodable,
Decodable)]
pub
struct
PathSegment
{
name
:
~
str
,
lifetimes
:
Vec
<
Lifetime
>
,
types
:
Vec
<
Type
>
,
pub
name
:
~
str
,
pub
lifetimes
:
Vec
<
Lifetime
>
,
pub
types
:
Vec
<
Type
>
,
}
impl
Clean
<
PathSegment
>
for
ast
::
PathSegment
{
...
...
@@ -930,8 +938,8 @@ fn clean(&self) -> ~str {
#[deriving(Clone,
Encodable,
Decodable)]
pub
struct
Typedef
{
type_
:
Type
,
generics
:
Generics
,
pub
type_
:
Type
,
pub
generics
:
Generics
,
}
impl
Clean
<
Item
>
for
doctree
::
Typedef
{
...
...
@@ -952,10 +960,10 @@ fn clean(&self) -> Item {
#[deriving(Clone,
Encodable,
Decodable)]
pub
struct
BareFunctionDecl
{
purity
:
ast
::
Purity
,
generics
:
Generics
,
decl
:
FnDecl
,
abi
:
~
str
pu
b
pu
rity
:
ast
::
Purity
,
pub
generics
:
Generics
,
pub
decl
:
FnDecl
,
pub
abi
:
~
str
,
}
impl
Clean
<
BareFunctionDecl
>
for
ast
::
BareFnTy
{
...
...
@@ -974,12 +982,12 @@ fn clean(&self) -> BareFunctionDecl {
#[deriving(Clone,
Encodable,
Decodable)]
pub
struct
Static
{
type_
:
Type
,
mutability
:
Mutability
,
pub
type_
:
Type
,
pub
mutability
:
Mutability
,
/// It's useful to have the value of a static documented, but I have no
/// desire to represent expressions (that'd basically be all of the AST,
/// which is huge!). So, have a string.
expr
:
~
str
,
pub
expr
:
~
str
,
}
impl
Clean
<
Item
>
for
doctree
::
Static
{
...
...
@@ -1017,11 +1025,11 @@ fn clean(&self) -> Mutability {
#[deriving(Clone,
Encodable,
Decodable)]
pub
struct
Impl
{
generics
:
Generics
,
trait_
:
Option
<
Type
>
,
for_
:
Type
,
methods
:
Vec
<
Item
>
,
derived
:
bool
,
pub
generics
:
Generics
,
pub
trait_
:
Option
<
Type
>
,
pub
for_
:
Type
,
pub
methods
:
Vec
<
Item
>
,
pub
derived
:
bool
,
}
impl
Clean
<
Item
>
for
doctree
::
Impl
{
...
...
@@ -1056,7 +1064,7 @@ fn clean(&self) -> Item {
#[deriving(Clone,
Encodable,
Decodable)]
pub
struct
ViewItem
{
inner
:
ViewItemInner
pub
inner
:
ViewItemInner
,
}
impl
Clean
<
Item
>
for
ast
::
ViewItem
{
...
...
@@ -1109,8 +1117,8 @@ pub enum ViewPath {
#[deriving(Clone,
Encodable,
Decodable)]
pub
struct
ImportSource
{
path
:
Path
,
did
:
Option
<
ast
::
DefId
>
,
p
ub
p
ath
:
Path
,
pub
did
:
Option
<
ast
::
DefId
>
,
}
impl
Clean
<
ViewPath
>
for
ast
::
ViewPath
{
...
...
@@ -1130,8 +1138,8 @@ fn clean(&self) -> ViewPath {
#[deriving(Clone,
Encodable,
Decodable)]
pub
struct
ViewListIdent
{
name
:
~
str
,
source
:
Option
<
ast
::
DefId
>
,
pub
name
:
~
str
,
pub
source
:
Option
<
ast
::
DefId
>
,
}
impl
Clean
<
ViewListIdent
>
for
ast
::
PathListIdent
{
...
...
@@ -1311,7 +1319,7 @@ fn resolve_def(id: ast::NodeId) -> Option<ast::DefId> {
#[deriving(Clone,
Encodable,
Decodable)]
pub
struct
Macro
{
source
:
~
str
,
pub
source
:
~
str
,
}
impl
Clean
<
Item
>
for
doctree
::
Macro
{
...
...
src/librustdoc/core.rs
浏览文件 @
eb08e8fe
...
...
@@ -32,8 +32,8 @@ pub enum MaybeTyped {
}
pub
struct
DocContext
{
krate
:
ast
::
Crate
,
maybe_typed
:
MaybeTyped
pub
krate
:
ast
::
Crate
,
pub
maybe_typed
:
MaybeTyped
}
impl
DocContext
{
...
...
@@ -46,8 +46,8 @@ pub fn sess<'a>(&'a self) -> &'a driver::session::Session {
}
pub
struct
CrateAnalysis
{
exported_items
:
privacy
::
ExportedItems
,
public_items
:
privacy
::
PublicItems
,
pub
exported_items
:
privacy
::
ExportedItems
,
pub
pub
lic_items
:
privacy
::
PublicItems
,
}
/// Parses, resolves, and typechecks the given crate
...
...
src/librustdoc/doctree.rs
浏览文件 @
eb08e8fe
...
...
@@ -17,23 +17,23 @@
use
syntax
::
ast
::{
Ident
,
NodeId
};
pub
struct
Module
{
name
:
Option
<
Ident
>
,
attrs
:
Vec
<
ast
::
Attribute
>
,
where
:
Span
,
structs
:
Vec
<
Struct
>
,
enums
:
Vec
<
Enum
>
,
fns
:
Vec
<
Function
>
,
mods
:
Vec
<
Module
>
,
id
:
NodeId
,
typedefs
:
Vec
<
Typedef
>
,
statics
:
Vec
<
Static
>
,
traits
:
Vec
<
Trait
>
,
vis
:
ast
::
Visibility
,
impls
:
Vec
<
Impl
>
,
foreigns
:
Vec
<
ast
::
ForeignMod
>
,
view_items
:
Vec
<
ast
::
ViewItem
>
,
macros
:
Vec
<
Macro
>
,
is_crate
:
bool
,
pub
name
:
Option
<
Ident
>
,
pub
attrs
:
Vec
<
ast
::
Attribute
>
,
pub
where
:
Span
,
pub
structs
:
Vec
<
Struct
>
,
pub
enums
:
Vec
<
Enum
>
,
pub
fns
:
Vec
<
Function
>
,
pub
mods
:
Vec
<
Module
>
,
pub
id
:
NodeId
,
pub
typedefs
:
Vec
<
Typedef
>
,
pub
statics
:
Vec
<
Static
>
,
pub
traits
:
Vec
<
Trait
>
,
pub
vis
:
ast
::
Visibility
,
pub
impls
:
Vec
<
Impl
>
,
pub
foreigns
:
Vec
<
ast
::
ForeignMod
>
,
pub
view_items
:
Vec
<
ast
::
ViewItem
>
,
pub
macros
:
Vec
<
Macro
>
,
pub
is_crate
:
bool
,
}
impl
Module
{
...
...
@@ -78,94 +78,94 @@ pub enum TypeBound {
}
pub
struct
Struct
{
vis
:
ast
::
Visibility
,
id
:
NodeId
,
struct_type
:
StructType
,
name
:
Ident
,
generics
:
ast
::
Generics
,
attrs
:
Vec
<
ast
::
Attribute
>
,
fields
:
Vec
<
ast
::
StructField
>
,
where
:
Span
,
pub
vis
:
ast
::
Visibility
,
pub
id
:
NodeId
,
pub
struct_type
:
StructType
,
pub
name
:
Ident
,
pub
generics
:
ast
::
Generics
,
pub
attrs
:
Vec
<
ast
::
Attribute
>
,
pub
fields
:
Vec
<
ast
::
StructField
>
,
pub
where
:
Span
,
}
pub
struct
Enum
{
vis
:
ast
::
Visibility
,
variants
:
Vec
<
Variant
>
,
generics
:
ast
::
Generics
,
attrs
:
Vec
<
ast
::
Attribute
>
,
id
:
NodeId
,
where
:
Span
,
name
:
Ident
,
pub
vis
:
ast
::
Visibility
,
pub
variants
:
Vec
<
Variant
>
,
pub
generics
:
ast
::
Generics
,
pub
attrs
:
Vec
<
ast
::
Attribute
>
,
pub
id
:
NodeId
,
pub
where
:
Span
,
pub
name
:
Ident
,
}
pub
struct
Variant
{
name
:
Ident
,
attrs
:
Vec
<
ast
::
Attribute
>
,
kind
:
ast
::
VariantKind
,
id
:
ast
::
NodeId
,
vis
:
ast
::
Visibility
,
where
:
Span
,
pub
name
:
Ident
,
pub
attrs
:
Vec
<
ast
::
Attribute
>
,
pub
kind
:
ast
::
VariantKind
,
pub
id
:
ast
::
NodeId
,
pub
vis
:
ast
::
Visibility
,
pub
where
:
Span
,
}
pub
struct
Function
{
decl
:
ast
::
FnDecl
,
attrs
:
Vec
<
ast
::
Attribute
>
,
id
:
NodeId
,
name
:
Ident
,
vis
:
ast
::
Visibility
,
purity
:
ast
::
Purity
,
where
:
Span
,
generics
:
ast
::
Generics
,
pub
decl
:
ast
::
FnDecl
,
pub
attrs
:
Vec
<
ast
::
Attribute
>
,
pub
id
:
NodeId
,
pub
name
:
Ident
,
pub
vis
:
ast
::
Visibility
,
pu
b
pu
rity
:
ast
::
Purity
,
pub
where
:
Span
,
pub
generics
:
ast
::
Generics
,
}
pub
struct
Typedef
{
ty
:
ast
::
P
<
ast
::
Ty
>
,
gen
:
ast
::
Generics
,
name
:
Ident
,
id
:
ast
::
NodeId
,
attrs
:
Vec
<
ast
::
Attribute
>
,
where
:
Span
,
vis
:
ast
::
Visibility
,
pub
ty
:
ast
::
P
<
ast
::
Ty
>
,
pub
gen
:
ast
::
Generics
,
pub
name
:
Ident
,
pub
id
:
ast
::
NodeId
,
pub
attrs
:
Vec
<
ast
::
Attribute
>
,
pub
where
:
Span
,
pub
vis
:
ast
::
Visibility
,
}
pub
struct
Static
{
type_
:
ast
::
P
<
ast
::
Ty
>
,
mutability
:
ast
::
Mutability
,
expr
:
@
ast
::
Expr
,
name
:
Ident
,
attrs
:
Vec
<
ast
::
Attribute
>
,
vis
:
ast
::
Visibility
,
id
:
ast
::
NodeId
,
where
:
Span
,
pub
type_
:
ast
::
P
<
ast
::
Ty
>
,
pub
mutability
:
ast
::
Mutability
,
pub
expr
:
@
ast
::
Expr
,
pub
name
:
Ident
,
pub
attrs
:
Vec
<
ast
::
Attribute
>
,
pub
vis
:
ast
::
Visibility
,
pub
id
:
ast
::
NodeId
,
pub
where
:
Span
,
}
pub
struct
Trait
{
name
:
Ident
,
methods
:
Vec
<
ast
::
TraitMethod
>
,
//should be TraitMethod
generics
:
ast
::
Generics
,
p
arents
:
Vec
<
ast
::
TraitRef
>
,
attrs
:
Vec
<
ast
::
Attribute
>
,
id
:
ast
::
NodeId
,
where
:
Span
,
vis
:
ast
::
Visibility
,
pub
name
:
Ident
,
pub
methods
:
Vec
<
ast
::
TraitMethod
>
,
//should be TraitMethod
pub
generics
:
ast
::
Generics
,
p
ub
parents
:
Vec
<
ast
::
TraitRef
>
,
pub
attrs
:
Vec
<
ast
::
Attribute
>
,
pub
id
:
ast
::
NodeId
,
pub
where
:
Span
,
pub
vis
:
ast
::
Visibility
,
}
pub
struct
Impl
{
generics
:
ast
::
Generics
,
trait_
:
Option
<
ast
::
TraitRef
>
,
for_
:
ast
::
P
<
ast
::
Ty
>
,
methods
:
Vec
<@
ast
::
Method
>
,
attrs
:
Vec
<
ast
::
Attribute
>
,
where
:
Span
,
vis
:
ast
::
Visibility
,
id
:
ast
::
NodeId
,
pub
generics
:
ast
::
Generics
,
pub
trait_
:
Option
<
ast
::
TraitRef
>
,
pub
for_
:
ast
::
P
<
ast
::
Ty
>
,
pub
methods
:
Vec
<@
ast
::
Method
>
,
pub
attrs
:
Vec
<
ast
::
Attribute
>
,
pub
where
:
Span
,
pub
vis
:
ast
::
Visibility
,
pub
id
:
ast
::
NodeId
,
}
pub
struct
Macro
{
name
:
Ident
,
id
:
ast
::
NodeId
,
attrs
:
Vec
<
ast
::
Attribute
>
,
where
:
Span
,
pub
name
:
Ident
,
pub
id
:
ast
::
NodeId
,
pub
attrs
:
Vec
<
ast
::
Attribute
>
,
pub
where
:
Span
,
}
pub
fn
struct_type_from_def
(
sd
:
&
ast
::
StructDef
)
->
StructType
{
...
...
src/librustdoc/flock.rs
浏览文件 @
eb08e8fe
...
...
@@ -27,14 +27,14 @@ mod os {
use
std
::
libc
;
pub
struct
flock
{
l_type
:
libc
::
c_short
,
l_whence
:
libc
::
c_short
,
l_start
:
libc
::
off_t
,
l_len
:
libc
::
off_t
,
l_pid
:
libc
::
pid_t
,
pub
l_type
:
libc
::
c_short
,
pub
l_whence
:
libc
::
c_short
,
pub
l_start
:
libc
::
off_t
,
pub
l_len
:
libc
::
off_t
,
pub
l_pid
:
libc
::
pid_t
,
// not actually here, but brings in line with freebsd
l_sysid
:
libc
::
c_int
,
pub
l_sysid
:
libc
::
c_int
,
}
pub
static
F_WRLCK
:
libc
::
c_short
=
1
;
...
...
@@ -48,12 +48,12 @@ mod os {
use
std
::
libc
;
pub
struct
flock
{
l_start
:
libc
::
off_t
,
l_len
:
libc
::
off_t
,
l_pid
:
libc
::
pid_t
,
l_type
:
libc
::
c_short
,
l_whence
:
libc
::
c_short
,
l_sysid
:
libc
::
c_int
,
pub
l_start
:
libc
::
off_t
,
pub
l_len
:
libc
::
off_t
,
pub
l_pid
:
libc
::
pid_t
,
pub
l_type
:
libc
::
c_short
,
pub
l_whence
:
libc
::
c_short
,
pub
l_sysid
:
libc
::
c_int
,
}
pub
static
F_UNLCK
:
libc
::
c_short
=
2
;
...
...
@@ -67,14 +67,14 @@ mod os {
use
std
::
libc
;
pub
struct
flock
{
l_start
:
libc
::
off_t
,
l_len
:
libc
::
off_t
,
l_pid
:
libc
::
pid_t
,
l_type
:
libc
::
c_short
,
l_whence
:
libc
::
c_short
,
pub
l_start
:
libc
::
off_t
,
pub
l_len
:
libc
::
off_t
,
pub
l_pid
:
libc
::
pid_t
,
pub
l_type
:
libc
::
c_short
,
pub
l_whence
:
libc
::
c_short
,
// not actually here, but brings in line with freebsd
l_sysid
:
libc
::
c_int
,
pub
l_sysid
:
libc
::
c_int
,
}
pub
static
F_UNLCK
:
libc
::
c_short
=
2
;
...
...
@@ -84,7 +84,7 @@ pub struct flock {
}
pub
struct
Lock
{
priv
fd
:
libc
::
c_int
,
fd
:
libc
::
c_int
,
}
impl
Lock
{
...
...
@@ -155,7 +155,7 @@ fn UnlockFileEx(hFile: libc::HANDLE,
}
pub
struct
Lock
{
priv
handle
:
libc
::
HANDLE
,
handle
:
libc
::
HANDLE
,
}
impl
Lock
{
...
...
src/librustdoc/html/layout.rs
浏览文件 @
eb08e8fe
...
...
@@ -13,15 +13,15 @@
#[deriving(Clone)]
pub
struct
Layout
{
logo
:
~
str
,
favicon
:
~
str
,
krate
:
~
str
,
pub
logo
:
~
str
,
pub
favicon
:
~
str
,
pub
krate
:
~
str
,
}
pub
struct
Page
<
'a
>
{
title
:
&
'a
str
,
ty
:
&
'a
str
,
root_path
:
&
'a
str
,
pub
title
:
&
'a
str
,
pub
ty
:
&
'a
str
,
pub
root_path
:
&
'a
str
,
}
pub
fn
render
<
T
:
fmt
::
Show
,
S
:
fmt
::
Show
>
(
...
...
src/librustdoc/html/render.rs
浏览文件 @
eb08e8fe
...
...
@@ -68,26 +68,26 @@
pub
struct
Context
{
/// Current hierarchy of components leading down to what's currently being
/// rendered
current
:
Vec
<~
str
>
,
pub
current
:
Vec
<~
str
>
,
/// String representation of how to get back to the root path of the 'doc/'
/// folder in terms of a relative URL.
root_path
:
~
str
,
pub
root_path
:
~
str
,
/// The current destination folder of where HTML artifacts should be placed.
/// This changes as the context descends into the module hierarchy.
dst
:
Path
,
pub
dst
:
Path
,
/// This describes the layout of each page, and is not modified after
/// creation of the context (contains info like the favicon)
layout
:
layout
::
Layout
,
pub
layout
:
layout
::
Layout
,
/// This map is a list of what should be displayed on the sidebar of the
/// current page. The key is the section header (traits, modules,
/// functions), and the value is the list of containers belonging to this
/// header. This map will change depending on the surrounding context of the
/// page.
sidebar
:
HashMap
<~
str
,
Vec
<~
str
>
>
,
pub
sidebar
:
HashMap
<~
str
,
Vec
<~
str
>
>
,
/// This flag indicates whether [src] links should be generated or not. If
/// the source files are present in the html rendering, then this will be
/// `true`.
include_sources
:
bool
,
pub
include_sources
:
bool
,
}
/// Indicates where an external crate can be found.
...
...
@@ -122,7 +122,7 @@ pub struct Cache {
/// Mapping of typaram ids to the name of the type parameter. This is used
/// when pretty-printing a type (so pretty printing doesn't have to
/// painfully maintain a context like this)
typarams
:
HashMap
<
ast
::
NodeId
,
~
str
>
,
pub
typarams
:
HashMap
<
ast
::
NodeId
,
~
str
>
,
/// Maps a type id to all known implementations for that type. This is only
/// recognized for intra-crate `ResolvedPath` types, and is used to print
...
...
@@ -130,43 +130,43 @@ pub struct Cache {
///
/// The values of the map are a list of implementations and documentation
/// found on that implementation.
impls
:
HashMap
<
ast
::
NodeId
,
Vec
<
(
clean
::
Impl
,
Option
<~
str
>
)
>
>
,
pub
impls
:
HashMap
<
ast
::
NodeId
,
Vec
<
(
clean
::
Impl
,
Option
<~
str
>
)
>
>
,
/// Maintains a mapping of local crate node ids to the fully qualified name
/// and "short type description" of that node. This is used when generating
/// URLs when a type is being linked to. External paths are not located in
/// this map because the `External` type itself has all the information
/// necessary.
paths
:
HashMap
<
ast
::
NodeId
,
(
Vec
<~
str
>
,
&
'static
str
)
>
,
p
ub
p
aths
:
HashMap
<
ast
::
NodeId
,
(
Vec
<~
str
>
,
&
'static
str
)
>
,
/// This map contains information about all known traits of this crate.
/// Implementations of a crate should inherit the documentation of the
/// parent trait if no extra documentation is specified, and default methods
/// should show up in documentation about trait implementations.
traits
:
HashMap
<
ast
::
NodeId
,
clean
::
Trait
>
,
pub
traits
:
HashMap
<
ast
::
NodeId
,
clean
::
Trait
>
,
/// When rendering traits, it's often useful to be able to list all
/// implementors of the trait, and this mapping is exactly, that: a mapping
/// of trait ids to the list of known implementors of the trait
implementors
:
HashMap
<
ast
::
NodeId
,
Vec
<
Implementor
>
>
,
pub
implementors
:
HashMap
<
ast
::
NodeId
,
Vec
<
Implementor
>
>
,
/// Cache of where external crate documentation can be found.
extern_locations
:
HashMap
<
ast
::
CrateNum
,
ExternalLocation
>
,
pub
extern_locations
:
HashMap
<
ast
::
CrateNum
,
ExternalLocation
>
,
// Private fields only used when initially crawling a crate to build a cache
priv
stack
:
Vec
<~
str
>
,
p
riv
p
arent_stack
:
Vec
<
ast
::
NodeId
>
,
priv
search_index
:
Vec
<
IndexItem
>
,
priv
priv
mod
:
bool
,
p
riv
p
ublic_items
:
NodeSet
,
stack
:
Vec
<~
str
>
,
parent_stack
:
Vec
<
ast
::
NodeId
>
,
search_index
:
Vec
<
IndexItem
>
,
privmod
:
bool
,
public_items
:
NodeSet
,
// In rare case where a structure is defined in one module but implemented
// in another, if the implementing module is parsed before defining module,
// then the fully qualified name of the structure isn't presented in `paths`
// yet when its implementation methods are being indexed. Caches such methods
// and their parent id here and indexes them at the end of crate parsing.
priv
orphan_methods
:
Vec
<
(
ast
::
NodeId
,
clean
::
Item
)
>
,
orphan_methods
:
Vec
<
(
ast
::
NodeId
,
clean
::
Item
)
>
,
}
/// Helper struct to render all source code to HTML pages
...
...
src/librustdoc/html/toc.rs
浏览文件 @
eb08e8fe
...
...
@@ -26,7 +26,7 @@ pub struct Toc {
/// # Main
/// ### A
/// ## B
priv
entries
:
Vec
<
TocEntry
>
entries
:
Vec
<
TocEntry
>
}
impl
Toc
{
...
...
@@ -37,17 +37,17 @@ fn count_entries_with_level(&self, level: u32) -> uint {
#[deriving(Eq)]
pub
struct
TocEntry
{
priv
level
:
u32
,
priv
sec_number
:
~
str
,
priv
name
:
~
str
,
priv
id
:
~
str
,
priv
children
:
Toc
,
level
:
u32
,
sec_number
:
~
str
,
name
:
~
str
,
id
:
~
str
,
children
:
Toc
,
}
/// Progressive construction of a table of contents.
#[deriving(Eq)]
pub
struct
TocBuilder
{
priv
top_level
:
Toc
,
top_level
:
Toc
,
/// The current heirachy of parent headings, the levels are
/// strictly increasing (i.e. chain[0].level < chain[1].level <
/// ...) with each entry being the most recent occurance of a
...
...
@@ -56,7 +56,7 @@ pub struct TocBuilder {
/// the most recent one).
///
/// We also have `chain[0].level <= top_level.entries[last]`.
priv
chain
:
Vec
<
TocEntry
>
chain
:
Vec
<
TocEntry
>
}
impl
TocBuilder
{
...
...
src/librustdoc/plugins.rs
浏览文件 @
eb08e8fe
...
...
@@ -19,10 +19,10 @@
/// Manages loading and running of plugins
pub
struct
PluginManager
{
priv
dylibs
:
Vec
<
dl
::
DynamicLibrary
>
,
priv
callbacks
:
Vec
<
PluginCallback
>
,
dylibs
:
Vec
<
dl
::
DynamicLibrary
>
,
callbacks
:
Vec
<
PluginCallback
>
,
/// The directory plugins will be loaded from
prefix
:
Path
,
p
ub
p
refix
:
Path
,
}
impl
PluginManager
{
...
...
src/librustdoc/test.rs
浏览文件 @
eb08e8fe
...
...
@@ -190,15 +190,15 @@ fn maketest(s: &str, cratename: &str, loose_feature_gating: bool) -> ~str {
}
pub
struct
Collector
{
tests
:
Vec
<
testing
::
TestDescAndFn
>
,
priv
names
:
Vec
<~
str
>
,
priv
libs
:
HashSet
<
Path
>
,
priv
cnt
:
uint
,
priv
use_headers
:
bool
,
priv
current_header
:
Option
<~
str
>
,
priv
cratename
:
~
str
,
priv
loose_feature_gating
:
bool
pub
tests
:
Vec
<
testing
::
TestDescAndFn
>
,
names
:
Vec
<~
str
>
,
libs
:
HashSet
<
Path
>
,
cnt
:
uint
,
use_headers
:
bool
,
current_header
:
Option
<~
str
>
,
cratename
:
~
str
,
loose_feature_gating
:
bool
}
impl
Collector
{
...
...
src/librustdoc/visit_ast.rs
浏览文件 @
eb08e8fe
...
...
@@ -21,10 +21,10 @@
use
doctree
::
*
;
pub
struct
RustdocVisitor
<
'a
>
{
module
:
Module
,
attrs
:
Vec
<
ast
::
Attribute
>
,
cx
:
&
'a
core
::
DocContext
,
analysis
:
Option
<&
'a
core
::
CrateAnalysis
>
,
pub
module
:
Module
,
pub
attrs
:
Vec
<
ast
::
Attribute
>
,
pub
cx
:
&
'a
core
::
DocContext
,
pub
analysis
:
Option
<&
'a
core
::
CrateAnalysis
>
,
}
impl
<
'a
>
RustdocVisitor
<
'a
>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录