Rollup merge of #27030 - nrc:save-ctors, r=alexcrichton
This commit is contained in:
commit
77d5fca3ef
4 changed files with 48 additions and 17 deletions
|
|
@ -411,6 +411,13 @@ impl<'ast> Map<'ast> {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn expect_trait_item(&self, id: NodeId) -> &'ast TraitItem {
|
||||
match self.find(id) {
|
||||
Some(NodeTraitItem(item)) => item,
|
||||
_ => panic!("expected trait item, found {}", self.node_to_string(id))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn expect_struct(&self, id: NodeId) -> &'ast StructDef {
|
||||
match self.find(id) {
|
||||
Some(NodeItem(i)) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue