1
Fork 0

cleanup hir hack

This commit is contained in:
Deadbeef 2021-09-01 08:08:40 +00:00
parent 626649ff1f
commit 9c1a91628b
No known key found for this signature in database
GPG key ID: 027DF9338862ADDD

View file

@ -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,