Skip to content

Commit 48f115e

Browse files
committed
auto merge of #7940 : cmr/rust/comments, r=pnkfelix
2 parents 52b7fc1 + 93133ab commit 48f115e

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

Diff for: src/libsyntax/ast.rs

+12-8
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ pub struct ident { name: Name, ctxt: SyntaxContext }
3030
/// Construct an identifier with the given name and an empty context:
3131
pub fn new_ident(name: Name) -> ident { ident {name: name, ctxt: empty_ctxt}}
3232

33-
// a SyntaxContext represents a chain of macro-expandings
34-
// and renamings. Each macro expansion corresponds to
35-
// a fresh uint
33+
/// A SyntaxContext represents a chain of macro-expandings
34+
/// and renamings. Each macro expansion corresponds to
35+
/// a fresh uint
3636
3737
// I'm representing this syntax context as an index into
3838
// a table, in order to work around a compiler bug
@@ -70,11 +70,10 @@ pub enum SyntaxContext_ {
7070
IllegalCtxt()
7171
}
7272

73-
// a name is a part of an identifier, representing a string
74-
// or gensym. It's the result of interning.
73+
/// A name is a part of an identifier, representing a string or gensym. It's
74+
/// the result of interning.
7575
pub type Name = uint;
76-
// a mark represents a unique id associated
77-
// with a macro expansion
76+
/// A mark represents a unique id associated with a macro expansion
7877
pub type Mrk = uint;
7978

8079
impl<S:Encoder> Encodable<S> for ident {
@@ -90,7 +89,7 @@ impl<D:Decoder> Decodable<D> for ident {
9089
}
9190
}
9291

93-
// Functions may or may not have names.
92+
/// Function name (not all functions have names)
9493
pub type fn_ident = Option<ident>;
9594

9695
#[deriving(Clone, Eq, Encodable, Decodable, IterBytes)]
@@ -107,9 +106,14 @@ pub struct Lifetime {
107106
#[deriving(Clone, Eq, Encodable, Decodable, IterBytes)]
108107
pub struct Path {
109108
span: span,
109+
/// A `::foo` path, is relative to the crate root rather than current
110+
/// module (like paths in an import).
110111
global: bool,
112+
/// The segments in the path (the things separated by ::)
111113
idents: ~[ident],
114+
/// "Region parameter", currently only one lifetime is allowed in a path.
112115
rp: Option<Lifetime>,
116+
/// These are the type parameters, ie, the `a, b` in `foo::bar::<a, b>`
113117
types: ~[Ty],
114118
}
115119

0 commit comments

Comments
 (0)