Skip to content

Commit bd46953

Browse files
authored
Rollup merge of #91780 - cjgillot:localize, r=Mark-Simulacrum
Remove hir::Node::hir_id. Small cleanup.
2 parents 72b6a91 + 67ada7a commit bd46953

File tree

1 file changed

+0
-28
lines changed

1 file changed

+0
-28
lines changed

compiler/rustc_hir/src/hir.rs

-28
Original file line numberDiff line numberDiff line change
@@ -3210,34 +3210,6 @@ impl<'hir> Node<'hir> {
32103210
}
32113211
}
32123212

3213-
pub fn hir_id(&self) -> Option<HirId> {
3214-
match self {
3215-
Node::Item(Item { def_id, .. })
3216-
| Node::TraitItem(TraitItem { def_id, .. })
3217-
| Node::ImplItem(ImplItem { def_id, .. })
3218-
| Node::ForeignItem(ForeignItem { def_id, .. }) => Some(HirId::make_owner(*def_id)),
3219-
Node::Field(FieldDef { hir_id, .. })
3220-
| Node::AnonConst(AnonConst { hir_id, .. })
3221-
| Node::Expr(Expr { hir_id, .. })
3222-
| Node::Stmt(Stmt { hir_id, .. })
3223-
| Node::Ty(Ty { hir_id, .. })
3224-
| Node::Binding(Pat { hir_id, .. })
3225-
| Node::Pat(Pat { hir_id, .. })
3226-
| Node::Arm(Arm { hir_id, .. })
3227-
| Node::Block(Block { hir_id, .. })
3228-
| Node::Local(Local { hir_id, .. })
3229-
| Node::Lifetime(Lifetime { hir_id, .. })
3230-
| Node::Param(Param { hir_id, .. })
3231-
| Node::Infer(InferArg { hir_id, .. })
3232-
| Node::GenericParam(GenericParam { hir_id, .. }) => Some(*hir_id),
3233-
Node::TraitRef(TraitRef { hir_ref_id, .. }) => Some(*hir_ref_id),
3234-
Node::PathSegment(PathSegment { hir_id, .. }) => *hir_id,
3235-
Node::Variant(Variant { id, .. }) => Some(*id),
3236-
Node::Ctor(variant) => variant.ctor_hir_id(),
3237-
Node::Crate(_) | Node::Visibility(_) => None,
3238-
}
3239-
}
3240-
32413213
/// Returns `Constness::Const` when this node is a const fn/impl/item.
32423214
pub fn constness_for_typeck(&self) -> Constness {
32433215
match self {

0 commit comments

Comments
 (0)