fn check_assoc_const_binding_type<'tcx>(
    tcx: TyCtxt<'tcx>,
    assoc_const: Ident,
    ty: Binder<'tcx, Ty<'tcx>>,
    hir_id: HirId
) -> Ty<'tcx>
Expand description

Detect and reject early-bound & escaping late-bound generic params in the type of assoc const bindings.

FIXME(const_generics): This is a temporary and semi-artifical restriction until the arrival of generic const generics1.

It might actually be possible that we can already support early-bound generic params in such types if we just lifted some more checks in other places, too, for example inside ty::Const::from_anon_const. However, even if that were the case, we should probably gate this behind another feature flag.