Lower anonymous structs or unions to HIR
This commit is contained in:
parent
084ce5bdb5
commit
879a1e5713
38 changed files with 288 additions and 174 deletions
|
@ -756,6 +756,13 @@ impl<'hir> Map<'hir> {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn expect_field(self, id: HirId) -> &'hir FieldDef<'hir> {
|
||||
match self.tcx.hir_node(id) {
|
||||
Node::Field(field) => field,
|
||||
_ => bug!("expected field, found {}", self.node_to_string(id)),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn expect_foreign_item(self, id: OwnerId) -> &'hir ForeignItem<'hir> {
|
||||
match self.tcx.hir_owner_node(id) {
|
||||
OwnerNode::ForeignItem(item) => item,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue