Skip to content

Commit d823155

Browse files
committed
check for cycles in default_anon_const_substs
1 parent 3ea3257 commit d823155

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

compiler/rustc_typeck/src/collect/type_of.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,11 @@ fn get_path_containing_arg_in_pat<'hir>(
269269
}
270270

271271
pub(super) fn default_anon_const_substs(tcx: TyCtxt<'_>, def_id: DefId) -> SubstsRef<'_> {
272+
let generics = tcx.generics_of(def_id);
273+
if let Some(parent) = generics.parent {
274+
let _cycle_check = tcx.predicates_of(parent);
275+
}
276+
272277
let substs = InternalSubsts::identity_for_item(tcx, def_id);
273278
// We only expect the following lifetimes, types and constants as default substs.
274279
//

0 commit comments

Comments
 (0)