Add detection of dead struct fields
This commit is contained in:
parent
7580ef902e
commit
0271224bda
3 changed files with 155 additions and 2 deletions
|
@ -1046,6 +1046,15 @@ pub struct StructField_ {
|
|||
pub attrs: Vec<Attribute>,
|
||||
}
|
||||
|
||||
impl StructField_ {
|
||||
pub fn ident(&self) -> Option<Ident> {
|
||||
match self.kind {
|
||||
NamedField(ref ident, _) => Some(ident.clone()),
|
||||
UnnamedField(_) => None
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub type StructField = Spanned<StructField_>;
|
||||
|
||||
#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue