clippy_utils

Function is_inside_always_const_context

Source
pub fn is_inside_always_const_context(tcx: TyCtxt<'_>, hir_id: HirId) -> bool
Expand description

Returns true if the given HirId is inside an always constant context.

This context includes:

  • const/static items
  • const blocks (or inline consts)
  • associated constants