cleanup hir hack
This commit is contained in:
parent
626649ff1f
commit
9c1a91628b
1 changed files with 1 additions and 7 deletions
|
@ -3234,12 +3234,7 @@ impl<'hir> Node<'hir> {
|
|||
}
|
||||
}
|
||||
|
||||
/// Returns `Constness::Const` when this node is a const fn/impl/item,
|
||||
///
|
||||
/// HACK(fee1-dead): or an associated type in a trait. This works because
|
||||
/// only typeck cares about const trait predicates, so although the predicates
|
||||
/// query would return const predicates when it does not need to be const,
|
||||
/// it wouldn't have any effect.
|
||||
/// Returns `Constness::Const` when this node is a const fn/impl/item.
|
||||
pub fn constness_for_typeck(&self) -> Constness {
|
||||
match self {
|
||||
Node::Item(Item {
|
||||
|
@ -3258,7 +3253,6 @@ impl<'hir> Node<'hir> {
|
|||
|
||||
Node::Item(Item { kind: ItemKind::Const(..), .. })
|
||||
| Node::TraitItem(TraitItem { kind: TraitItemKind::Const(..), .. })
|
||||
| Node::TraitItem(TraitItem { kind: TraitItemKind::Type(..), .. })
|
||||
| Node::ImplItem(ImplItem { kind: ImplItemKind::Const(..), .. }) => Constness::Const,
|
||||
|
||||
_ => Constness::NotConst,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue