Skip to content

Commit 1e83407

Browse files
committed
split out remove jank parent stuff in generics of
1 parent 23ffa29 commit 1e83407

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

compiler/rustc_hir_analysis/src/collect/generics_of.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -77,21 +77,6 @@ pub(super) fn generics_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::Generics {
7777
// stable enough and does not need a feature gate anymore.
7878
Node::AnonConst(_) => {
7979
let parent_did = tcx.parent(def_id.to_def_id());
80-
81-
// We don't do this unconditionally because the `DefId` parent of an anon const
82-
// might be an implicitly created closure during `async fn` desugaring. This would
83-
// have the wrong generics.
84-
//
85-
// i.e. `async fn foo<'a>() { let a = [(); { 1 + 2 }]; bar().await() }`
86-
// would implicitly have a closure in its body that would be the parent of
87-
// the `{ 1 + 2 }` anon const. This closure's generics is simply a witness
88-
// instead of `['a]`.
89-
let parent_def_kind = tcx.def_kind(parent_did);
90-
let parent_did = if let DefKind::AnonConst = parent_def_kind {
91-
parent_did
92-
} else {
93-
tcx.hir_get_parent_item(hir_id).to_def_id()
94-
};
9580
debug!(?parent_did);
9681

9782
let mut in_param_ty = false;

0 commit comments

Comments
 (0)