1
Fork 0

No more TyCtxt::lazy_normalization

This commit is contained in:
Michael Goulet 2023-06-01 19:56:46 +00:00
parent 794249d768
commit 4fbb43e70f
6 changed files with 8 additions and 14 deletions

View file

@ -50,7 +50,7 @@ pub(super) fn generics_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::Generics {
// We do not allow generic parameters in anon consts if we are inside
// of a const parameter type, e.g. `struct Foo<const N: usize, const M: [u8; N]>` is not allowed.
None
} else if tcx.lazy_normalization() {
} else if tcx.features().generic_const_exprs {
let parent_node = tcx.hir().get_parent(hir_id);
if let Node::Variant(Variant { disr_expr: Some(constant), .. }) = parent_node
&& constant.hir_id == hir_id