}
impl MacroDef<'_> {
+ #[inline]
pub fn hir_id(&self) -> HirId {
HirId::make_owner(self.def_id)
}
expr
}
+ pub fn peel_blocks(&self) -> &Self {
+ let mut expr = self;
+ while let ExprKind::Block(Block { expr: Some(inner), .. }, _) = &expr.kind {
+ expr = inner;
+ }
+ expr
+ }
+
pub fn can_have_side_effects(&self) -> bool {
match self.peel_drop_temps().kind {
ExprKind::Path(_) | ExprKind::Lit(_) => false,
}
impl TraitItemId {
+ #[inline]
pub fn hir_id(&self) -> HirId {
// Items are always HIR owners.
HirId::make_owner(self.def_id)
}
impl TraitItem<'_> {
+ #[inline]
pub fn hir_id(&self) -> HirId {
// Items are always HIR owners.
HirId::make_owner(self.def_id)
}
impl ImplItemId {
+ #[inline]
pub fn hir_id(&self) -> HirId {
// Items are always HIR owners.
HirId::make_owner(self.def_id)
}
impl ImplItem<'_> {
+ #[inline]
pub fn hir_id(&self) -> HirId {
// Items are always HIR owners.
HirId::make_owner(self.def_id)
}
impl ItemId {
+ #[inline]
pub fn hir_id(&self) -> HirId {
// Items are always HIR owners.
HirId::make_owner(self.def_id)
}
impl Item<'_> {
+ #[inline]
pub fn hir_id(&self) -> HirId {
// Items are always HIR owners.
HirId::make_owner(self.def_id)
}
impl ForeignItemId {
+ #[inline]
pub fn hir_id(&self) -> HirId {
// Items are always HIR owners.
HirId::make_owner(self.def_id)
}
impl ForeignItem<'_> {
+ #[inline]
pub fn hir_id(&self) -> HirId {
// Items are always HIR owners.
HirId::make_owner(self.def_id)