pub fn as_str<'a>(&'a self) -> &'a str {
self.name.as_str()
}
-
- pub fn encode_with_hygiene(&self) -> String {
- format!("\x00name_{},ctxt_{}\x00",
- self.name.usize(),
- self.ctxt)
- }
}
impl fmt::Debug for Ident {
/// "None" means a * pattern where we don't bind the fields to names.
PatEnum(Path, Option<Vec<P<Pat>>>),
+ /// An associated const named using the qualified path `<T>::CONST` or
+ /// `<T as Trait>::CONST`. Associated consts from inherent impls can be
+ /// referred to as simply `T::CONST`, in which case they will end up as
+ /// PatEnum, and the resolver will have to sort that out.
+ PatQPath(QSelf, Path),
+
/// Destructuring of a struct, e.g. `Foo {x, y, ..}`
/// The `bool` is `true` in the presence of a `..`
PatStruct(Path, Vec<Spanned<FieldPat>>, bool),
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]
pub enum TraitItem_ {
+ ConstTraitItem(P<Ty>, Option<P<Expr>>),
MethodTraitItem(MethodSig, Option<P<Block>>),
TypeTraitItem(TyParamBounds, Option<P<Ty>>),
}
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]
pub enum ImplItem_ {
+ ConstImplItem(P<Ty>, P<Expr>),
MethodImplItem(MethodSig, P<Block>),
TypeImplItem(P<Ty>),
MacImplItem(Mac),
}
#[cfg(test)]
-mod test {
+mod tests {
use serialize;
use super::*;