Better docs for librustc/hir/def.rs
This commit is contained in:
parent
4225019750
commit
83e106a303
1 changed files with 15 additions and 10 deletions
|
@ -17,11 +17,11 @@ use hir;
|
||||||
|
|
||||||
#[derive(Clone, Copy, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]
|
#[derive(Clone, Copy, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]
|
||||||
pub enum CtorKind {
|
pub enum CtorKind {
|
||||||
// Constructor function automatically created by a tuple struct/variant.
|
/// Constructor function automatically created by a tuple struct/variant.
|
||||||
Fn,
|
Fn,
|
||||||
// Constructor constant automatically created by a unit struct/variant.
|
/// Constructor constant automatically created by a unit struct/variant.
|
||||||
Const,
|
Const,
|
||||||
// Unusable name in value namespace created by a struct variant.
|
/// Unusable name in value namespace created by a struct variant.
|
||||||
Fictive,
|
Fictive,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -109,17 +109,21 @@ impl PathResolution {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Definition mapping
|
/// Definition mapping
|
||||||
pub type DefMap = NodeMap<PathResolution>;
|
pub type DefMap = NodeMap<PathResolution>;
|
||||||
// This is the replacement export map. It maps a module to all of the exports
|
|
||||||
// within.
|
/// This is the replacement export map. It maps a module to all of the exports
|
||||||
|
/// within.
|
||||||
pub type ExportMap = NodeMap<Vec<Export>>;
|
pub type ExportMap = NodeMap<Vec<Export>>;
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug, RustcEncodable, RustcDecodable)]
|
#[derive(Copy, Clone, Debug, RustcEncodable, RustcDecodable)]
|
||||||
pub struct Export {
|
pub struct Export {
|
||||||
pub ident: ast::Ident, // The name of the target.
|
/// The name of the target.
|
||||||
pub def: Def, // The definition of the target.
|
pub ident: ast::Ident,
|
||||||
pub span: Span, // The span of the target definition.
|
/// The definition of the target.
|
||||||
|
pub def: Def,
|
||||||
|
/// The span of the target definition.
|
||||||
|
pub span: Span,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl CtorKind {
|
impl CtorKind {
|
||||||
|
@ -159,7 +163,8 @@ impl Def {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// A human readable kind name
|
||||||
pub fn kind_name(&self) -> &'static str {
|
pub fn kind_name(&self) -> &'static str {
|
||||||
match *self {
|
match *self {
|
||||||
Def::Fn(..) => "function",
|
Def::Fn(..) => "function",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue