diff options
| author | Deadbeef <ent3rm4n@gmail.com> | 2021-12-12 12:52:30 +0800 |
|---|---|---|
| committer | Deadbeef <ent3rm4n@gmail.com> | 2021-12-12 12:52:30 +0800 |
| commit | ffc9082d97cf88ac4d8f72bca0382b2499a0184d (patch) | |
| tree | eb307331c19977e01702e573501c33ec86cae368 | |
| parent | 83587e8d307a765b940957dad01706b1d97a2090 (diff) | |
| download | rust-ffc9082d97cf88ac4d8f72bca0382b2499a0184d.tar.gz rust-ffc9082d97cf88ac4d8f72bca0382b2499a0184d.zip | |
Remove function from rebase
| -rw-r--r-- | compiler/rustc_hir/src/hir.rs | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/compiler/rustc_hir/src/hir.rs b/compiler/rustc_hir/src/hir.rs index 28e1773a750..56ba3d1a445 100644 --- a/compiler/rustc_hir/src/hir.rs +++ b/compiler/rustc_hir/src/hir.rs @@ -3210,34 +3210,6 @@ impl<'hir> Node<'hir> { } } - pub fn hir_id(&self) -> Option<HirId> { - match self { - Node::Item(Item { def_id, .. }) - | Node::TraitItem(TraitItem { def_id, .. }) - | Node::ImplItem(ImplItem { def_id, .. }) - | Node::ForeignItem(ForeignItem { def_id, .. }) => Some(HirId::make_owner(*def_id)), - Node::Field(FieldDef { hir_id, .. }) - | Node::AnonConst(AnonConst { hir_id, .. }) - | Node::Expr(Expr { hir_id, .. }) - | Node::Stmt(Stmt { hir_id, .. }) - | Node::Ty(Ty { hir_id, .. }) - | Node::Binding(Pat { hir_id, .. }) - | Node::Pat(Pat { hir_id, .. }) - | Node::Arm(Arm { hir_id, .. }) - | Node::Block(Block { hir_id, .. }) - | Node::Local(Local { hir_id, .. }) - | Node::Lifetime(Lifetime { hir_id, .. }) - | Node::Param(Param { hir_id, .. }) - | Node::Infer(InferArg { hir_id, .. }) - | Node::GenericParam(GenericParam { hir_id, .. }) => Some(*hir_id), - Node::TraitRef(TraitRef { hir_ref_id, .. }) => Some(*hir_ref_id), - Node::PathSegment(PathSegment { hir_id, .. }) => *hir_id, - Node::Variant(Variant { id, .. }) => Some(*id), - Node::Ctor(variant) => variant.ctor_hir_id(), - Node::Crate(_) | Node::Visibility(_) => None, - } - } - pub fn as_owner(self) -> Option<OwnerNode<'hir>> { match self { Node::Item(i) => Some(OwnerNode::Item(i)), |
