auto merge of #14696 : jakub-/rust/dead-struct-fields, r=alexcrichton
This uncovered some dead code, most notably in middle/liveness.rs, which I think suggests there must be something fishy with that part of the code. The #[allow(dead_code)] annotations on some of the fields I am not super happy about but as I understand, marker type may disappear at some point.
This commit is contained in:
@@ -1053,6 +1053,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)]
|
||||
|
||||
Reference in New Issue
Block a user