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:
parent
104aaa44e8
commit
7de48419ee
10 changed files with 30 additions and 21 deletions
|
|
@ -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)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue