Add new diagnostic
This commit is contained in:
parent
082e4ca497
commit
14a127be3e
17 changed files with 234 additions and 30 deletions
|
@ -3314,6 +3314,12 @@ impl<'hir> Node<'hir> {
|
|||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
/// Get the fields for the tuple-constructor,
|
||||
/// if this node is a tuple constructor, otherwise None
|
||||
pub fn tuple_fields(&self) -> Option<&'hir [FieldDef<'hir>]> {
|
||||
if let Node::Ctor(&VariantData::Tuple(fields, _)) = self { Some(fields) } else { None }
|
||||
}
|
||||
}
|
||||
|
||||
// Some nodes are used a lot. Make sure they don't unintentionally get bigger.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue