syntax: Permit visibility on tuple fields

This change is in preparation for #8122. Nothing is currently done with these
visibility qualifiers, they are just parsed and accepted by the compiler.

RFC: 0004-private-fields
This commit is contained in:
Alex Crichton 2014-03-25 16:53:52 -07:00
parent 104aaa44e8
commit 7de48419ee
10 changed files with 30 additions and 21 deletions

View file

@ -1080,7 +1080,16 @@ pub type StructField = Spanned<StructField_>;
#[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)]
pub enum StructFieldKind {
NamedField(Ident, Visibility),
UnnamedField // element of a tuple-like struct
UnnamedField(Visibility), // element of a tuple-like struct
}
impl StructFieldKind {
pub fn is_unnamed(&self) -> bool {
match *self {
UnnamedField(..) => true,
NamedField(..) => false,
}
}
}
#[deriving(Eq, TotalEq, Encodable, Decodable, Hash)]